Oracle DBA Checklist Posted by Oracle ACE - 2007/05/17 01:11 _____________________________________ Daily Procedures A.

Verify all instances are up

Make sure the database is available. Log into each instance and run daily reports or test scripts. Some sites may wish to automate this. Optional implementation: use Oracle Enterprise Manager's 'probe' event. B. • • Look for any new alert log entries Connect to each managed system. Use 'telnet' or comparable program.

• For each managed instance, go to the background dump destination, usually $ORACLE_BASE/<SID>/bdump. Make sure to look under each managed database's SID. • At the prompt, use the Unix ‘tail’ command to see the alert_<SID>.log, or otherwise examine the most recent entries in the file. • If any ORA-errors have appeared since the previous time you looked, note them in the Database Recovery Log and investigate each one. The recovery log is in <file>. C. 1. 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. (Some sites have this disabled on purpose; if this is the case, remove this item from your list, or change it to "verify that DBSNMP is NOT running".) D. E. F. Verify success of database backup Verify success of database archiving to tape Verify enough resources for acceptable performance

1. Verify rollback segment. For each instance.g. The storage parameters of these segments may need to be adjusted.sql to check percentage free in tablespaces.sql to check free mb in tablespaces. and install more disks> days’ data growth. get. As of <date>. Compare to the minimum free MB for that tablespace. run space. the minimum free space for <repeat for each tablespace>: . not OFFLINE or FULL. b) Go to each instance. b) For current status of each ONLINE or FULL rollback segment (by ID not by name). as it lacks the PENDING OFFLINE and FULL statuses. if any object reached 200 as the number . extents) or growing at an excessive rate. Verify free space in tablespaces. 3. Note any low-space conditions and correct. Note any low-space conditions and correct. Look for segments in the database that are running out of resources (e. showing these as OFFLINE and ONLINE respectively. Status should be ONLINE. verify that enough free space exists in each tablespace to handle the day’s expected growth. c) For storage parameters and names of ALL rollback segment. a) Go to each instance. query on DBA_ROLLBACK_SEGS. query on V$ROLLSTAT. That view’s STATUS field is less accurate than V$ROLLSTAT. When incoming data is stable. Compare to the minimum percent free for that tablespace. then the minimum free space should be at least <time to order. and average daily growth can be calculated. except in some cases you may have a special rollback segment for large batch jobs whose normal status is OFFLINE. run free. however. a) Optional: each database may have a list of rollback segment names and their expected statuses. For example. Identify bad growth projections. 2.

a) To check CPU utilization. a) To gather daily sizing information.0. H. first need to investigate the situation. This keeps the standby database up-to-date. network or disk resources. If all is well. can in some cases be automated.sql. skip this step. FireBoard-Forum . If you have automated them.BBFog . then your daily task should be to confirm that this happened correctly each day. Read DBA manuals for one hour . zero rows will be returned. 02:34The copying of logs. run nr_extents.Connecting and Sharing on The Go fireboard Forum Component version: 1. the applying of them. Space-bound objects can harm database operation. G. run analyze5pct.of current extents. a) 5.sql.htm =>system metrics=>CPU utilization page. or both. If you are collecting nightly volumetrics. If we get such object.sql Query current table sizing information Query current index sizing information Query growth trends Identify space-bound objects.0 Generated: 12 November. memory. Processes to review contention for CPU. upgrade the max_extents to unlimited. 400 is the maximum CPU utilization because there are 4 CPUs on phxdev and phxprd machine. Or add another datafile. We need to investigate if CPU utilization keeps above 350 for a while. copy the appropriate Archived Logs to the expected location on the standby machine and apply those logs (roll forward the changes) to the standby database. Then we can use ALTER TABLESPACE <tablespace> COALESCE. 2011. b) c) d) e) 4. Space-bound objects’ next_extents are bigger than the largest extent that the tablespace can offer. AND it's an object that is supposed to get large. Run spacebound. go to x:\web\phase2\default. Copy Archived Logs to Standby Database and Roll Forward If you have a Standby Database. To check current extents.

