1. 程式人生 > 資訊 >訊息稱高通下一代驍龍 898 旗艦芯約在本月底釋出,新機春節前後登場

訊息稱高通下一代驍龍 898 旗艦芯約在本月底釋出,新機春節前後登場

whether_primary={{whether_primary}}
if [ $whether_primary = "yes" ];then
    su - oracle <<EON
sqlplus -s / as sysdba <<EOF
    spool /tmp/oracle_abort.log
    set pages 0
    set head off
    set feed off
    set echo off
    shutdown abort
    spool off
    exit;
EOF
EON
    ERROR="ORA-"
    abort_result
=`cat /tmp/oracle_abort.log` a=$(echo $abort_result | grep "${ERROR}") if [[ "$a" != "" ]] then echo '<scriptResult>{"message":"abort database failed please go to /tmp/oracle_abort.log ","state":"failed","result":"False"}</scriptResult>' else su - oracle <<EON sqlplus
-s / as sysdba <<EOF spool /tmp/oracle_startup.log set pages 0 set head off set feed off set echo off startup spool off exit; EOF EON startup_result=`cat /tmp/oracle_startup.log` b=$(echo $startup_result | grep "${ERROR}") if [[ "$b" != "" ]] then echo
'<scriptResult>{"message":"startup mount database failed ,For more information, please go to /tmp/oracle_startup.log ","state":"failed","result":"False"}</scriptResult>' else rm -rf /tmp/oracle_*.log echo '<scriptResult>{"message":"","state":"success","result":"True"}</scriptResult>' fi fi else su - oracle <<EON sqlplus -s / as sysdba <<EOF spool /tmp/oracle_abort.log set pages 0 set head off set feed off set echo off shutdown abort spool off exit; EOF EON ERROR="ORA-" abort_result=`cat /tmp/oracle_abort.log` a=$(echo $abort_result | grep "${ERROR}") if [[ "$a" != "" ]] then echo '<scriptResult>{"message":"shutdown database failed ,For more information, please go to /tmp/oracle_abort.log ","state":"failed","result":"False"}</scriptResult>' else su - oracle <<EON sqlplus -s / as sysdba <<EOF spool /tmp/oracle_mount.log set pages 0 set head off set feed off set echo off startup mount spool off exit; EOF EON startup_result=`cat /tmp/oracle_mount.log` b=$(echo $startup_result | grep "${ERROR}") if [[ "$b" != "" ]] then echo '<scriptResult>{"message":"startup mount database failed ,For more information, please go to /tmp/oracle_mount.log ","state":"failed","result":"False"}</scriptResult>' else su - oracle <<EON sqlplus -s / as sysdba <<EOF spool /tmp/oracle_recover.log set pages 0 set head off set feed off set echo off alter database recover managed standby database finish; spool off exit; EOF EON recover_result=`cat /tmp/oracle_recover.log` c=$(echo $recover_result | grep "${ERROR}") if [[ "$c" != "" ]] then echo '<scriptResult>{"message":" alter database recover managed standby failed ,For more information, please go to /tmp/oracle_recover.log ","state":"failed","result":"False"}</scriptResult>' else su - oracle <<EON sqlplus -s / as sysdba <<EOF spool /tmp/oracle_switchover.log set pages 0 set head off set feed off set echo off alter database commit to switchover to primary; spool off exit; EOF EON switchover_result=`cat /tmp/oracle_switchover.log` d=$(echo $switchover_result | grep "${ERROR}") if [[ "$d" != "" ]] then echo echo '<scriptResult>{"message":" alter database commit to switchover to primary failed ,For more information, please go to /tmp/oracle_switchover.log ","state":"failed","result":"False"}</scriptResult>' else su - oracle <<EON sqlplus -s / as sysdba <<EOF alter database open; EOF lsnrctl stop lsnrctl start EON if [ $? -eq 0 ];then rm -rf /tmp/oracle_*.log echo '<scriptResult>{"message":"","state":"success","result":"True"}</scriptResult>' else echo '<scriptResult>{"message":' '"'"listen start failed"'"' ',"state":"failed","result":"False"}</scriptResult>' fi fi fi fi fi fi