Académique Documents
Professionnel Documents
Culture Documents
Quarterly Checklist
In response of some fresher DBA I am giving quick checklist for a production
DBA. Here I am including reference of some of the script which I already
posted as you know each DBA have its own scripts depending on database
environment too. Please have a look on into daily, weekly and quarterly
checklist.
Daily Checks:
1-Verify all database, instances, Listener are up, every 30 Min.
2-Verify the status of daily scheduled jobs/daily backups in the morning very
first hour.
3-Verify the success of archive log backups, based on the backup interval.
4-Check the space usage of the archive log file system for both primary and
standby DB.
5-Check the space usage and verify all the tablespace usage is below critical
level once in a day.
6-Verify Rollback segments.
6-Check the database performance, periodic basis usually in the morning
very first hour after the night shift schedule backup has been completed.
7-Check the sync between the primary database and standby database,
every 20 min.
8-Make a habit to check out the new alert.log entry hourly specially if getting
any error.
7-Check the system performance, periodic basis.
8-Check for the invalid objects
9-Check out the audit files for any suspicious activities.
10-Identify bad growth projections.
11-Clear the trace files in the udump and bdump directory as per the policy.
12-Verify all the monitoring agent, including OEM agent and third party
monitoring agents.
Weekly Checks:
Perform level 0 or cold backup as per the backup policy. Note the backup
policy can be changed as per the requirement. Dont forget to check out the
space on disk or tape before performing level 0 or cold backup.
Perform Export backups of important tables.
Check the database statistics collection. On some databases this needs to be
done every day depending upon the requirement.
Approve or plan any scheduled changes for the week.
Verify the schedule jobs and clear the output directory. You can also automate
it.
Look for the object that break rule.
Look for security policy violation.
Archive the alert logs (if possible) to reference the similar kind of error in
future.
Visit the home page of key vendors.
-----------------------------------------------------------------------------------------------------------------------------------------------------Below is the brief description about some of the important concept including
important SQL scripts. You can find more scripts on my different post by using
blog search option.
Verify all instances are up:
Make sure the database is available. Log into each instance and run daily
reports or test scripts. You can also automate this procedure but it is better
do it manually. Optional implementation: use Oracle Enterprise Manager's
'probe' event.
Verify DBSNMP is running:
Log on to each managed machine to check for the 'dbsnmp' process. For
Unix: at the command line, type ps ef | grep dbsnmp. There should be two
dbsnmp processes running. If not, restart DBSNMP.
Verify success of Daily Scheduled Job:
Each morning one of your prime tasks is to check backup log, backup drive
where your actual backup is stored to verify the night backup.
Verify success of database archiving to tape or disk:
In the next subsequent work check the location where daily archiving stored.
Verify the archive backup on disk or tape.
Verify enough resources for acceptable performance:
For each instance, verify that enough free space exists in each tablespace to
handle the days expected growth. As of <date>, the minimum free space for
<repeat for each tablespace>: [ < tablespace > is < amount > ]. When
incoming data is stable, and average daily growth can be calculated, then the
minimum free space should be at least <time to order, get, and install more
disks> days data growth. Go to each instance, run query to check free mb in
tablespaces/datafiles. Compare to the minimum free MB for that tablespace.
Note any low-space conditions and correct it.
Verify rollback segment:
Status should be ONLINE, not OFFLINE or FULL, except in some cases you
may have a special rollback segment for large batch jobs whose normal
status is OFFLINE. Optional: each database may have a list of rollback
segment names and their expected statuses.For current status of each
Useful Scripts:
-------------------------------------------------------------------------------------------Script: To check free, pct_free, and allocated space within a
tablespace
SELECT tablespace_name, largest_free_chunk, nr_free_chunks,
sum_alloc_blocks, sum_free_blocks
, to_char(100*sum_free_blocks/sum_alloc_blocks, '09.99') || '%' AS pct_free
FROM ( SELECT tablespace_name, sum(blocks) AS sum_alloc_blocks
FROM dba_data_files
GROUP BY tablespace_name),
( SELECT tablespace_name AS fs_ts_name, max(blocks) AS
largest_free_chunk
, count(blocks) AS nr_free_chunks, sum(blocks) AS sum_free_blocks
FROM dba_free_space
GROUP BY tablespace_name )
WHERE tablespace_name = fs_ts_name;
Script: To analyze tables and indexes
BEGIN
dbms_utility.analyze_schema ( '&OWNER', 'ESTIMATE', NULL, 5 ) ;
END ;
Script: To find out any object reaching <threshold>
SELECT e.owner, e.segment_type , e.segment_name , count(*) as nr_extents ,
s.max_extents
, to_char ( sum ( e.bytes ) / ( 1024 * 1024 ) , '999,999.90') as MB
FROM dba_extents e , dba_segments s
WHERE e.segment_name = s.segment_name
GROUP BY e.owner, e.segment_type , e.segment_name , s.max_extents
HAVING count(*) > &THRESHOLD
OR ( ( s.max_extents - count(*) ) < &&THRESHOLD )
ORDER BY count(*) desc;
The above query will find out any object reaching <threshold> level extents,
and then you have to manually upgrade it to allow unlimited max_extents
(thus only objects we expect to be big are allowed to become big.
Script: To identify space-bound objects. If all is well, no rows are
returned.
SELECT a.table_name, a.next_extent, a.tablespace_name
FROM all_tables a,( SELECT tablespace_name, max(bytes) as big_chunk
FROM dba_free_space
GROUP BY tablespace_name ) f
WHERE f.tablespace_name = a.tablespace_name AND a.next_extent >
f.big_chunk;
Run the above query to find the space bound object . If all is well no rows are
returned if found something then look at the value of next extent. Check to
find out what happened then use coalesce (alter tablespace <foo>
coalesce;). and finally, add another datafile to the tablespace if needed.
Script: To find tables that don't match the tablespace default for
NEXT extent.
SELECT segment_name, segment_type, ds.next_extent as Actual_Next
, dt.tablespace_name, dt.next_extent as Default_Next
FROM dba_tablespaces dt, dba_segments ds
WHERE dt.tablespace_name = ds.tablespace_name
AND dt.next_extent !=ds.next_extent AND ds.owner = UPPER ( '&OWNER' )
ORDER BY tablespace_name, segment_type, segment_name;
Script: To check existing extents
SELECT segment_name, segment_type, count(*) as nr_exts
, sum ( DECODE ( dx.bytes,dt.next_extent,0,1) ) as nr_illsized_exts
, dt.tablespace_name, dt.next_extent as dflt_ext_size
FROM dba_tablespaces dt, dba_extents dx
WHERE dt.tablespace_name = dx.tablespace_name
AND dx.owner = '&OWNER'
GROUP BY segment_name, segment_type, dt.tablespace_name,
dt.next_extent;
The above query will find how many of each object's extents differ in size
from the tablespace's default size. If it shows a lot of different sized extents,
your free space is likely to become fragmented. If so, need to reorganize this
tablespace.
Script: To find tables without PK constraint
SELECT table_name FROM all_tables
WHERE owner = '&OWNER'
MINUS
For more about script and Daily DBA Task or Monitoring use the search
concept to check my other post. Follow the below link for important
Monitoring Script: http://shahiddba.blogspot.com/2012/04/oracle-dba-dailychecklist.html