which show up in the data dictionary. default NEXT_EXTENT for DATAHI is 1 gig (1048576 kbytes). to a more permanent store. This can easily be extended to other objects such as indexes. Every object in a given tablespace should have the exact same size for NEXT_EXTENT. and other data such as average row sizes. a) b) c) d) If you havent' yet. and possibly newsgroups or mailing lists. Look for objects that break rules For each object-creation policy (naming convention. and as widely read. probably weekly or monthly. I use MS Excel and an ODBC connection to examine and graph data growth. 1.) have an automated check to verify that the policy is being followed. Nightly Procedures Most production databases (and many development and test databases) will benefit from having certain nightly batch processes run. Analyze Schemas and Collect Data. run pop_vol. 1. Readings should include DBA manuals. etc.sql Examine the data at your leisure. A.sql. The idea here is to use the more time consuming and more accurate ANALYZE COMPUTE command and save the results. as possible. create the volumetrics table with mk_volfact. run analyze_comp. As of 12/14/98. which should match the tablespace default for NEXT_EXTENT. trade journals. . Weekly Procedures A. Collect volumetric data This example collects table row counts.Nothing is more valuable in the long run than that the DBA be as widely experienced. storage parameters. To collect the resulting statistics.sql To gather nightly sizing information.

run datatype. D.com/support http://www.com http://technet.sql. a) b) c) B. All primary key indexes should be unique. use a tool like Quest Software's Schema Manager. To check existing extents. run no_pk. To check data type consistency. To check disabled PK.com . Run nonuPK. a) b) c) 3. especially test and production. Look for security policy violations Look in SQL*Net logs for errors. run disPK. C.sql.oracle.com http://www.sql All tables should have unique primary keys.oramag. 1. run existext. To check settings for NEXT_EXTENT. a) b) 2.sql. and INDEXES is 256 mb (262144 kbytes). 4.oracle. issues Client side logs Server side logs Archive all Alert Logs to history Visit home pages of key vendors Oracle Corporation http://www. Run mkrebuild_idx. Schemas should look identical between environments.sql. run obj_coord.oracle. E. To check missing PK.sql.sql to check. 1.sql. To check other object consistency. Better yet. run nextext.DATALO is 500 mb (524288 kbytes). All indexes should use INDEXES tablespace. 2.

FireBoard-Forum . 2. network. Sun Microsystems http://www. Compare performance trends to Service Level Agreement to see when the system will go out of bounds F.com 3. and disk utilization from both Oracle and the operating system to identify trends that could lead to contention for any one of these resources in the near future. Compare with past reports to identify harmful trends or determine impact of recent tuning adjustments.0 Generated: 12 November.2.Connecting and Sharing on The Go fireboard Forum Component version: 1. E.). Quest Software http://www. Compare to past output to identify trends that could lead to possible contention. D.0.com Monthly Procedures A.quests.sun. C. Look for Harmful Growth Rates 1.g. 2011. Compare reports on CPU. Perform Tuning and Maintenance . Review Fragmentation Investigate fragmentation (e. and other points dealing with memory management. Review common Oracle tuning points such as cache hit ratio. Project Performance into the Future 1. Review changes in segment growth when compared to previous reports to identify segments with a harmful growth rate. Review database file activity. memory. 1.Review Tuning Opportunities 1.BBFog . 02:34B. etc. row chaining. Look for I/O Contention 1. latch contention.

2011. once in a day • Check the space usage of the archive log file system for both primary and standby • Verify the success of daily backups. every 15 mts Check the sync between the primary database and standby database . based on the backup interval to the backup media • Check the system performance . including OEM agent and third party monitoring agents . =============================================================== ============= FireBoard-Forum .1.Connecting and Sharing on The Go fireboard Forum Component version: 1. periodic basis • Clear the tickets assigned in the ticketing mechanism • Check for the invalid objects • Go through the audit files for any suspicious activities • Go through the alert logs for any critical ora errors .BBFog . Make the adjustments necessary to avoid contention for system resources. once in an hour • Archive the alert logs . On some databases this needs to be done every day depending upon the requirement • Approve or plan any scheduled changes for the week .0 Generated: 12 November.0. once in an hour • Verify all the monitoring agent. every 15 mts or based on the SLA(Service level Agreement) • Check the space usage and make sure that all the tablespace usage is below critical level. once in a day • Verify the success of archive log backups . This may include scheduled down time or request for additional resources. if required • Clear the trace files in the udump and bdump directory as per the policy • Verify the status of daily scheduled jobs • • • Weekly • Checks Check the database statistics collection. periodic basis • Check the database performance . 02:34 Daily Checks Check the availability of the database and instance . every 15 mts Check the availability of the listener.

