[crsusr@rwsaa194 oastoltp5]$ cat checkpdbstatus.sh
#!sh
# Call checkdbstatus.sql
echo "oracle_dba::$oracle_dba oracle_dba_password::$oracle_dba_password TWO_TASK::$TWO_TASK ORACLE_SID::$ORACLE_SID"
echo "TNS_ADMIN::$TNS_ADMIN PATH::$PATH"
echo "PATH::$PATH"
#$SEQLPLUS $oracle_dba/$oracle_dba_password @checkdbstatus > junk 2>&1
#not_open_insts=`$SEQLPLUS -s $oracle_dba/$oracle_dba_password @checkdbstatus`
not_open_insts=`$SEQLPLUS -s $connect_initate_string <<EOF
${SYS_CONNECTION_STRING}
set pagesize 0 heading off echo off termout off feedback off linesize 1200 colsep "," trimspool on trimout on;
select count(*) from gv\\$pdbs where open_mode != 'READ WRITE' and name=upper('$PDB_CURR');
quit ;
EOF`
echo "not open insts::$not_open_insts"
if [ $not_open_insts -gt 0 ]; then
exit 1;
else
exit 0;
fi
#
#if test $? -ne 0
#then
# exit 1;
#else
# exit 0;
#fi
检查pdb状态的一个脚本
最新推荐文章于 2024-04-18 05:24:26 发布