oracle 报警日志、动态性能视图及数据字典
1、查看报警日志 /u01/app/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl.log 实时日志:tail -f /u01/app/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl.log 跟踪文件 ADR 2、动态性能视图(v$) 保存在内存中 用来访问 实例 内存结构的不断变化的状态的信息(控制文件+实例) session data wait events memory allocations Running SQL undo usage open cursors redo log usage .... 不同的时刻可以看不一样的动态性能视图: startup nomount阶段: select status from v$instance; select paddr,port from v$session; startup mount阶段: select open_mode from v$database; select name from v$datafile; select member from v$logfile; select addr from v$lock; select paddr,port from v$session; select * from v$sga; select count(*) from v$sql; startup 阶段: select * from v$pga; select count(*) from v$fixed_table where name like 'V$%';//查看动态性能视图有多少个表 3、数据字典 存在表中 table indexes views users schemals procedures ... DBA_ :访问一切对象 ALL_ :用户有权查看的一切对象 USER_ : 用户拥有的对象 select count(*) from dba_tables; select count(*) from all_tables; 例子::: alter user scott account unlock identified by tiger; SQL> conn scott/tiger; Connected. SQL> select * from tab; TNAME TABTYPE CLUSTERID ------------------------------ ------- ---------- BONUS TABLE DEPT TABLE EMP TABLE SALGRADE TABLE 查看scott用户可以查看哪些表,总共多少张表 SQL> select count(*) from all_tables; COUNT(*) ---------- 103 SQL> select count(*) from user_tables; COUNT(*) ---------- 4 查看scott用户拥有哪些表: SQL> select table_name from user_tables; TABLE_NAME ------------------------------ DEPT EMP BONUS SALGRADE ######## 查看所有用户 select username,account_status from dba_users; 查看有哪些数据字典表 select table_name from dictionary; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |