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)
Friday, August 20, 2010
Thursday, August 19, 2010
How to Open the Standby Database when the 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)
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)
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)
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)
Oracle Data Guard - Introduction
Hello,
Introduction to Oracle Data Guard
Oracle Data Guard is most effective and comprehensive data protection and disaster recovery solutions available for enterprise data.
Oracle Data Guard maintains, manages and monitors one or more standby database to protect enterprise data from failures, disasters, errors and corruptions. Standby database is a consistent copy of production database. If the production database becomes unavailable because of a planned or an unplanned outage, Data Guard can switch any standby database to the production role, thus minimizing the downtime and enabling zero data loss.
Data Guard Configuration
1. Primary Database (Production Database)
2. Standby Database
a. Physical Standby database (Redo Apply)
b. Logical standby database (SQL Apply)
Data Guard Services
1. Log Transport Services
2. Log Apply Services : Redo Apply or SQL Apply
3. Role Management Services
Data Guard Broker
Data Guard broker is a distributed management framework that automates and centralizes the creation, maintenance, and monitoring of Data Guard configurations using either GUI (In EM) or CLI(DGMGRL prompt)
Data Guard Protection Modes
1. Maximum Protection: No data loss. Primary database shuts down in case of transmission failure
2. Maximum Availability: No data loss. Primary database tolerates one transmission failure
3. Maximum Performance: A transaction is committed when its redo entries are written to local redo log.
Data Guard and complementary Technologies
1. Oracle Real Application clusters (RAC)
2. Flashback Database
3. Recovery Manager (RMAN)
Summary of Data Guard Benefits
1. Disaster recovery, data protection , and high availability
2. Complete data protection
3. Efficient use of system resources
4. Automatic gap detection and resolution
5. Centralized and simple management
6. Integration with Oracle Database
Types of Standby Databases
1. Physical Standby Databases : It works in 2 modes: Redo Apply ( the database cannot be opened while redo is being applied), open Read only and Open read /write
Although the physical standby database cannot perform both Redo Apply and be opened in read -only mode at the same time, you can switch between them.
Benefits of a Physical Standby Database
1. Efficient disaster recovery and high availability
2. Data Protection
3. Reduction in Primary database workload Performance
2. Logical Standby Database: The logical standby database can be used concurrently for data protection and reporting operations. It has some restrictions on datatypes, types of tables, and types of DDL and DML operations
Benefits of a Logical standby Database
1. It has same benefits as in a Physical standby database
2. Efficient use of standby hardware resources
3. Reduction in primary database workload
Online Redo Logs, Archived Redo Logs, and Standby Redo Logs
Redo data transmitted from the primary database is received by the remote file server (RFS) process on the standby system where the RFS process writes the redo data to archived log files or standby redo log files
Online Redo Logs and Archived Redo Logs
1. Online Redo Logs apply in the primary database and does not apply in the physical standby database
2. Primary database and both physical and logical standby databases each have an archived redo log.
Standby Redo Logs
1. A standby redo log is similar in all ways to an online redo log, except that a standby redo log is used only when the database is running in the standby role to store redo data received from the primary database. It is highly recommended to configure.
Regards,
Sowmya Bandaru (OSR)
Introduction to Oracle Data Guard
Oracle Data Guard is most effective and comprehensive data protection and disaster recovery solutions available for enterprise data.
Oracle Data Guard maintains, manages and monitors one or more standby database to protect enterprise data from failures, disasters, errors and corruptions. Standby database is a consistent copy of production database. If the production database becomes unavailable because of a planned or an unplanned outage, Data Guard can switch any standby database to the production role, thus minimizing the downtime and enabling zero data loss.
Data Guard Configuration
1. Primary Database (Production Database)
2. Standby Database
a. Physical Standby database (Redo Apply)
b. Logical standby database (SQL Apply)
Data Guard Services
1. Log Transport Services
2. Log Apply Services : Redo Apply or SQL Apply
3. Role Management Services
Data Guard Broker
Data Guard broker is a distributed management framework that automates and centralizes the creation, maintenance, and monitoring of Data Guard configurations using either GUI (In EM) or CLI(DGMGRL prompt)
Data Guard Protection Modes
1. Maximum Protection: No data loss. Primary database shuts down in case of transmission failure
2. Maximum Availability: No data loss. Primary database tolerates one transmission failure
3. Maximum Performance: A transaction is committed when its redo entries are written to local redo log.
Data Guard and complementary Technologies
1. Oracle Real Application clusters (RAC)
2. Flashback Database
3. Recovery Manager (RMAN)
Summary of Data Guard Benefits
1. Disaster recovery, data protection , and high availability
2. Complete data protection
3. Efficient use of system resources
4. Automatic gap detection and resolution
5. Centralized and simple management
6. Integration with Oracle Database
Types of Standby Databases
1. Physical Standby Databases : It works in 2 modes: Redo Apply ( the database cannot be opened while redo is being applied), open Read only and Open read /write
Although the physical standby database cannot perform both Redo Apply and be opened in read -only mode at the same time, you can switch between them.
Benefits of a Physical Standby Database
1. Efficient disaster recovery and high availability
2. Data Protection
3. Reduction in Primary database workload Performance
2. Logical Standby Database: The logical standby database can be used concurrently for data protection and reporting operations. It has some restrictions on datatypes, types of tables, and types of DDL and DML operations
Benefits of a Logical standby Database
1. It has same benefits as in a Physical standby database
2. Efficient use of standby hardware resources
3. Reduction in primary database workload
Online Redo Logs, Archived Redo Logs, and Standby Redo Logs
Redo data transmitted from the primary database is received by the remote file server (RFS) process on the standby system where the RFS process writes the redo data to archived log files or standby redo log files
Online Redo Logs and Archived Redo Logs
1. Online Redo Logs apply in the primary database and does not apply in the physical standby database
2. Primary database and both physical and logical standby databases each have an archived redo log.
Standby Redo Logs
1. A standby redo log is similar in all ways to an online redo log, except that a standby redo log is used only when the database is running in the standby role to store redo data received from the primary database. It is highly recommended to configure.
Regards,
Sowmya Bandaru (OSR)
Friday, July 23, 2010
Oracle Grid - Creating Notification Rules
Hello,
In this blog i am going to explain creating the notification rules.
I have created different rules for critical alerts and warning rules, and i am going to assign all critical alerts to critical admin and warning alerts to warning admin.
here i am just creating the rules and assigning them to public. Later i am going to subscribe them to email by logging into critical admin and warning admin
Notification Rules are setup for the following
1. Monitoring Agent
2. Monitoring Cluster
3. Monitoring Listener
4. Monitoring ASM_Critical
5. Monitoring ASM_Warning
6. Monitoring Cluster_Database_Critical
7. Monitoring Cluster_Database_Warning
8. Monitoring Database_Instance_Critical
9. Monitoring Database_Instance_Warning
10. Monitoring Host_Critical
11. Monitoring HOST_Warning
Creating Notification Rules
1. Setting up notification rule for Monitoring Agent
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create Like-> Provide Name: MONITOR_AGENT, enter Description, make the rule as public, target type –agent and select apply rule to all agent targets
Select Availability Tab-> select Agent Unreachable and Agent Unreachable Resolved and click on finish.
2. Setting up notification rule for Monitoring Cluster
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create like ->Provide Name: MONITOR_CLUSTER, 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 Resolved and click on finish.
3. Setting up notification rule for Monitoring Listener
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create like ->Provide Name: MONITOR_LISTENER, enter Description, make the rule as public, target type –listener and select apply rule to all agent targets
Select Availability Tab-> select Agent Unreachable and Agent Unreachable Resolved and click on finish.
4. Setting up notification rule for Monitoring ASM_Critical
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create like ->Provide Name: MONITOR_ASM_CRITICAL, enter Description, make the rule as public, target type –ASM 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 all metrics which are needed and I have mentioned few of them)
a. Alert Log Error Stack
b. Archive Hung Error Stack
c. Archiver Hung Alert Log Error Status
d. Data Block Corruption Alert Log Error Status
e. Data Block Corruption Error Stack
f. Disk Mode Status
g. Generic Alert Log Error Status
h. Media Failure Alert Log Error Status
i. Media Failure Error Stack
j. Offline Disk Count
Select Severity as Critical
Click ok and finish
5. Setting up notification rule for Monitoring ASM_Warning
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create like ->Provide Name: MONITOR_ASM_Warning, enter Description, make the rule as public, target type –ASM 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 all metrics which are needed and I have mentioned few of them)
a. Alert Log Error Stack
b. Archive Hung Error Stack
c. Archiver Hung Alert Log Error Status
d. Data Block Corruption Alert Log Error Status
e. Data Block Corruption Error Stack
f. Disk Mode Status
g. Generic Alert Log Error Status
h. Media Failure Alert Log Error Status
i. Media Failure Error Stack
j. Offline Disk Count
Select Severity as Warning
Click ok and finish
Regards,
Sowmya (OSR)
In this blog i am going to explain creating the notification rules.
I have created different rules for critical alerts and warning rules, and i am going to assign all critical alerts to critical admin and warning alerts to warning admin.
here i am just creating the rules and assigning them to public. Later i am going to subscribe them to email by logging into critical admin and warning admin
Notification Rules are setup for the following
1. Monitoring Agent
2. Monitoring Cluster
3. Monitoring Listener
4. Monitoring ASM_Critical
5. Monitoring ASM_Warning
6. Monitoring Cluster_Database_Critical
7. Monitoring Cluster_Database_Warning
8. Monitoring Database_Instance_Critical
9. Monitoring Database_Instance_Warning
10. Monitoring Host_Critical
11. Monitoring HOST_Warning
Creating Notification Rules
1. Setting up notification rule for Monitoring Agent
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create Like-> Provide Name: MONITOR_AGENT, enter Description, make the rule as public, target type –agent and select apply rule to all agent targets
Select Availability Tab-> select Agent Unreachable and Agent Unreachable Resolved and click on finish.
2. Setting up notification rule for Monitoring Cluster
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create like ->Provide Name: MONITOR_CLUSTER, 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 Resolved and click on finish.
3. Setting up notification rule for Monitoring Listener
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create like ->Provide Name: MONITOR_LISTENER, enter Description, make the rule as public, target type –listener and select apply rule to all agent targets
Select Availability Tab-> select Agent Unreachable and Agent Unreachable Resolved and click on finish.
4. Setting up notification rule for Monitoring ASM_Critical
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create like ->Provide Name: MONITOR_ASM_CRITICAL, enter Description, make the rule as public, target type –ASM 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 all metrics which are needed and I have mentioned few of them)
a. Alert Log Error Stack
b. Archive Hung Error Stack
c. Archiver Hung Alert Log Error Status
d. Data Block Corruption Alert Log Error Status
e. Data Block Corruption Error Stack
f. Disk Mode Status
g. Generic Alert Log Error Status
h. Media Failure Alert Log Error Status
i. Media Failure Error Stack
j. Offline Disk Count
Select Severity as Critical
Click ok and finish
5. Setting up notification rule for Monitoring ASM_Warning
Login into Oracle Grid using Dbwatch
Click on preferences -> Rules
Click on Create like ->Provide Name: MONITOR_ASM_Warning, enter Description, make the rule as public, target type –ASM 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 all metrics which are needed and I have mentioned few of them)
a. Alert Log Error Stack
b. Archive Hung Error Stack
c. Archiver Hung Alert Log Error Status
d. Data Block Corruption Alert Log Error Status
e. Data Block Corruption Error Stack
f. Disk Mode Status
g. Generic Alert Log Error Status
h. Media Failure Alert Log Error Status
i. Media Failure Error Stack
j. Offline Disk Count
Select Severity as Warning
Click ok and finish
Regards,
Sowmya (OSR)
Tuesday, June 22, 2010
Data Guard - Setting up Physcial Standby Database
Hello,
Setting Up Physical Standby Database
Setting up a Physical Standby database is easy when all prerequisites and setup steps are met. It is easy to build a Data guard Physical Standby Database using Oracle 10g Grid Control Console.
Note:
1. Identical Hardware, OS on both Primary and Secondary
2. Oracle Database 10g Enterprise Edition on Primary and Secondary
3. SSH is configured for user oracle on both nodes
4. Oracle Home is on identical path on both nodes
Implementation Notes:
Follow these steps when once you have your primary database up and running
Primary Database
1. Enable Force Logging
2. Create a Password File
3. Configure a Standby Redo Log
4. Enable Archiving
5. Set Primary Database Initialization Parameters
Standby Database
1. Create a control file for the standby database
2. Backup the Primary Database and transfer a copy to the standby node
3. Prepare an initialization Parameter file for the Standby Database
4. Configure the listener and tnsnames to support the database on both nodes
5. Set Up the Environment to support the standby database on the standby node
6. Start the physical standby database
7. Verify the physical standby database is performing properly
Step by Step implementation of a Physical Standby environment
Primary Database Steps:
1. Check the name of the database by querying the database
SQL>desc v$database
BBMLPROD
SQL>select name from v$database;
2. Check the data file location on primary side
SQL>desc v$dba_data_files
SQL>select filename from v$dba_data_files
3. Check the online log file location on the primary side
SQL>desc v$log, v$logfile
SQL>select group3, member from v$logfile;
SQL>select * from v$log;
4. SQL>show parameter unique
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_unique_name string BBMLPROD
5. Enable force Logging
In order to implement standby database enable ‘forced Logging’. This ensures that even in the event that a ‘no logging’ operation is done, force logging takes precedence and all operations are logged into the redo logs.
SQL>alter database force logging;
Database altered
6. Create a Password File
In order to be able to ship and apply archive log files from primary to standby database a password file must be created on the primary and copied the same to the secondary.
Note: Sys password must be identical on both sites.
cd $ORACLE_HOME/dbs
[/opt/oracle]>orapwd file=orapwbbmlprod password=oracle force=y
7. Configure standby redo log is added to enable Data guard Maximum availability and Maximum Protection modes. Configure standby redo logs (SRL) with same size as online redo logs.
SQL> select * from v$logfile;
I have noticed there are 3 groups
SQL> select bytes from v$log;
Bytes
--------
52443300
SQL> alter database add standby logfile group 4 size 50M
Database altered
SQL>alter database add standby logfile group 5 size 50M
Database altered
SQL>alter database add standby logfile group 5 size 50M;
Database altered
Now make sure that u have three more log groups
Use this query
SQL> select * from v$logfile;
6 rows selected
8. Enable Archive log mode
Check whether database is in archive log if not alter the database to archive log mode.
SQL>archive log list
Change the database to archive log mode
SQL> startup mount;
SQL> alter database archive log;
SQL>alter database open
SQL>archive log list
9. Set primary Database init.ora Parameter
Initialization Parameter controls the behavior of a Data Guard environment. Data guard must use spfile, in order to configure this first we create and configure standby parameters on a regular pfile and later we convert this to spfile
SQL> create pfile=’/oradisk/app01/oracle/product/10gDB/dbs/pfileBBMLPROD.ora’ from spfile;
Edit the pfile to add the standby parameters, few parameters are listed which needs to be modified.
Db_unique_name=’BBMLPROD’
Log_Archive_config=’DG_CONFIG=BBMLPROD, BBMLDR’
Log_Archive_Dest_1=’Location=/../../archdest/
Valid_for=(All_logfiles, All_roles)
Db_unique_Name=’BBMLPROD’
Log_Archive_Dest_2=
‘Service=’BBMLDR LGWR ASYNC
Valid_for=(online_logfiles, primary_role)
Db_unique_name=BBMLDR’
Log_archive_dest_state_1=Enable
Log_Archive_Format=%t_%s_%r.arc
Log_Archive_Max_Processes=30
#standby role Parameters
Fal_server=BBMLDR
Fal_client=BBMLPROD
Standby_file_management=auto
Db_file_name_convert=’BBMLDR/BBMLDR’,’ BBMLPROD/BBMLPROD’
Log_file_name_convert=’/../../../’,’/…/../../’
Once the parameter file is ready create spfile from this new pfile
SQL> shutdown immediate;
SQL>startup nomount pfile=’/oradisk/app01/oracle/product/10gDB/dbs/pfileBBMLPROD.ora’;
SQL> create spfile from pfile=’/oradisk/app01/oracle/product/10gDB/dbs/pfileBBMLPROD.ora’;
SQL>shutdown immediate;
SQL>startup;
Standby Database Steps
1. Standby database will use the control file that is generated on the primary database
SQL>startup mount;
SQL>alter database create standby controlfile as ‘/oradisk/app01/oracle/product/10gDB/dbs/BBMLDR.ctl’;
SQL> Alter Database Open;
2. Backup the Primary Database and transfer a copy to the standby node.
Note: Backup the primary database is nothing your .dbf, .log, .tmp files. Perform copy of those files and using scp move that on standby database.
3. On the standby node create necessary directories to get the datafiles, logfiles and so on.
[/opt/oracle]#mkdir –p /oradisk/oracle/BBMLDR/datafile/
[/opt/oracle]#mkdir –p /oradisk/oracle/BBMLDR/onlinelog/
[/opt/oracle/]#chown –R oracle:dba/oradisk/oracle
4. Now Copy the entire database from primary to standby while the main database is down or in backup mode. Copying database includes copying all .dbf,.log, .tmp files
5. Prepare an initialization parameter file for the standby database.
Following list shows the parameter
Edit the following
Db_unique_name=’BBMLDR’
audit_file_dest=’/oradisk/app01/oracle/admin/bbmldr/adump’
background_dump_dest,=’/oradisk/app01/oracle/admin/BBMLDR/bdump’
core_dump_dest=’/oradisk/app01/oracle/admin/BBMLDR/cdump’
user_dump_dest, control_files=’/oradisk/app01/oracle/admin/BBMLDR/udump’
db_create_file_dest=’/oradisk/oracle/BBMLDR’
db_file_name_convert=’/oradisk/oracle/bbmldr/datafile/’,’/../../../bbmlprod/datafile/’
log_file_name_convert=’/oradisk/oracle/bbmldr/onlinelog/’,’/../../../bbmlprod/onlinelog/’
fal_server=’bbmlprod’
fal_client=’bbmldr’
log_archive_dest_1=’location=/oradisk/oracle/bbmldr/archives/’
valid_for=(all_logfiles, all_roles)
db_unique_name=’bbmldr’
log_archive_dest_2=’service=bbmlprod lgwr async
valid_for=(online_logfiles, primary_role)
db_unique_name=’bbmlprod’
6. Create all required directories for dump directories and archived log destination
[/opt/oracle]#mkdir –p /oradisk/app01/oracle/admin/BBMLDR/budmp
[/opt/oracle]#mkdir –p /oradisk/app01/oracle/admin/BBMLDR/cdump
[/opt/oracle]#mkdir –p /oradisk/app01/oracle/admin/BBMLDR/udump
[/opt/oracle]#mkdir –p /oradisk/app01/oracle/admin/BBMLDR/archives/
7. Copy from the primary controlfile to standby control file to its destination using scp –p
[sblbgp01]>scp –p bbmldr.ctl drsblbgp01:/oradisk/BBMLDR/controlfile/bbmldr_02.ctl
[sblbgp01]>scp –p bbmldr.ctl drsblbgp01:/oradisk/BBMLDR/controlfile/bbmldr_01.ctl
8. Configure the listener and tnsnames to support the database on both nodes
#ON sblbgp01
LISTENER_BBMLPROD=
(DESCRIPTION=
(DESCRIPTION=
(ADDRESS =(PROTOCOL = TCP)(HOST=sblbgp01)(PORT=1520)(IP=FIRST))
)
)
SID_LIST_LISTENER_BBMLPROD
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME= BBMLPROD)
(ORACLE_HOME = /oradisk/appl01/oracle/product/10gDB)
(SID_NAME = bbmlprod)
)
)
#drsblbgp01
LISTENER_BBMLDR =
(DESCRIPTION_LIST=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = drsblbgp01) (PORT=1520) (IP=FIRST)
)
)
SID_LIST_LISTENER_BBMLDR =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = BBMLDR)
(ORACLE_HOME = /oradisk/app01/oracle/product/10gDB)
(SID_NAME = BBMLDR)
)
)
Configure tnsnames.ora on both servers to hold entries for both databases.
# ON sblbgp01
LISTENER_BBMLPROD =
(DESCRIPTION_LIST=
(DESCRIPTION =
(ADDRESS = (PROTOCOL =TCP) (HOST = sblbgp01) (PORT = 1520) (IP = FIRST)
)
)
BBMLPROD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST =sblbgp01) (PORT = 1520))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = BBMLPROD)
)
)
BBMLDR =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = drsblbgp01) (PORT = 1520))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME =BBMLDR)
)
)
#ON drsblbgp01
LISTENER_BBMLDR =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL =TCP) (HOST =drsblbgp01) (PORT =1520) (IP = FIRST)
)
)
BBMLDR =
(DESCRIPTION =
(ADDRESS = (PROTOCOL =TCP) (HOST = drsblbgp01) (PORT =1520))
(CONNECT_DATA=
(SERVER = DEDICATED)
(SERVICE_NAME = BBMLDR)
)
)
BBMLPROD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST =SBLBGP01) (PORT =1520))
(CONNECT_DATA =
(SERVER =DEDICATED)
(SERVICE_NAME =BBMLPROD)
)
)
9. Start the listener and check tnsping on both nodes to both
On node 1
[sblbgp01]>Lsnrctl start bbmlprod
[sblbgp01]>Lsnrctl start bbmldr
[sblbgp01]>tnsping bbmlprod
[sblbgp01]>tnsping bbmldr
10. Set up the environment to support the standby database on the standby node.
Copy the password file from primary to standby, sys password must be identical
[sblbgp01]>scp orapwbbmlprod drsblbgp01:/oradisk/app01/oracle/product/10gDB/dbs/orapwbbmldr
Setup the environment variable to point to the standby database
ORACLE_HOME=/oradisk/app01/oracle/product/10gDB
ORACLE_SID=bbmldr
PATH=$ORACLE_HOME/bin:$PATH
Startup nomount the standby database and generate an spfile
[drsblbgp01]> cd $ORACLE_HOME
[drsblbgp01]>Sqlplus /nolog
[drsblbgp01]>conn sys/as sysdba
SQL>startup nomount pfile =’/oradisk/app01/oracle/product/10gDB/dbs/initbbmldr.ora’;
SQL>create spfile from pfile =’/oradisk/app01/oracle/product/10gDB/dbs/initbbmldr.ora’;
SQL> shutdown immediate;
SQL> startup mount
SQL> Alter Database Recover Managed standby database disconnect from session;
Database altered
Check the alert log of both primary and standby which will give you complete information
Verifying the Physical standby database is performing properly
Check archived redo log on standby
SQL>show parameters db_unique_name;
SQL> Select thread#, sequence#, name, first_time, next_time, completion_time, applied from V$ARCHIVED_LOG ORDER BY first_time, thread#;
Switch logfile on primary
SQL>alter system switch logfile;
SQL> archive log list
SQL>alter system switch logfile
SQL>archive log list
Check archived redo log on standby
SQL>Select thread#, sequence#, name, first_time, next_time, completion_time, applied from V$ARCHIVED_LOG ORDER BY first_time, thread#;
Regards,
Sowmya Bandaru (OSR)
Setting Up Physical Standby Database
Setting up a Physical Standby database is easy when all prerequisites and setup steps are met. It is easy to build a Data guard Physical Standby Database using Oracle 10g Grid Control Console.
Note:
1. Identical Hardware, OS on both Primary and Secondary
2. Oracle Database 10g Enterprise Edition on Primary and Secondary
3. SSH is configured for user oracle on both nodes
4. Oracle Home is on identical path on both nodes
Implementation Notes:
Follow these steps when once you have your primary database up and running
Primary Database
1. Enable Force Logging
2. Create a Password File
3. Configure a Standby Redo Log
4. Enable Archiving
5. Set Primary Database Initialization Parameters
Standby Database
1. Create a control file for the standby database
2. Backup the Primary Database and transfer a copy to the standby node
3. Prepare an initialization Parameter file for the Standby Database
4. Configure the listener and tnsnames to support the database on both nodes
5. Set Up the Environment to support the standby database on the standby node
6. Start the physical standby database
7. Verify the physical standby database is performing properly
Step by Step implementation of a Physical Standby environment
Primary Database Steps:
1. Check the name of the database by querying the database
SQL>desc v$database
BBMLPROD
SQL>select name from v$database;
2. Check the data file location on primary side
SQL>desc v$dba_data_files
SQL>select filename from v$dba_data_files
3. Check the online log file location on the primary side
SQL>desc v$log, v$logfile
SQL>select group3, member from v$logfile;
SQL>select * from v$log;
4. SQL>show parameter unique
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_unique_name string BBMLPROD
5. Enable force Logging
In order to implement standby database enable ‘forced Logging’. This ensures that even in the event that a ‘no logging’ operation is done, force logging takes precedence and all operations are logged into the redo logs.
SQL>alter database force logging;
Database altered
6. Create a Password File
In order to be able to ship and apply archive log files from primary to standby database a password file must be created on the primary and copied the same to the secondary.
Note: Sys password must be identical on both sites.
cd $ORACLE_HOME/dbs
[/opt/oracle]>orapwd file=orapwbbmlprod password=oracle force=y
7. Configure standby redo log is added to enable Data guard Maximum availability and Maximum Protection modes. Configure standby redo logs (SRL) with same size as online redo logs.
SQL> select * from v$logfile;
I have noticed there are 3 groups
SQL> select bytes from v$log;
Bytes
--------
52443300
SQL> alter database add standby logfile group 4 size 50M
Database altered
SQL>alter database add standby logfile group 5 size 50M
Database altered
SQL>alter database add standby logfile group 5 size 50M;
Database altered
Now make sure that u have three more log groups
Use this query
SQL> select * from v$logfile;
6 rows selected
8. Enable Archive log mode
Check whether database is in archive log if not alter the database to archive log mode.
SQL>archive log list
Change the database to archive log mode
SQL> startup mount;
SQL> alter database archive log;
SQL>alter database open
SQL>archive log list
9. Set primary Database init.ora Parameter
Initialization Parameter controls the behavior of a Data Guard environment. Data guard must use spfile, in order to configure this first we create and configure standby parameters on a regular pfile and later we convert this to spfile
SQL> create pfile=’/oradisk/app01/oracle/product/10gDB/dbs/pfileBBMLPROD.ora’ from spfile;
Edit the pfile to add the standby parameters, few parameters are listed which needs to be modified.
Db_unique_name=’BBMLPROD’
Log_Archive_config=’DG_CONFIG=BBMLPROD, BBMLDR’
Log_Archive_Dest_1=’Location=/../../archdest/
Valid_for=(All_logfiles, All_roles)
Db_unique_Name=’BBMLPROD’
Log_Archive_Dest_2=
‘Service=’BBMLDR LGWR ASYNC
Valid_for=(online_logfiles, primary_role)
Db_unique_name=BBMLDR’
Log_archive_dest_state_1=Enable
Log_Archive_Format=%t_%s_%r.arc
Log_Archive_Max_Processes=30
#standby role Parameters
Fal_server=BBMLDR
Fal_client=BBMLPROD
Standby_file_management=auto
Db_file_name_convert=’BBMLDR/BBMLDR’,’ BBMLPROD/BBMLPROD’
Log_file_name_convert=’/../../../’,’/…/../../’
Once the parameter file is ready create spfile from this new pfile
SQL> shutdown immediate;
SQL>startup nomount pfile=’/oradisk/app01/oracle/product/10gDB/dbs/pfileBBMLPROD.ora’;
SQL> create spfile from pfile=’/oradisk/app01/oracle/product/10gDB/dbs/pfileBBMLPROD.ora’;
SQL>shutdown immediate;
SQL>startup;
Standby Database Steps
1. Standby database will use the control file that is generated on the primary database
SQL>startup mount;
SQL>alter database create standby controlfile as ‘/oradisk/app01/oracle/product/10gDB/dbs/BBMLDR.ctl’;
SQL> Alter Database Open;
2. Backup the Primary Database and transfer a copy to the standby node.
Note: Backup the primary database is nothing your .dbf, .log, .tmp files. Perform copy of those files and using scp move that on standby database.
3. On the standby node create necessary directories to get the datafiles, logfiles and so on.
[/opt/oracle]#mkdir –p /oradisk/oracle/BBMLDR/datafile/
[/opt/oracle]#mkdir –p /oradisk/oracle/BBMLDR/onlinelog/
[/opt/oracle/]#chown –R oracle:dba/oradisk/oracle
4. Now Copy the entire database from primary to standby while the main database is down or in backup mode. Copying database includes copying all .dbf,.log, .tmp files
5. Prepare an initialization parameter file for the standby database.
Following list shows the parameter
Edit the following
Db_unique_name=’BBMLDR’
audit_file_dest=’/oradisk/app01/oracle/admin/bbmldr/adump’
background_dump_dest,=’/oradisk/app01/oracle/admin/BBMLDR/bdump’
core_dump_dest=’/oradisk/app01/oracle/admin/BBMLDR/cdump’
user_dump_dest, control_files=’/oradisk/app01/oracle/admin/BBMLDR/udump’
db_create_file_dest=’/oradisk/oracle/BBMLDR’
db_file_name_convert=’/oradisk/oracle/bbmldr/datafile/’,’/../../../bbmlprod/datafile/’
log_file_name_convert=’/oradisk/oracle/bbmldr/onlinelog/’,’/../../../bbmlprod/onlinelog/’
fal_server=’bbmlprod’
fal_client=’bbmldr’
log_archive_dest_1=’location=/oradisk/oracle/bbmldr/archives/’
valid_for=(all_logfiles, all_roles)
db_unique_name=’bbmldr’
log_archive_dest_2=’service=bbmlprod lgwr async
valid_for=(online_logfiles, primary_role)
db_unique_name=’bbmlprod’
6. Create all required directories for dump directories and archived log destination
[/opt/oracle]#mkdir –p /oradisk/app01/oracle/admin/BBMLDR/budmp
[/opt/oracle]#mkdir –p /oradisk/app01/oracle/admin/BBMLDR/cdump
[/opt/oracle]#mkdir –p /oradisk/app01/oracle/admin/BBMLDR/udump
[/opt/oracle]#mkdir –p /oradisk/app01/oracle/admin/BBMLDR/archives/
7. Copy from the primary controlfile to standby control file to its destination using scp –p
[sblbgp01]>scp –p bbmldr.ctl drsblbgp01:/oradisk/BBMLDR/controlfile/bbmldr_02.ctl
[sblbgp01]>scp –p bbmldr.ctl drsblbgp01:/oradisk/BBMLDR/controlfile/bbmldr_01.ctl
8. Configure the listener and tnsnames to support the database on both nodes
#ON sblbgp01
LISTENER_BBMLPROD=
(DESCRIPTION=
(DESCRIPTION=
(ADDRESS =(PROTOCOL = TCP)(HOST=sblbgp01)(PORT=1520)(IP=FIRST))
)
)
SID_LIST_LISTENER_BBMLPROD
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME= BBMLPROD)
(ORACLE_HOME = /oradisk/appl01/oracle/product/10gDB)
(SID_NAME = bbmlprod)
)
)
#drsblbgp01
LISTENER_BBMLDR =
(DESCRIPTION_LIST=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = drsblbgp01) (PORT=1520) (IP=FIRST)
)
)
SID_LIST_LISTENER_BBMLDR =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = BBMLDR)
(ORACLE_HOME = /oradisk/app01/oracle/product/10gDB)
(SID_NAME = BBMLDR)
)
)
Configure tnsnames.ora on both servers to hold entries for both databases.
# ON sblbgp01
LISTENER_BBMLPROD =
(DESCRIPTION_LIST=
(DESCRIPTION =
(ADDRESS = (PROTOCOL =TCP) (HOST = sblbgp01) (PORT = 1520) (IP = FIRST)
)
)
BBMLPROD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST =sblbgp01) (PORT = 1520))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = BBMLPROD)
)
)
BBMLDR =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = drsblbgp01) (PORT = 1520))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME =BBMLDR)
)
)
#ON drsblbgp01
LISTENER_BBMLDR =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL =TCP) (HOST =drsblbgp01) (PORT =1520) (IP = FIRST)
)
)
BBMLDR =
(DESCRIPTION =
(ADDRESS = (PROTOCOL =TCP) (HOST = drsblbgp01) (PORT =1520))
(CONNECT_DATA=
(SERVER = DEDICATED)
(SERVICE_NAME = BBMLDR)
)
)
BBMLPROD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST =SBLBGP01) (PORT =1520))
(CONNECT_DATA =
(SERVER =DEDICATED)
(SERVICE_NAME =BBMLPROD)
)
)
9. Start the listener and check tnsping on both nodes to both
On node 1
[sblbgp01]>Lsnrctl start bbmlprod
[sblbgp01]>Lsnrctl start bbmldr
[sblbgp01]>tnsping bbmlprod
[sblbgp01]>tnsping bbmldr
10. Set up the environment to support the standby database on the standby node.
Copy the password file from primary to standby, sys password must be identical
[sblbgp01]>scp orapwbbmlprod drsblbgp01:/oradisk/app01/oracle/product/10gDB/dbs/orapwbbmldr
Setup the environment variable to point to the standby database
ORACLE_HOME=/oradisk/app01/oracle/product/10gDB
ORACLE_SID=bbmldr
PATH=$ORACLE_HOME/bin:$PATH
Startup nomount the standby database and generate an spfile
[drsblbgp01]> cd $ORACLE_HOME
[drsblbgp01]>Sqlplus /nolog
[drsblbgp01]>conn sys/as sysdba
SQL>startup nomount pfile =’/oradisk/app01/oracle/product/10gDB/dbs/initbbmldr.ora’;
SQL>create spfile from pfile =’/oradisk/app01/oracle/product/10gDB/dbs/initbbmldr.ora’;
SQL> shutdown immediate;
SQL> startup mount
SQL> Alter Database Recover Managed standby database disconnect from session;
Database altered
Check the alert log of both primary and standby which will give you complete information
Verifying the Physical standby database is performing properly
Check archived redo log on standby
SQL>show parameters db_unique_name;
SQL> Select thread#, sequence#, name, first_time, next_time, completion_time, applied from V$ARCHIVED_LOG ORDER BY first_time, thread#;
Switch logfile on primary
SQL>alter system switch logfile;
SQL> archive log list
SQL>alter system switch logfile
SQL>archive log list
Check archived redo log on standby
SQL>Select thread#, sequence#, name, first_time, next_time, completion_time, applied from V$ARCHIVED_LOG ORDER BY first_time, thread#;
Regards,
Sowmya Bandaru (OSR)
Subscribe to:
Posts (Atom)