We are setting up a standby db - we're doing a fresh install of Oracle on the box first - should we enable archiving for the standby db? Thx.
Printable View
We are setting up a standby db - we're doing a fresh install of Oracle on the box first - should we enable archiving for the standby db? Thx.
you don't have to since standby box in recovery mode but it will be extra step when you turn standby box on
Oracle suggests that the init.ora parameters for both the primary and standby db be identical as far as possible. So I think the answer would be yes. Or is my thinking wrong ?? :-)
-amar
amar,
Yes. They should be identical. You cannot apply redo logs to any database not in ARCHIVELOG mode, so standby database won't even work without this setup. Even if you could, who would go through the effort/expense to develop a standby database only to have a disaster requiring the backup, then run that backup in NOARCHIVELOG mode?
I don't think it is mandatory to have the stand by in archive log mode.
I am interested in knowing how to create the standby db in NO-ARCHIVELOG mode. Somebody mind englightening me how to do it ?? :-)
-amar
gsprince,
I reviewed numerous Metalink articles and Oracle documentation to research this thread. I could not find anything that indicated directly that NOARCHIVELOG is not available when operating a standby DB. I would think that it would have been in the Metalink articles, because they did specifically mention that the Primary database must be in ARCHIVELOG mode (obviously). However, those same articles also stated that it was imperative to make the primary and standby as close to identical as possible, and they said to copy the primary init.ora for use on the standby, and then specified exactly which parameters to change for proper standby functionality. None of the parameters to be changed involved setting ARCHIVELOG mode.
So, barring any further discoveries (I'll look around some more), I cannot substantiate my earlier post that ARCHIVELOG mode is mandatory. Since I'm aware that under "normal" circumstances, redo logs cannot be applied except to a database in ARCHIVELOG mode, it makes sense to me that the same restriction would apply here. However, I can also see that someone may wish to use the standby for reporting, analysis or some other read-only mode rather than production. Thus ARCHIVELOG mode might not even be relevant or useful to their operation and it would make sense to allow the DBA to decide the appropriate mode of operation of the standby DB.
Anyone have a definitive answer?
Don't consider this as a definitive answer, as I don't have any standby configuration handy to prove/test my thoughts.
Archivelog mode is written in the controlfile. You can't create standby database file on the primary instance if it is not running in archivelog mode, so initially your standby database will be mounted in archive log mode in any case. You also can't change the mode from archivelog to noarchivelog while your database needs media recovery. In standby database the system assumes the database constantly needs media recovery (you have to specify STANDBY while mounting the database), so I guess it will never allow you to change the mode from archivelog to noarchivelog. So you are bound to archivelog mode with standby database, you can't change that. But even if you could set it to noarchive log I can't see any advatage of running standby in noarchivelog. Neither during recovery nor during database being opened in readonly mode no redologs will be generated, so archiver won't have to do anything and will not use any system resources at all.
Another comment on this statement from one of the previous posts in this thread: "You cannot apply redo logs to any database not in ARCHIVELOG mode". This is simply not true. If you switch your database from archivelog to noarchivelog mode you can still perform a media recovery using archived redologs from the time when the database was in archivelog mode.
FYI: an update.
I posted this question on Metalink's Oracle server forum, an an Oracle Corp. tech person replied:
Can I run a STANDBY database in NOARCHIVELOG mode?
yes. actually, standby is the mode that the database is in.
So views lik v$archived_log are for a different purpose on
a standby.
Regards,
Rowena Serna
Oracle Corporation
Although the answer from Oracle Support representative is somewhat confusing ("yes. actually, *standby* is the mode that the database is in" - asterisks added by J.M.), the question is what they actually ment, even if they thought *noarchivelog* instead of *standby*.
How can we determine in which archiving mode the instance is running? One option would be to isue "ARCHIVE LOG LIST" in svrmgrl or in SQL*PLus, or to "SELECT log_mode FROM v$database;". So if someone have standby configuration handy it would be nice to post the results from the above commands on the standby database. I would be surprised if they would report standby to be in noarchivelog mode! If it realy is running in noarchivelog, what happens when you convert standby to "normal" database mode? Does it automatically swith to archivelog (because I'm positive the converted database runs in archivelog mode, just like previous primary did)?
What I suspect the Oracle Support representative realy ment was: standby database is *efectively* running in noarchivelog mode, although it formaly is configured as archivelog. The ARCx process is just sitting there, doing nothing, just like in the normal database in noarchive mode.
I had set up standby database in unix environment. Since the stand by DB is always in recovery mode, you don't need to setup it in archive log mode. Since, the init.ora files are identical, once the stand by becomes production, archive log will be enabled.
Tamilselvan,
The archivelog mode in which database is running does not depend on init.ora settings, the mode is directly written into controlfile. Since the controlfile of the standby is created on the primary database, my feeling is it "inherites" the archivelog mode from the primary database. And I think you can not explicitelly change this mode once you set up the standby. If you realy have a standby handy, could you please find out which mode does it report to be running in?
hm just wondering, if a database is in recovery mode and noarchive log mode how can you apply archived logs to it
Having database in noarchivelog mode does not prevent you from performing a recovery by aplying archived logs to it.Quote:
Originally posted by pando
hm just wondering, if a database is in recovery mode and noarchive log mode how can you apply archived logs to it
yea well I mean when you are in archive log mode the archive log infos are stored in control file but if we are not in archive log then how does Oracle get these informations from?
OK. Here is the scoop :-)
Since I most probably started this discussion about the archive log mode of the standby db, I took the pain of creating a standby db (Redhat 6.2/Oracle 8.1.6 EE) and here are the results (I took the suggestion of Jurij and used "ARCHIVE LOG LIST" to find the archive log mode of the standby db).
Case Primary DB archiving Managed Recovery Standby
# log files automatically Mode in Standby Database
to Standby DB DB in Archive
Log Mode
------ ------------------------ --------------------- -----------
1 Yes No Enabled
2 Yes Yes Enabled
3 No No Enabled
-----------------------------------------------------------------------
So NOW WHAT ?? :-)
-amar
Oracle gets the required data bot from controlfile and from the datafile header. But this does not mean that it has to record the sequence # of each log switch or archived log file in controlfile. If this was so then this would imply that theoretically control file should grow beyond any limit! All Oracle needs for recovery is the sequence number of the latest log from which data was written to database files and tro controlfile. If the SCN from datafile and controlfile do not match oracle knows it has to perform recovery. It also knows which archive log does it need to start with for recovery. It looks for the lowest sequence # of the last logfile recorded in controlfile and in data files, the next higher number is the one that it needs to apply.Quote:
Originally posted by pando
yea well I mean when you are in archive log mode the archive log infos are stored in control file but if we are not in archive log then how does Oracle get these informations from?
You can easily perform a test on your test environment. Have DB in archive log mode. Perform full backup (hot or cold). Perform a couple of log switches to get those logs archived. Then put your database in archivelog mode. Next restore the datafiles from your last backup, but leave the controlfile current (not from the backup). Try to start the database. It will still be in noarchivelog mode, but it will require recovery. Perform media recovery and it will ask you to apply the first archived log file after the backup was made (it will suggest you the right log sequence number!). Apply all the archived log files and your database will be recovered (either complete or incomplete recovery, depending what activities have taken place on your original database from the moment you've put it in noaarchivelog mode).
How does it know which one to start...? I thought Oracle gets this info from v$archived_log which is stored in control fileQuote:
Originally posted by jmodic
It also knows which archive log does it need to start with for recovery. [/B]
History of the redo logs is limited in controlfile. It is limited by the parameter MAXLOGHISTORY in the controlfile. Backup controlfile to trace or query V$CONTROLFILE_RECORD_SECTION to determine this limit. But the ability of oracle to recover the database from the past backup is unlimited. The backup could have been taken millions of logswitches ago, yet you'll be still able to perform the recovery. To determine which archived log it needs to start recovery Oracle only have to check the last recorded aplied log in the controlfile and in fileheaders in all files. Suppose it finds the following sequence numbers: In controlfile #1800, in file1 #1650 and in file# 1655. From this three numbers it knows it must first apply archived redo with the sequence # 1651 and it need to apply all the archived logs up to sequence #1850 (if you don't decide to stop the recovery earlier).Quote:
Originally posted by pando
[How does it know which one to start...? I thought Oracle gets this info from v$archived_log which is stored in control file
I know Oracle determines from where, which SCN start to recover, what I mean is that how does Oracle know that certain SCN is in certain archived log therefore it needs the corresponding archived log for recovery
It does not need to know which SCN is in which archived log file. All it needs to know is which is the first redo log that has not yet been recorded in one of the database files, but has allready been checkponted in some of the other database files or in the controlfile.
"how does Oracle know that certain SCN is in certain archived log therefore it needs the corresponding archived log for recovery" - I guess Oracle knows SCN just by using formula last_scn_from_last_applied_log+1,
and knows log number just from log_sequence_no_from_last_applied_log+1 (some issues regarding OPS may be here?)
Why would you want the standby in noarchive?
Presumptively, it will take over when the primary fails. Won't there be transactions processed by the secondary? If it fails, won't you want the archive logs to recover (assuming the primary is not yet ready?) Depending on the failure mode, won't you need them to bring the primary back up to speed until you switch processing back?