.com Solutions Inc. - logo  
Products - Header Buttons
.
Repgen bullet item 7b Installgen bullet item 7b FmPro Migratorbullet item 7b CGIScripter
.
.
.

.
.

Installgen - sol901 - Title Graphic

Installgen Features and Benefits

Installgen Demo Available for download...

.

#!/bin/sh
# script: /etc/rc3.d/S81_prod1_standby_startup_script
# (renamed from 81_prod1_standby_startup_script_1)
# Features: This shell script runs during system startup/shutdown to startup
# the standby database instance in managed recovery mode or shutdown
# the instance.
#
# Usage: Configured as startup script in /etc/rc3.d/S81_prod1_standby_startup_script
# Configured as shutdown script in /etc/rc0.d/K81_prod1_standby_startup_script
# Copyright 2002 by .com Solutions Inc.
#
# ---------------------- Revision History ---------------
# Date By Changes
# 05-24-2002 dsimpson Initial Release

# This output file was created by Installgen version 1.38 on Sun Nov 10 14:51:56 2002. By .com Solutions Inc. www.dotcomsolutionsinc.net

# define globally used paths/variables
ORACLE_OWNER=oracle
ORACLE_OWNER_PATH=/export/oracle
ORACLE_GROUP=dba
ORACLE_HOME=/u01/v901
ORACLE_SID=prod1s
ORA_BDUMP_DIR=/u01/bdump
LD_LIBRARY_PATH=/u01/v901/lib:/u01/v901/lib64:/usr/dt/lib
PATH=/usr/sbin/:/bin:/usr/bin:/usr/ccs/bin:/usr/ucb/bin:/usr/ucb:/usr/openwin/bin:/usr/dt/bin:/usr/local/bin:/opt/bin:/usr/opt/SUNWmd/sbin:/usr/platform/sun4u/sbin:/opt/sfw/bin:.:/usr/local/sbin:/u01/v901/bin
NLS_LANG="AMERICAN_AMERICA.US7ASCII"

export ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH NLS_LANG

case "$1" in
'start')
# Rotate the Oracle alert error log before database starts
LOG=alert_$ORACLE_SID.log
cd $ORA_BDUMP_DIR
test -f $LOG.5 && mv $LOG.5 $LOG.6
test -f $LOG.4 && mv $LOG.4 $LOG.5
test -f $LOG.3 && mv $LOG.3 $LOG.4
test -f $LOG.2 && mv $LOG.2 $LOG.3
test -f $LOG.1 && mv $LOG.1 $LOG.2
test -f $LOG.0 && mv $LOG.0 $LOG.1
mv $LOG $LOG.0

echo 'Starting Oracle database...'
su - $ORACLE_OWNER -c '$ORACLE_HOME/bin/sqlplus /nolog' <set echo on
spool /opt/server_scripts/OracleStandbyStartupprod1s.log
connect / as sysdba
-- make sure instance is down first - it should not even be running so abort is OK
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SHUTDOWN ABORT
connect / as sysdba
STARTUP NOMOUNT pfile='/u01/v901/dbs/initprod1s.ora';
ALTER DATABASE MOUNT STANDBY DATABASE;
-- DELAY 0 for no delay
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DELAY 240 PARALLEL 8 DISCONNECT FROM SESSION;
SELECT process, status, thread#, sequence#, block#, blocks FROM v\$managed_standby;
spool off
exit;
EOF1
echo 'Started Oracle database in managed recovery mode.'

echo 'Starting Oracle Intelligent Agent...'
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/agentctl start"
echo 'Started Intelligent Agent.'

echo 'Starting Oracle listener...'
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
echo 'Started Listener.'

;;

'stop')
# stop in reverse order from startup process

echo 'Stopping Oracle Intelligent Agent'
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/agentctl stop"
echo 'Stopped Intelligent Agent.'

echo 'Stopping Oracle listener...'
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
echo 'Stopped Listener.'

echo 'Stopping Oracle databases...'
su - $ORACLE_OWNER -c '$ORACLE_HOME/bin/sqlplus /nolog' <set echo on
spool /opt/server_scripts/OracleStandbyStartupprod1s.log
set echo on
connect / as sysdba
SELECT process, status, thread#, sequence#, block#, blocks FROM v\$managed_standby;
-- shutdown the instance before the server goes down
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SHUTDOWN IMMEDIATE
spool off
exit;
EOF1
echo 'Stopped Oracle database.'

;;

*)
echo "usage: $0 start | stop"
echo "received: $1 on command line"
;;
esac


.

hline

. .

.

. .
 

Home | Products | Services | Downloads | Order | Support | Contact

Legal Notices

.
.   .
.
Home Products Services Downloads Order Support Contact