Home » Server Options » Data Guard » Dataguard - How to Manually Apply Archive Logs
Dataguard - How to Manually Apply Archive Logs [message #148893] Mon, 28 November 2005 23:16 Go to next message
reachriah
Messages: 5
Registered: November 2005
Junior Member

hi all,
i have the following scenario with Oracle 10g DataGuard database....
All the archive log files from the primary are moved to standby. One of my tasks, is to make sure that the moved log files will not get applied immediately to the standby database.....
My question is in what mode should I keep the standby database for the above to work.
Next is, I need to write a shell script to apply the archive log files to standby database..... by running the script at specific intervals.... I am wondering if anyone has a script to do this..........

I need to get this done in a day span .......its very urgent....

Please post your shell script here .......


thanks in adv.
Re: Dataguard - How to Manually Apply Archive Logs [message #148964 is a reply to message #148893] Tue, 29 November 2005 04:55 Go to previous messageGo to next message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member
I am not an Data guard expert but i can help you in the logic.
( Assuming it as physical standby database)

-->>what mode should I keep the standby database ??

If you keep a standby database in Read Only mode then it will not apply archivals.

From Docs
Quote:

While a standby database is open for read-only or read/write access, it does not apply redo data received from the primary database, thus it is not kept transactionally consistent with the primary database.
When a physical standby database is open, redo data from the primary database is received by the standby database, but the log files are not applied. At some point, you need to resume Redo Apply on the standby database, and apply the archived redo log files to resynchronize the standby database with the primary database.Because of the additional time required to apply any accumulated archived redo log files, having a standby database open for read-only access can increase the time required to complete failovers or switchovers.


So just keep your standy database in Read only mode ,again from docs
Quote:

To open a standby database for read-only access when it is currently performing Redo Apply:

1. Cancel Redo Apply:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
2. Open the database for read-only access:
SQL> ALTER DATABASE OPEN;
You do not need to shut down the instance to open it for read-only access.

To change the standby database from being open for read-only access to performing Redo Apply:
1. Terminate all active user sessions on the standby database if there.
2. Restart Redo Apply. To start Redo Apply, issue the following statement:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

To enable real-time apply, include the USING CURRENT LOGFILE clause:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE;

You do not need to shut down the instance to start either of these apply modes


The above is just an excerpt from the docs, read the docs properly before implementing.

-->>I need to write a shell script to apply the archive log files to standby database..... by running the script at specific intervals ?

Create two shell scripts that solve your purpose for instance switch_1.sh and switch2.sh.

Now schedule their execution by using UNIX's Crontab command.

-->>Please post your shell script here .......

When i need it then i wil write those shell scripts, Razz .

But i think the above information is enough to do what you want but yes, you need to do some reading for unix Crontab and Standby docs.

Regards,
tarun

[Updated on: Tue, 29 November 2005 04:58]

Report message to a moderator

Re: Dataguard - How to Manually Apply Archive Logs [message #152632 is a reply to message #148893] Sun, 25 December 2005 15:43 Go to previous message
sharan alva
Messages: 57
Registered: November 1999
Member
Hi,
Do you plan to apply the logs on the standby after a certain period of time so that the standby is behind the primary. ? Also do you keep the standby in read only mode to run reports etc ?

You can use the DELAY attribute of the log_archive_dest_n on the primary to specify the delay time in minutes. This parameter will cause the delay after the log is shipped to the standby, note - the logs gets shipped immediately but applied only after the expiry of the delay specified.

So you can keep the standby in managed recovery mode and it will apply the logs after the delay

Thanks
Previous Topic: constraint violation during SQL apply
Next Topic: Primay & Standby on Different DB versions & OS
Goto Forum:
  


Current Time: Thu Mar 28 12:19:18 CDT 2024