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.
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?
Jurij Modic ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
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?
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
------ ------------------------ --------------------- -----------
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?
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.
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).
Jurij Modic ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
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
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).
Jurij Modic ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
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
Bookmarks