Home » Server Options » Data Guard » Activate 2nd standby database as primary (Oracle Enterprise Edition, 11.2.0.4 , Windows, Linux)
Activate 2nd standby database as primary [message #657450] Wed, 09 November 2016 04:24 Go to next message
sanei05
Messages: 104
Registered: September 2008
Senior Member
Hi,
currently we have a primary and 1 physical standby database (PSB) in sync ( max availability mode).

now, I have done the following


1. Added 2nd Physical standby database using online duplicate target database from primary
2. Then, the redo are in sync for both 1st and 2nd PSB w.r.t Primary
3. Next, when I redo log switch , the redo shipping was fine and even applied=YES condition was showing the updated SEQUENCE# as that of Primary
4. But I did not configure the 2nd PSB in dgmgrl.
5. Now, the next step what I did was that , I want to make 2nd PSB as Primary, for that, I made the log_archive_dest_3 as DEFER to top shipping once I confirmed the logs are in sync
6. Later, on 2nd PSB ,Disable all the parameters set in PSB-2 for standby
7. Shutdown Current Pri and 1st PSB
8. i cancelled the recovery and executed the 2nd PSB convert as PRIMARY
 ALTER DATABASE ACTIVATE PHYSICAL STANDBY DATABASE; 
9. But during this time, what I noticed here is that from the 2nd PSB ( upcoming primary) alert log is that


Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Media Recovery Log +TEST_FRA/test_tst/archivelog/2016_08_10/thread_1_seq_5608.376.919550367
Media Recovery Log +TEST_FRA/test_tst/archivelog/2016_08_10/thread_1_seq_5609.375.919550367
...........
......................
 
Media Recovery Log +TEST_FRA/test_tst/archivelog/2016_08_19/thread_1_seq_6062.813.920276499
Recovery of Online Redo Log: Thread 1 Group 11 Seq 6063 Reading mem 0
  Mem# 0: +TEST_DATA/test/stdby_redo_11.log
Fri Aug 19 08:39:29 2016
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH



My query is, when I execute "ALTER DATABASE ACTIVATE PHYSICAL STANDBY DATABASE;" , why the db is looking for the recovery of the logs file even though it as already applied. Here the 2nd PSB came in to sync on Aug 10 and the activate command got executed on Aug 19. So, it was looking for archive logs from Aug 10 to Aug 19.

If I want to avoid this recovery during the activate physical standby database command, how can I do it. ..

does Failover command from dgmgrl will remove this time for recovery. ??
Re: Activate 2nd standby database as primary [message #657452 is a reply to message #657450] Wed, 09 November 2016 04:41 Go to previous messageGo to next message
John Watson
Messages: 8960
Registered: January 2010
Location: Global Village
Senior Member
I do not understand what you are describing: today is 9 November, why are you talking about August? Why do you want to failover rather than switchover? Why did you not do it all with the DAta Guard Broker? Did the operation succeed or not?
Re: Activate 2nd standby database as primary [message #657454 is a reply to message #657452] Wed, 09 November 2016 04:52 Go to previous messageGo to next message
sanei05
Messages: 104
Registered: September 2008
Senior Member
Hi Watson,

I understand that I posted late. .

I failed over on Aug and this is the 2nd PSB which I converted as Primary and looking for using this strategy in moving production. I am using this for moving the database from Windows VM ( Primary and 1 PSB) to Linux Physical box ( 2nd PSB).

Once the 2nd PSB is made as Primary, I will be rebuilding another PSB for this new PSB.


This was done in a integration env. Now, if I follow the same steps in Prod, it may cause more downtime for log recovery. So, looking for more details on how to avoid this recovery like using cascading standby and how far it will help.
Re: Activate 2nd standby database as primary [message #657456 is a reply to message #657454] Wed, 09 November 2016 04:54 Go to previous messageGo to next message
sanei05
Messages: 104
Registered: September 2008
Senior Member
1. Operation was successful and already built new PSB for this new Primary.
2. I did not do it using DG broker as I want to remove the old Primary and 1st PSB which were in VM

Re: Activate 2nd standby database as primary [message #657457 is a reply to message #657454] Wed, 09 November 2016 04:55 Go to previous messageGo to next message
John Watson
Messages: 8960
Registered: January 2010
Location: Global Village
Senior Member
I asked four questions, you have answered one. I do not understand what you are trying to do or whether you succeeded. Particularly as you have now (out of nowhere!) mentioned moving from Windows to Linux. What does that have to do with anything?
Re: Activate 2nd standby database as primary [message #657459 is a reply to message #657457] Wed, 09 November 2016 05:02 Go to previous messageGo to next message
sanei05
Messages: 104
Registered: September 2008
Senior Member
3. I did failover, because I want to remove the old Primary and 1st PSB for which the servers needs to be decommissioned.


Hope I answered all four of your questions Smile


What I am expecting are the following

1. why the recovery was done when I did failover even though I did not find any archive gap before failover ?
2. When the archivelogs were showing as Applied and the SEQUENCE# are up-to-date in Primary and PSB's, why the recovery took place during failover ?
3. Am I missing something in the above method which succeeded with more time to do the recovery ?
4. Is there any other method which would reduce the recovery of the logs ( ultimately reduce in the downtime) when migrating the databases from one host to other ?

Re: Activate 2nd standby database as primary [message #657461 is a reply to message #657459] Wed, 09 November 2016 07:18 Go to previous messageGo to next message
John Watson
Messages: 8960
Registered: January 2010
Location: Global Village
Senior Member
You forgot to explain tat reference to migration from Window to Linux.

However, your methd was not good. Recovery is always neeed after failover. I would have registered the new standby with the Broker, and then performed a switchover. Remove the oter datbase from the configuration after that. Downtime would be minimal, single digit minutes.
Re: Activate 2nd standby database as primary [message #657472 is a reply to message #657461] Wed, 09 November 2016 10:31 Go to previous message
sanei05
Messages: 104
Registered: September 2008
Senior Member
Thanks Watson..


Let me try that option too.

But the thing is we used to do failover in our normal 1 Primary and One standby. Then the recovery used to happen only for the logs which were applied.

Also, in past we had issue and one of my colleague had executed the command '"ALTER DATABASE ACTIVATE PHYSICAL STANDBY DATABASE; " and it was quick and applied only the pending log files that needs recovery.

But when we built the 2nd PSB on Aug 11 and executed the above command to activate the 2nd PSB to Primary, this started the recovery from Aug 11 2016 to Aug 19 2016 (that was already applied on 2nd PSB). Any reason why is it so.

[Updated on: Wed, 09 November 2016 10:49]

Report message to a moderator

Previous Topic: Log shipping not happening from Primary DB to Standby DB
Next Topic: dropping RAC standby database
Goto Forum:
  


Current Time: Mon Nov 18 10:22:49 CST 2024