Professional Documents
Culture Documents
1 2 3 4 5 6 7 8
Checks
Instance state # of database connections Checking Error Log File CPU utilization Check PID of top query Connect to Databse Run Database Statspack Database Instance status
10
11 12 13 14
Check sessions count Check Blocking sessions Check waiting sessions Check temp tbs usage Check long running sessions
15
16 17
19
20
21 Re-Run Database Statspack 22 23 24 Get Statspack Report and Analyze the report Get Long Running Queries Caculate Undo Retention
25 26
27 28 29` 30 31 32 33 34 35 36 37
How to Find full Table Scans Get Sql for a particular process id Database details for unix process id Compile Invalid Objects Memory for inactive sessions Steps to trace a users activities Database Growth Monthly Display SGA Statistics Show Database versions with options installed Gathering Statistics Performance issues after increasing work loads
38
Enable/Disable Triggers
C :\D ocum ent \ C ent ral \Not es\A t os\Recov ery _scenari os. doc
C :\D ocum ent \ C ent ral \Not es\A t os\Recov ery _scenari os. doc
39
Recovery Scenarios Reorg activity for TG121 database Script for Instance information
40 41
42
43
44
45
46 47
DBA health check script Get DDL for tablespaces and objects
select a.file#, b.file_name, a.singleblkrds, a.singleblkrdtim, a.singleblkrdtim/a.singleblkrds average_wait from v$filestat a, dba_data_files b where a.file# = b.file_id and a.singleblkrds > 0 order by average_wait
exec statspack.snap(7); in 9i @?/rdbms/admin/spreport.sql in 10g- @?/rdbms/admin/awrrpt.sql or @?/rdbms/admin/addmrpt.sql SELECT * FROM (select username,opname,sid,serial#,context,sofar,totalwork ,round(sofar/totalwork*100,2) "% Complete" from v$session_longops) WHERE "% Complete" != 100;
To check the status: select OWNER,TRIGGER_NAME, STATUS from dba_triggers where TRIGGER_NAME like '%DDL%'; Script to change: alter trigger owner.trigger_name enable or disable;
C :\D ocum ent \ C ent ral \Not es\A t os\Recov ery _scenari os. doc
C :\D ocum ent \ C ent ral \Not es\A t os\Recov ery _scenari os. doc
tti "Space Usage for Database in Meg" SELECT Total.name "Tablespace Name", nvl(Free_space, 0) Free_space, nvl(total_space-Free_space, 0) Used_space, total_space FROM (select tablespace_name, sum(bytes/1024/1024) Free_Space from sys.dba_free_space group by tablespace_name ) Free, (select b.name, sum(bytes/1024/1024) TOTAL_SPACE TTI "Allocated, Used & Free space within datafiles" COLUMN free_space_mb format 999999.90 COLUMN allocated_mb format 999999.90 COLUMN used_mb format 999999.90 SELECT SUBSTR (df.NAME, 1, 40) file_name, df.bytes / 1024 / 1024 allocated_mb, ((df.bytes / 1024 / 1024) - NVL (SUM (dfs.bytes) / 1024 / 1024, 0)) used_mb, NVL (SUM (dfs.bytes) / 1024 / 1024, 0) free_space_mb TTI "Tablespace Fragmentation Details" SELECT dfsc.tablespace_name tablespace_name, DECODE ( dfsc.percent_extents_coalesced, 100, (DECODE ( GREATEST ((SELECT COUNT (1) FROM dba_free_space dfs WHERE dfs.tablespace_name = dfsc.tablespace_name), 1), 1, 'No Frag', 'Bubble Frag' ) ), 'Possible Honey Comb Frag' ) fragmentation_status FROM dba_free_space_coalesced dfsc ORDER BY dfsc.tablespace_name; TTI off
select 'Index '||i.index_name||' not analyzed but table '|| i.table_name||' is.' from user_tables t, user_indexes i where t.table_name = i.table_name and t.num_rows is not null and i.distinct_keys is null /