Starts managed recovery on all

It : Finds all running Oracle database instances (except ASM, MGMT, etc.) For each one : Connects as SYSDBA Starts Managed Standby Recovery This excludes :- +ASM → Oracle ASM instance Exadata → likely Exadata-related instances MGMT → management database the grep command itself

oraclebashhigh-availabilityv1.0.0
0 stars0 downloads31 views1 comments
By Mahmoud • Created

Code

(13 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
Vi sync.sh 

for i in `ps -ef |grep pmon |grep -v +ASM |grep -v exadata |grep -v MGMT |grep -v grep |awk -F "ora_pmon_" '{print $2}' |grep -v print`
do
export ORACLE_SID=$i
echo $ORACLE_HOME
echo $ORACLE_SID
$ORACLE_HOME/bin/sqlplus -s / as sysdba <<EOF
def
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
exit;
EOF
done

General Comments(0)

Tip: Click on a line number in the code to add a line-specific comment

No general comments yet. Be the first to comment!