Scripts to start the Dataguard after system reboot in Windows
Scripts to start the Dataguard Standby Server after Windows system reboot occurred.
When system window system reboot occurred then the DR site of dataguard environment not come up in recovery mode.
We get gap in between the physical and DR site.
Script to make the dataguard standby site start in recovery mode on every window restart.
1. Placed the given below scripts on folder as shown below:
Save the two files shown below in a folder script.
-- Save file as DGSTART.BAT
SQLPLUS SYS/PASSWORD AS SYSDBA @C:\SCRIPT\DGSTART.SQL > C:\SCRIPT\DBSTART.LOG
--Save file as DGSTART.SQL
ALTER DATABASE MOUNT;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS';
select sysdate from dual;
2. Schedules this script in Window Task Scheduler event “after startup”. Detailed steps as follows:
a. Open the task scheduler in windows and create basic task on it.
b. Select the Task Trigger –> When the Computer starts
c. Select the start a program.
d. Select your script by browser button and put location of script also in START IN(OPTIONAL) field.
e. Click on properties and press finish button.
f. Change the setting to RUN WHETHER USER IS LOGGED ON OR NOT.