on 08-23-2008 12:22 AM
Hi All,
This is our infrastructure:
SAP ECC 6.0
Oracle 10G
Windows 2003
We have a disaster recovery server running with Oracle Standby. Usually every day we run this command to apply the archive redolog file that come from the production server:
SQL> recover standby database until cancel;
SQL> AUTO
In this situation there aren't problems, Oracle apply all the archive file without problems. Now we need to create a windows jobs to apply the archive files every day.
We try with the following command:
brarchive -u / -sd -m -d disk -c
It exploded!!
C:\Documents and Settings\misadm>brarchive -u / -s -m -d disk -c
BR0002I BRARCHIVE 7.00 (28)
BR0165E Parameter 'primary_db' is not set in E:\oracle\<SID>\102\database\init<SID>.
sap
BR0100W Internal error for 'database_connect' at location BrDbConnect-1
BR0007I End of offline redo log processing: adyqngfg.log 2008-08-22 18.07.28
BR0280I BRARCHIVE time stamp: 2008-08-22 18.07.28
BR0005I BRARCHIVE terminated with errors
So i edited the file init<SID>.sap adding the parameter:
primary_db = <SID>
And it exploded again!!
C:\Documents and Settings\misadm>brarchive -u / -s -m -d disk -c
BR0002I BRARCHIVE 7.00 (28)
BR0006I Start of offline redo log processing: adyqngof.sve 2008-08-22 18.11.21
BR0252E Function fopen() failed for 'F:\oracle\<SID>\saparch\adyqngof.sve' at loca
tion main-6
BR0253E errno 2: No such file or directory
BR0121E Processing of log file F:\oracle\<SID>\saparch\adyqngof.sve failed
BR0280I BRARCHIVE time stamp: 2008-08-22 18.11.22
BR0301W SQL error -1033 at location BrDbConnect-2, SQL statement:
'CONNECT /@<SID>
ORA-01033: ORACLE initialization or shutdown in progress
BR0310W Connect to database instance <SID>/PRIMARY failed
BR0007I End of offline redo log processing: adyqngof.sve 2008-08-22 18.11.21
BR0280I BRARCHIVE time stamp: 2008-08-22 18.11.22
BR0005I BRARCHIVE terminated with errors
Them I googled the paremeter primary_db:
This parameter is only relevant if the disaster recovery configuration is being used. See: Standby Database Scenario.
The connect string to the primary database instance is defined with this parameter so that BRBACKUP can log onto the primary host.
Default value: None
primary_db = <connect_string>
<connect_string>: Connect string (u2018SQL*Net database specification stringu2019) from the standby host to the primary (production) database.
In consecuence i have to construct the Connect string to the Production server??
How can i do that?
Please some tips.
Best Regards,
Erick Ilarraza
Hi Erick,
Can you try out this command on oracle for take the standby database in automatic reciovery mode:
alter database recover managed standby database disconnect;
Regards,
Keyur Dave
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Keyur,
I googled the command:
alter database recover managed standby database disconnect;
But i really don't understand how it works.
Does It apply the archive archive redologs infinitely until you get disconnected from the database? what happens if the aren't more archive redolog to apply? it wait until there is a new one?
I found this information:
-- User session hangs
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;
-- User session released
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
On the other hand if you use the command brarchive -u / -s -m -d disk -c you have the control over the archive redolog that were applied for example:
-s|-save
Archive the offline redo log files.
-sc|-second_copy
Create a second copy of the offline redo log files which were already archived.
-ds|-delete_saved
Delete offline redo log files that have been archived once.
· -dc|-delete_copied
Delete offline redo log files that have been copied twice.
· -sd|-save_delete
Archive offline redo log files and then delete these files.
· -scd|-second_copy_delete
Create a second copy of the offline redo log files that have already been archived and then delete these files.
· -ss|-double_save
Archive the offline redo logs to two backup devices (tape devices) in parallel.
· -ssd|-double_save_delete
Archive the offline redo logs to two backup devices (tape devices) in parallel and then delete the files.
· -cs|-copy_save
Create a second copy of offline redo log files that have already been archived and then archive the newly created offline redo log files.
· -cds|-copy_delete_save
Create a second copy of offline redo log files which were already archived. These are then deleted and archiving of the newly created offline redo log files is begun.
Another "easy" way could be to schedule a Job in windows with the following:
SQLPLUS /NOLOG
CONNECT / AS SYSDBA
ALTER DATABASE MOUNT STANDBY DATABASE UNTIL CANCEL;
AUTO
You have to put all this in a .cmd file for example job.cmd but in this case i don't how to do with the AUTO instruction.
Best Regards,
Erick Ilarraza
Hi,
"Does It apply the archive archive redologs infinitely until you get disconnected from the database? what happens if the aren't more archive redolog to apply? it wait until there is a new one?"
Yes it applies archive redologs infinitely. The connection is also not required. You can disconnect from the SQL session. It waits for new archive redologs to be available, as soon as it receives new archive redologs it applies to the standby database. You do not have to take care of it.
But you have to configure Data Guard for this feature. Have you configured it or not? If not then I can guide for it.
Hi Nisch, Keyur
Thanks a lot for your reply
I use the command brarchive -u / -s -d stage -c -n 10 <remote_host>
To copy the archive redolog files from the production server to the disaster recovery server.
Our database is in standby mode but we don't have Oracle Dataguard configured in our system, so we take the following way:
First I created an sql script:
CONNECT / AS SYSDBA
spool C:\Prueba\traza.log
RECOVER STANDBY DATABASE UNTIL CANCEL;
AUTO
spool off
exit
Them I created a .bat file with the following:
sqlplus /nolog @C:\Prueba\script.sql
To finish I scheduled a windows task to run 3 times a day.
This solution works well, but you have to care about the archive redolog manually, if they grow to much you can have an archiver stuck.
I would like to use a command like xcopy and del to copy / delete all the archive redolog that were applied or those for example with more than one week on the the system.
I forgot to comment something, in disaster recovery you have to "refresh" the following files too:
Develop files.
SAPDATA files.
sapmnt\trans files.
saploc\SID\SYS\global\ files.
saploc\SID\SYS\profile\ files.
So we edit / scheduled an .cmd file to run this commands after the previous Job using the windows task scheduler.
Best Regards,
Erick Ilarraza
Erick,
Have you setup up oracle dataguard and are you using oracle Net services to ship the files to DR and using RFC and MRP to do the recovery?
Or is it a manual DR setup and recovery is done manually either using SQL scripts or brarchive?
The database has to be mounted in standby mode to be able to perform the recovery. If brarchive command fails and SQL commands work, then script the SQL commands in batch file and schedule it to run from Windows scheduler.
Cheers,
Nisch
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.