1. Direction of DBA Development: Business DBA, architect (course 13, may be the case, but also reference)
2, develop good habits: less use of graphical interface, multi-use Sqlplus
3. Remember common SQL statements:
Size of the query tablespace (the size of the table space is the size of the database (the log file is not counted))
Select Tablespace_name,sum (user_bytes) from Dba_data_files GROUP by Tablespace_name
Union
Select Tablespace_name,sum (user_bytes) from Dba_temp_files Group by Tablespace_name;
Querying the size of a data object
Select Segment_name,segment_type,bytes from User_segments where segment_name in (' T ', ' idx_t ');
Query the current SQL statement for the session (assuming SID is 68)
Select sid,status,sql_id from v$session where sid = 68;
Select Sql_text from v$sql where sql_id = ' * * *;
The process number of the query session (operating system level)
Select spid from v$process where addr = (select Paddr from v$session where sid = 68);
Querying for blocked sessions
Select Sid,lmode,type,request,block from V$lock where type in (' TX ', ' TM ') Order by 1, 3;
Output Execution Plan
Method One: Set Autotrace on (trace exp);--Do not execute SQL, output execution plan only
Method Two: Explain plan for SELECT * from t;--Generate execution plan
SELECT * FROM table (dbms_xplan.display);--Output execution plan
Trace SQL statements
Method one: Alter session set Sql_trace = true;--Subsequent trace a SQL statement is output to a trace file
METHOD Two: Alter session set event ' 10046 Trace name context forever,level n ';
4, multi-query documents (beginners are not recommended to read the official documents directly, because the focus is not clear, difficult to adhere to, should be more practice)
Tips
You can query errors directly with error ora in Linux or Unix