Home » Server Options » Data Guard » How To Switch Oracle Primary And Standby (what was I doing wrong!!) (Oracle11g)
How To Switch Oracle Primary And Standby (what was I doing wrong!!) [message #441634] Tue, 02 February 2010 05:34
rajk1000
Messages: 1
Registered: February 2010
Location: London
Junior Member
Oracle 11g Switch-over.
-----------------------
Can anyone help?
We have an Oracle11g primary server and an 11g standby server. The standby server is setup to only apply logs after 4 hours.
(We are NOT using Standby Redo Logs, as our primary and standby servers are actually a fair distance away from one another, and this does not work well with our network.)

This is how I performed the switchover..These are the exact steps. Unfortunately, I got errors (also copied and pasted) on the first few steps. I carried on to some degree. Anyone know what the problems were? What was I doing wrong? (PS: I am obviously not an experienced DBA. We do not yet have a full time DBA at my company).

1) on standby machine, appliy the logs which make up the 4 hour lag. This is done in advance of stopping the service to reduce the down time.
$ sqlplus / as sysdba
SQL> alter database recover managed standby database cancel;
SQL> alter database recover automatic from '/data/san03/oradata/mss01/arch/stby' standby database;

*
ERROR at line 1:
ORA-00279: change 200161780 generated at 01/31/2010 19:25:09 needed for thread
1
ORA-00289: suggestion :
/dir/details/changed/arch/stby/1_51776_699789824.dbf
ORA-00280: change 200161780 for thread 1 is in sequence #51776
ORA-00278: log file '/dir/details/changed/arch/stby/1_51776_699789824.dbf'
no longer needed for this recovery
ORA-00308: cannot open archived log
'/dir/details/changed/arch/stby/1_51776_699789824.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

2) on primary machine initiate the switchover
$ sqlplus / as sysdba
SQL> shutdown immediate
SQL> startup restrict
SQL> alter database commit to switchover to physical standby; -- Makes the primary become a standby

3) On the standby machine
(back in existing sqlplus)
SQL> alter database commit to switchover to physical primary; -- makes the standby become a primary

*
ERROR at line 1:
ORA-00060: deadlock detected while waiting for resource


4) shutdown immediate both databases.
SQL> shutdown immediate


5) Make necessary changes to DNS and wait for DNS to replicate.

6) start up the standby database (old primary)
$ sqlplus / as sysdba
SQL> startup mount
SQL> alter database recover managed standby database disconnect from session;

7) startup the primary database (old standby)
$ sqlplus / as sysdba
SQL> startup

8 ) Check the log shipping is working:
On primary -
$ alter system switch logfile

(AT this point I got an Oracle Error saying that the database was in READ-ONLY mode. With hindsight, with all of the errors before, obviously I was going to get an error here..Please tell me what I did wrong so that I and others may learn from this).

On standby -
$ ls /dir/details/changed/arch/stby

If all is OK, restart the applications.

Previous Topic: [DG Physical] ORA-00368: checksum error in redo log block
Next Topic: RMAN-08137: WARNING: archive log not deleted as it is still needed
Goto Forum:
  


Current Time: Sun Dec 22 22:48:08 CST 2024