Friday, August 20, 2010

Restarting Oracle Data Guard - Data Guard

Hello,


This post explains how to restart Oracle Data Guard

Restarting Data Guard

Pausing Data Guard
On standby database (BBMLDR)
[/opt/oracle/app/oracle]> sqlplus /nolog
SQL*Plus: Release 10.2.0.3.0 - Production on Fri Aug 20 10:26:10 2010
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
SQL > Conn sys/as sysdba
Password -******
Connected
SQL> ALTER DATABASE RECOVER STANDBY DATABASE CANCEL;

Restarting
On standby database (BBMLDR)
sqlplus /as sysdba
SQL> startup nomount; (if database server has been shutdown)
SQL> alter database mount standby database; (if the database server has been shutdown)
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
or
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;
On Primary database (BBMLPROD)
sqlplus /as sysdba
SQL> Alter system switch logfile;
SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;
(above statement archive the current log file and send previous archive log to BBMLDR)
(verify within the alert log of the primary database : vi $HOME/admin/BBMLPROD/bdump/ALert8.log
e.g. ARC1: Standby redo logfile selected for thread 3 sequence 1487 for destination LOG_ARCHIVE_DEST_2
verify on standby database:
select sequence#, name, first_time, next_time , completion_time applied from v$ARCHIVED_LOG order by first_time;
Check the last set of rows to verify that the first_time, next_time and completion_time columns are at least showing current date. Also, the applied column has YES through the data set except on the last few rows because the log hasn't been applied to the database.


Regards,
Sowmya (OSR)

Thursday, August 19, 2010

How to Open Standby Database when Primary is Lost- Oracle Data Guard

Hello,

Here are the following steps to activate the standby and open the standby.

Follow these steps to open the standby database
1. Startup Mount
2. Check status
3. Recover if you have logs to apply
4. Finish the Recovery Process
5. Activate the Standby Database
6. Check the new status
7. Open the Database

1. Startup Mount
[/opt/oracle/app/oracle/product/10.2.0/Db_1]> sqlplus /nolog
SQL*Plus: Release 10.2.0.3.0 - Production on Wed Aug 18 10:34:16 2010
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
SQL> conn sys/as sysdba
Enter password:
Connected.
SQL> Startup Mount

2. Check Status
SQL>SQL> select NAME ,LOG_MODE , OPEN_MODE, PROTECTION_MODE , DATABASE_ROLE ,ACTIVATION# from v$database;
NAME LOG_MODE OPEN_MODE PROTECTION_MODE DATABASE_ROLE
--------- ------------ ---------- -------------------- ----------------
ACTIVATION#
-----------
BBMLPROD ARCHIVELOG MOUNTED MAXIMUM PERFORMANCE PHYSICAL STANDBY
3731587029

3. Recover if you have logs to apply
In this example we consider that primary is lost and we don’t have more archived logs to be applied.
SQL> Recover Standby Database;

4. Finish the Recovery Process
SQL> Alter database recover managed standby database finish;
Database altered

5. Activate the Standby Database
SQL> Alter Database Activate physical standby database;
Database altered

6. Check the new status
SQL> select NAME , OPEN_MODE, PROTECTION_MODE , DATABASE_ROLE ,
from v$database;
NAME OPEN_MODE PROTECTION_MODE DATABASE_ROLE
--------- ------------ ---------- -------------------- ----------------
BBMLPROD MOUNTED MAXIMUM PERFORMANCE PRIMARY

7. Open Database
SQL> Alter database open;
Database altered
SQL> select NAME , OPEN_MODE, PROTECTION_MODE , DATABASE_ROLE ,
from v$database;
NAME OPEN_MODE PROTECTION_MODE DATABASE_ROLE
--------- ------------ ---------- -------------------- ----------------
BBMLPROD READ WRITE MAXIMUM PERFORMANCE PRIMARY


Regards,
Sowmya (OSR)

Thursday, August 12, 2010

Oracle DBA Check List

Hello,
Here i am going to explain you daily, weekly, monthly responsibilities of Oracle DBA

Oracle DBA Checklist


Daily Procedures
1. Verify all instances are up and running: Run daily reports via Enterprise manager Probe event or through Oracle Grid
2. Look for any new alert log entries: Check for any ORA –errors in you alert log $ORACLE_HOME/admin/bdump/alert_ORACLE_SID.log
3. Verify success of database backup
4. Verify success of database archiving to tape
5. Verify DBSNMP is running
6. Verify free space in tablespaces
7. Verify rollback segment
8. Identify bad growth projection
9. Verify whether archivelogs are backed up successfully to your tapes
10. Verify rollback segment
11. Identify space bound objects
12. Process to review contention for CPU, memory, netowrk or disk resources
13. Copy Archived logs to standby Database and Roll Forward
14. Read DBA manuals, forums, journal and so on.
15. Analyze tables and indexes if needed

Nightly Procedures
1. Collect volumetric data : mk_Volfact.sql, analyze_comp.sql, pop_vol.sql

Weekly Procedures
1. Look for objects that break rules
a. Check for Next_Extents ,
b. Check Existing Extents
c. Check missing PK
d. Check whether all indexes are using INDEXES tablespace
e. Check the consistency of the schema objects between production and test environment
2. Look for security Policy Violations
3. Look for SQL * Net logs for errors, issues
a. Check Client side logs
b. Check server side logs
4. Archvie all alert logs to history
5. Attend Weekly Meetings (Project status , discussions on issues and so on)

Monthly Procedures
1. Look for harmful growth rates
2. Review tuning opppurtunities : Cache hit ration, latch contention etc
3. Look for I/O Contention
4. Review fragmentation : row chaining etc
5. Project Performance into the future
6. Perform tuning and maintenance
7. Provide monthly reports (this depends on company to company)
8. Attend Monthly meetings

Quartely Procedures
1. Provide Quartely Audit Reports if needed (This depends on company to company)
This is checking of all users, roles, privileges and so on

Regards,
Sowmya (OSR)

Wednesday, August 11, 2010

Oracle Grid - Creating Notification Rules (2)

Hello,

In this post i am going to specify some more Notification rules

6. Setting up notification rule for Monitoring Cluster_Database_Critical
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create like ->Provide Name: MONITOR_Cluster_Database_Critical, enter Description, make the rule as public, target type –cluster and select apply rule to all agent targets
Select Availability Tab-> select Agent Unreachable and Agent Unreachable
Click on Metrics Tab and select the following metrics (select the necessary metrics which are needed and I have mentioned few of them)
a. Blocking Session Count
b. Broken Job Count
c. Failed Job Count
d. Failed Login Count
e. Segment Approaching Maximum Extents Count
f. Segment Not Able to Extend Count
Select Severity as Critical
Click ok and finish

7. Setting up notification rule for Monitoring Cluster_Database_Warning
Login into Oracle Grid using Dbwatch
Click on preferences ->Rules
Click on Create like ->Provide Name: MONITOR_Cluster_Database_Warning, enter Description, make the rule as public, target type –cluster and select apply rule to all agent targets
Select Availability Tab-> select Agent Unreachable and Agent Unreachable
Click on Metrics Tab and select the following metrics (select the necessary metrics)
a. Blocking Session Count
b. Broken Job Count
c. Failed Job Count
d. Failed Login Count
e. Segment Approaching Maximum Extents Count
f. Segment Not Able to Extend Count
Select Severity as Warning
Click ok and finish

8. Setting up notification rule for Monitoring Database_Instance_Critical
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create like ->Provide Name: MONITOR_Database_Instance_Critical, enter Description, make the rule as public, target type –Database Instance and select apply rule to all agent targets
Select Availability Tab-> select Agent Unreachable and Agent Unreachable
Click on Metrics Tab and select the following metrics (select the metrics which are needed below are few metrics)
a. Archive Area Used (%)
b. Archiver Hung alert Log Error
c. Archiver Hung Alert Log Error Status
d. Blocking Session Count
e. Broken Job Count
f. Data Block Corruption Alert Log Error
g. Failed Job Count
h. Generic Alert Log Error
i. Process Limit Usage (%)
j. Segment Approaching Maximum Extents Count
Select Severity as Critical
Click ok and finish

9. Setting up notification rule for Monitoring Database_Instance_Warning
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create like -> Provide Name: MONITOR_Database_Instance_Warning, enter Description, make the rule as public, target type –Database Instance and select apply rule to all agent targets
Select Availability Tab-> select Agent Unreachable and Agent Unreachable
Click on Metrics Tab and select the following metrics (select the metrics which are needed, below are the few metrics)
a. Archive Area Used (%)
b. Archiver Hung alert Log Error
c. Archiver Hung Alert Log Error Status
d. Blocking Session Count
e. Broken Job Count
f. Data Block Corruption Alert Log Error
g. Failed Job Count
h. Generic Alert Log Error
i. Process Limit Usage (%)
j. Segment Approaching Maximum Extents Count
Select Severity as Warning
Click ok and finish

10. Setting up notification rule for Monitoring Host_Critical
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create like -> Provide Name: MONITOR_HOST_CRITICAL, enter Description, make the rule as public, target type –Host and select apply rule to all agent targets
Select Availability Tab-> select Agent Unreachable and Agent Unreachable
Click on Metrics Tab and select the following metrics
a. CPU in I/O Wait (%)
b. CPU Utilization (%)
c. Filesystem Space Available (%)
d. Memory Utilization (%)
Select Severity as Critical
Click ok and finish

11. Setting up notification rule for Monitoring HOST_Warning
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create like -> Provide Name: MONITOR_HOST_Warning, enter Description, make the rule as public, target type –Host and select apply rule to all agent targets
Select Availability Tab-> select Agent Unreachable and Agent Unreachable
Click on Metrics Tab and select the following metrics
a. CPU in I/O Wait (%)
b. CPU Utilization (%)
c. Filesystem Space Available (%)
d. Memory Utilization (%)
Select Severity as Warning
Click ok and finish


Regards,
Sowmya (OSR)