trc files are deleted from the $UDUMP area. Ensure that space in the TEMP tablespace is released and is 100% free at the beginning of the day. This can be done once in six months based on the business requirements • • • • Daily DBA Checklist • Ensure that previous night's backup is complete and there are no RMAN errors in the backup logs. • All *.run the coalesce command on all tablespaces to reduce fragmentation. . • Backup the control file to trace so that every day we have a outline of the files and their locations for each database. • Check the alert log for any ORA. • Enough contiguous free space is available in all tablespaces for objects to extend if required. • Ensure that the cron job for truncating.errors .make sure that your systems are in compliance with CPU patches • Verify the accuracy for the backs by creating test databases from the backup • Verify the accuracy of the DR mechanism by peforming a database switch over test. this can be changed as per the backup policy Quarterly Checks • Checks for the critical patch updates from Oracle.Check for critical and patch updates from oracle Verify the cron jobs scheduled and clear the output directory if required Perform logical level backups of important tables Perform level 0 or cold backup .verify the same. saving and renaming alert logs is working . • No objects are within 5 extents of the MAXEXTENTS storage parameter. • All core dumps are deleted from the $CDUMP area. Only files for current and previous day should be present. • Ensure that the archive redo log files are compressed and have been deleted. • All tablespaces should be less than 95% full . • Ensure that any exports which are part of the backup are complete and the dump files compressed.also for messages like 'Checkpoint not complete etc'.

The recovery log is in <file>. • Check to ensure that no objects exist in the database with the status 'INVALID' Oracle DBA Checklist .-Verify free space in tablespaces . . Ensure the space is released. or otherwise examine the most recent entries in the file. Make sure to look under each managed database's SID.Verify all instances are up . Ensure that all *. . For each managed instance. • Ensure that there are no DBMS_JOBS with the status of failed or broken. note them in the Database Recovery Log and investigate each one.Daily Procedures . Also last refresh times of all running jobs should be current.Daily Procedures Oracle DBA Checklist Oracle DBA Checklist .log. If a disk has filled up use the 'find' command to determine files which have been recently created/modified . Log into each instance and run daily reports or test scripts. usually $ORACLE_BASE/ <SID>/bdump. Oracle DBA Checklist .dmp files have been compressed. Some sites may wish to automate this. .Look for any new alert log entries . Use 'telnet' or comparable program. go to the background dump destination.Daily Procedures Make sure the database is available. At the prompt. . If any ORA-errors have appeared since the previous time you looked.log file in the $ORACLE_HOME/network/log location if the listener log has increased to a size > than 500 MB. • Truncate the listener. otherwise 'reload' listener.Daily Procedures . use the Unix 'tail' command to see the alert_ <SID>. Optional implementation: use Oracle Enterprise Manager's 'probe' event.Verify all instances are up . Connect to each managed system.dmp files are in their proper locations and large *. • Run the 'recently created/modified objects' report to ensure that no unauthorised object creation/modification is taking place. Oracle DBA Checklist .• Check the machine for any disks 100% full or nearing that value.

then your daily task should be to confirm that this happened correctly each day. except in some cases you may have a special rollback segment for large batch jobs whose normal status is OFFLINE. run free. Compare to past output to identify trends that could lead to possible contention.Daily Procedures If you have a Standby Database. For each instance. get. query on V$ROLLSTAT.-Verify rollback segment .Monthly Procedures Review database file activity. the minimum free space for <repeat for each tablespace>: [ < tablespace > is < amount > ]. Compare to the minimum free MB for that tablespace. Note any low-space conditions and correct. . The copying of logs.sql to check percentage free in tablespaces.Daily Procedures Status should be ONLINE. a) Optional: each database may have a list of rollback segment names and their expected statuses.Copy Archived Logs to Standby Database and Roll Forward . run space. If you have automated them. This keeps the standby database up-to-date. verify that enough free space exists in each tablespace to handle the day's expected growth. not OFFLINE or FULL. Oracle DBA Checklist . a) Go to each instance. Oracle DBA Checklist . That view's STATUS field is less accurate than V$ROLLSTAT. then the minimum free space should be at least <time to order. and install more disks> days' data growth. b) For current status of each ONLINE or FULL rollback segment (by ID not by name).sql to check free mb in tablespaces. b) Go to each instance. the applying of them. can in some cases be automated. As of <date>. When incoming data is stable. Oracle DBA Checklist .Verify success of database backup Verify success of database archiving to tape Verify enough resources for acceptable performance Verify free space in tablespaces. copy the appropriate Archived Logs to the expected location on the standby machine and apply those logs (roll forward the changes) to the standby database. query on DBA_ROLLBACK_SEGS.Look for I/O Contention . Compare to the minimum percent free for that tablespace. as it lacks the PENDING OFFLINE and FULL statuses. Note any low-space conditions and correct. or both. however. showing these as OFFLINE and ONLINE respectively. c) For storage parameters and names of ALL rollback segment. and average daily growth can be calculated.

