1. 程式人生 > >oracle 報警日誌、動態性能視圖及數據字典

oracle 報警日誌、動態性能視圖及數據字典

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;




本文出自 “梁小明的博客” 博客,請務必保留此出處http://7038006.blog.51cto.com/7028006/1925191

oracle 報警日誌、動態性能視圖及數據字典