If your primary database is not accessible or crashed for any issue, then we can use open the standby database for use.
Below are the steps for opening standby database when the primary database is lost:
1. start the standby database in mount stage:[ STANDBY]
shut immediate; startup mount;
2. Check the protection_mode and database_role
SQL> SELECT OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE FROM V$DATABASE; OPEN_MODE PROTECTION_MODE DATABASE_ROLE ---------- -------------------- ---------------- MOUNTED MAXIMUM PERFORMANCE PHYSICAL STANDBY
NOTE: If protection_mode is other than maximum performance, then alter it as below.
SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE;
3. Recover standby database:[ STANDBY]
SQL> RECOVER STANDBY DATABASE;
Make sure all archives has been applied in this process.
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 status:
SQL> SELECT OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE FROM V$DATABASE; OPEN_MODE PROTECTION_MODE DATABASE_ROLE ---------- -------------------- ---------------- MOUNTED MAXIMUM PERFORMANCE PRIMARY
7. Open the database:
SQL> ALTER DATABASE OPEN;
Now application can start using this database.
Hello,
Thank you for sharing your knowledge, but I have a question.
if I recover the primary database, how can I get back?, Using the same procedure?
If you can recover the primary , then most probably you need to open the db in reset log mode, which will change the incarnation number .So Once primary is recovered, you need to rebuild the standby.
You can put your queries in forum.dbaclass.com
Regards
Admin
This worked great. dataguard and dgmgrl was totally hosed so nothing was working.