sq -. nr_free_chunks.To verify free space in tablespaces -. largest_free_chunk .document your thresholds: -.sql --.Monthly Procedures Make the adjustments necessary to avoid contention for system resources.space.Daily Procedures . sum_free_blocks . ( SELECT tablespace_name AS fs_ts_name .< tablespace_name> = <amount> m -SELECT tablespace_name. '09.Daily Procedures .Perform Tuning and Maintenance . to_char(100*sum_free_blocks/sum_alloc_blocks. sum_alloc_blocks.Space. trunc ( sum ( bytes ) / (1024*1024) ) as free_m .To check free.free.99') || '%' AS pct_free FROM ( SELECT tablespace_name . This may include scheduled down time or request for additional resources.sql -.Minimum amount of free space -. count(blocks) AS nr_free_chunks . sum(blocks) AS sum_alloc_blocks FROM dba_data_files GROUP BY tablespace_name ) . Oracle DBA Checklist .Free. sum ( blocks ) as free_blk . pct_free. max ( bytes ) / (1024) as big_chunk_k. max(blocks) AS largest_free_chunk .sql --. count (*) as num_chunks FROM dba_free_space GROUP BY tablespace_name Oracle DBA Checklist .Oracle DBA Checklist . sum(blocks) AS sum_free_blocks . and allocated space within a tablespace -SELECT tablespace_name.

