Ok

En poursuivant votre navigation sur ce site, vous acceptez l'utilisation de cookies. Ces derniers assurent le bon fonctionnement de nos services. En savoir plus.

Dataguard - start and stop a standby database on server startup

Source : https://www.orafaq.com/forum/t/122395/

 

to start a standby database :

 

#!/bin/bash
ORA_HOME="/opt/oracle/920"
ORA_OWNER="oracle"
SQLCMD="sqlplus '/as sysdba'"
LOGFILE="strt.log"
cat startup.sql | su - $ORA_OWNER  -c "$SQLCMD" > $LOGFILE

 

to shutdown a standby database :

#!/bin/bash
ORA_HOME="/opt/oracle/920"
ORA_OWNER="oracle"
SQLCMD="sqlplus '/as sysdba'"
LOGFILE="sht.log"
cat shutdown.sql | su - $ORA_OWNER  -c "$SQLCMD" > $LOGFILE

 

startup.sql :

startup nomount;
alter database mount standby database;
alter database recover managed standby database disconnect from session;

 

shutdown.sql:

alter database recover managed standby database cancel;
shutdown immediate;
exit

 

Écrire un commentaire

Optionnel