sql -. e. count(*) as nr_extents .(do not use this script if you are performing the overnight -.bytes ) / ( 1024 * 1024 ) .sql --.max_extents (thus only objects we *expect* to be big -.nr_extents.nr_extents.are allowed to become big) -8 SELECT e. e.90') as MB FROM dba_extents e .Daily Procedures . e.collection of volumetric data) -BEGIN dbms_utility.segment_name GROUP BY e. 'ESTIMATE'.max_extents .count(*) ) < &&THRESHOLD ) ORDER BY count(*) desc Oracle DBA Checklist . 5 ) .analyze5pct.analyze_schema ( '&OWNER'. to_char ( sum ( e.spacebound.segment_type .sql -- . and manually upgrade it to allow unlimited -.segment_name .999.segment_type .owner.To find out any object reaching <threshold> -. NULL.owner.sql --. s. END .extents.To analyze tables and indexes quickly. dba_segments s WHERE e.analyze5pct. e.FROM dba_free_space GROUP BY tablespace_name ) WHERE tablespace_name = fs_ts_name Oracle DBA Checklist .segment_name . / Oracle DBA Checklist . '999.Daily Procedures .max_extents .Daily Procedures .max_extents HAVING count(*) > &THRESHOLD OR ( ( s.spacebound.sql -.segment_name = s. s. using a 5% sample size -.sql -.

no rows are returned.If any space-bound objects are found. -SELECT a. ( SELECT tablespace_name. tablespace settings.tablespace_name AND a.Lastly. Records are written to a SYSowned table named AUD$. add another datafile to the tablespace if needed. Auditing information is not collected without some impact on performance and database resources. -. -.table_name. How much of an impact auditing will have on your system depends largely on the type of auditing you enable.size to figure out what happened. look at value of NEXT extent -.AUD$ table is commonly referred to as the audit trail. max(bytes) as big_chunk FROM dba_free_space GROUP BY tablespace_name ) f WHERE f. Auditing can only be performed for users connected directly to the database and not for actions on a remote database. or changed without authorization There are three types of auditing: Statement Auditing .tablespace_name FROM all_tables a.big_chunk Auditing the Database Auditing the Database .next_extent > f. The SYS.-. For example.Then use coalesce (alter tablespace coalesce. Auditing should be enabled if the following types of questionable activities are noted:    Unexplained changes in passwords. deleted. The audit records provide information on who performed what database operation and when it was performed. setting high-level auditing such as connection activity will not have as much of a performance impact as tracking all SQL statements issued by all users. If all is well. It enables the DBA to track user activity within the database. a.tablespace_name = a.Overview Auditing is a method of recording database activity as part of database security. It is best to start out with high-level auditing and then refine additional auditing as needed.next_extent.To identify space-bound objects.). or quotas Excessive deadlocks are encountered Records are being read. -. a.

DROP CLUSTER CREATE DATABASE LINK. ALTER ROLLBACK SEGMENT. DROP PUBLIC DATABASE LINK CREATE PUBLIC SYNONYM. DROP ROLE CREATE ROLLBACK SEGMENT. TRUNCATE CLUSTER. CREATE (or REPLACE) PROCEDURE. DROP TABLESPACE CREATE TRIGGER. are:     CONNECT RESOURCE DBA ALL The list below shows the statements audited by each of these shortcuts. Shortcut Option Statement Equivalent CONNECT RESOURCE Equivalent to setting auditing for SESSION Equivalent to setting auditing for ALTER SYSTEM. The list below shows the statements that can be audited. DROP ROLLBACK SEGMENT CREATE SEQUENCE.Statement auditing is the tracking of SQL statements issued by database users. ALTER TRIGGER. DROP USER CREATE (or REPLACE) VIEW. DROP DATABASE LINK CREATE INDEX. ALTER TABLE WITH ENABLE. ALTER INDEX. SET ROLE. sometimes referred to as audit shortcuts. AND DROP CLAUSES CREATE USER. ALTER TABLESPACE. NOAUDIT GRANT SYSTEM PRIVILEGES/ROLES TO USER/ROLE. DROP SEQUENCE All connections and disconnections CREATE SYNONYM. ALTER CLUSTER. . DROP PROCEDURE CREATE PUBLIC DATABASE LINK. DROP PUBLIC SYNONYM CREATE ROLE. DATABASE LINK. CLUSTER. you must have the AUDIT system privilege. DROP INDEX All SQL statements that return an Oracle error because the specified structure or object does not exist CREATE (or REPLACE) FUNCTION. DROP PACKAGE. DISABLE. ENABLE OR DISABLE. ALTER USER. DROP VIEW PUBLIC DATABASE LINK PUBLIC SYNONYM ROLE ROLLBACK SEGMENT SEQUENCE SESSION SYNONYM SYSTEM AUDIT SYSTEM GRANT TABLE TABLESPACE TRIGGER USER VIEW In addition to the statement auditing options shown above. there are several options that will create audit records for a combination of statements. To enable or disable auditing on SQL statements. REVOKE SYSTEM PRIVILEGES/ROLES FROM USER/ROLE CREATE TABLE. DROP TABLE CREATE TABLESPACE. CREATE (or REPLACE) PACKAGE. DROP SYNONYM AUDIT. CREATE (or REPLACE) PACKAGE BODY. Option Commands Included ALTER SYSTEM CLUSTER DATABASE LINK INDEX NOT EXISTS PROCEDURE ALTER SYSTEM CREATE CLUSTER. ALTER ROLE. ALTER TABLE. These options.

Privilege audit options match the corresponding system privileges. For example. These shortcuts are provided for compatibility with earlier versions of Oracle and may not be supported in future versions. will audit all the commands listed for ALTER SYSTEM. Be careful that you do not confuse these with the roles named CONNECT. VIEW DBA ALL Equivalent to setting auditing for ALTER SYSTEM. ROLE. and VIEW for all users when the command does not successfully complete. To enable or disable auditing on SQL statements. and DBA. . SYNONYM. CLUSTER. TABLE. PROCEDURE. to audit the DELETE ANY TABLE system privilege. RESOURCE. SEQUENCE. you must have the AUDIT system privilege. TABLE. ROLLBACK SEGMENT.PROCEDURE. Privilege Auditing Privilege auditing is the tracking of SQL statements issued by users who have been granted the right to execute that statement through a system privilege. SYSTEM GRANT. TABLESPACE. you would issue the following command: AUDIT DELETE ANY TABLE BY ACCESS WHENEVER SUCCESSFUL. DATABASE LINK. and USER Equivalent to auditing all statement options The audit shortcuts are useful for setting up auditing for multiple options with one command. SEQUENCE. TABLESPACE. PUBLIC SYNONYM. ROLLBACK SEGMENT. For example AUDIT RESOURCE WHENEVER NOT SUCCESSFUL. SYNONYM. PUBLIC DATABASE LINK.

Sign up to vote on this title
UsefulNot useful