- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- startup/shutdown script for oracle 8i database
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2002 03:47 AM
тАО04-23-2002 03:47 AM
startup/shutdown script for oracle 8i database
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2002 03:57 AM
тАО04-23-2002 03:57 AM
Re: startup/shutdown script for oracle 8i database
can't you use the normal start/stop script which should be installed in /sbin/init.d/oracle?
I think if that this should produce the least problems. Just use cron to start/stop oracle with this script and redirect the output (STDOUT/STDERR) to a file or /dev/null
Hope this helps
Regards Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2002 04:04 AM
тАО04-23-2002 04:04 AM
Re: startup/shutdown script for oracle 8i database
It's my script for shutdown and startup db.
I have 2 instances of Oracle on my server and
necessary for me to switch oracle environment.
Look these file:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2002 04:14 AM
тАО04-23-2002 04:14 AM
Re: startup/shutdown script for oracle 8i database
0 0 * * * su -oracle -c dbshut
0 6 * * * su -oracle -c dbstart
It's been a while since I used oracle, but I recall Oralce supply scripts to do this. You'll just need the full path to dbshut and dbstart in roots crontab.
cd $ORACLE_HOME
find . -name dbshut
find . -name dbstart
On AIX they are in
/u01/app/oracle/product/8.0.4/bin
I imagine you'll find them in a similar place.
Therefore the crontab entry would be this :-
0 0 * * * su -oracle -c /u01/app/oracle/product/8.0.4/bin/dbshut
0 6 * * * su -oracle -c /u01/app/oracle/product/8.0.4/bin/dbstart
HTH
Dave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2002 04:27 AM
тАО04-23-2002 04:27 AM
Re: startup/shutdown script for oracle 8i database
Put this in the crontab to run say 10 minutes after dbshut. If you want to do a backup, make sure it starts after dbabort has completed.
Dave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2002 04:46 AM
тАО04-23-2002 04:46 AM
Re: startup/shutdown script for oracle 8i database
First you'll have to get inplace the automatic startup script for starting oracle when startup of server:
Update /etc/oratab with SID:ORACLE_HOME:Y line for your database.
Put inplace init.d script dbora:
/sbin/init.d/dbora:
---
#!/sbin/sh
# Start/stop of Oracle database
#
ORA_HOME=/oracle/product/8.1.7
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
start_msg)
echo "Start ORACLE databases"
;;
stop_msg)
echo "Stop ORACLE databases"
;;
'start')
# Start the oracle databases
/usr/bin/su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
;;
'stop')
# Stop the oracle databases
/usr/bin/su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
;;
esac
---
Create link to runlevel directories:
ln -s /sbin/init.d/dbora /sbin/rc0.d/K10dbora
ln -s /sbin/init.d/dbora /sbin/rc2.d/S99dbora
You might also want to edit the $ORACLE_HOME/bin/dbshut script to read "shutdown immediate" instead of "shutdown"
Then simply use this script in your crontab:
01 00 * * /sbin/init.d/dbora stop >/tmp/orashut.log 2>&1
00 06 * * /sbin/init.d/dbora start >/tmp/orastart.log 2>&1
Andreas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2002 04:54 AM
тАО04-23-2002 04:54 AM
Re: startup/shutdown script for oracle 8i database
HI David
Thanks for the info. I have two Oracle SIDs.
Will this process shutdown both?
Do I have to modify the dbabort(a copy of dbshut) inorder to shutdown if a user is still logged on?
If so, what do I have to change?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2002 06:11 AM
тАО04-23-2002 06:11 AM
Re: startup/shutdown script for oracle 8i database
dbstart, dbshut and dbabort will look at the 3rd field of /etc/oratab (location of oratab may be somewhere else). This field will be either Y or N. If set to Y then the scripts will act on these databases.
In dbabort you will need to change the shutdown bit from
connect internal
shutdown
EOF
to
connect internal
shutdown abort
startup
shutdown
EOF
Try it on a test database to make sure it works ok before putting it into live.
I'm not sure if you would be better off using something like not mounting the database when you restart it to keep the users from getting in after you've just cleaned up after them!
If in doubt check with Oracle support!
Remember that oratab may control whether the database starts at system boot. ie there may be an rc script than checks for this. Also check that no in house written scripts rely on oratab. You don't want to affect them!
HTH
Dave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2002 06:11 AM
тАО04-23-2002 06:11 AM
Re: startup/shutdown script for oracle 8i database
ps -ef|grep ora_reco|grep -v grep|awk '{print $9}'| cut -c 10- >givedb
for i in `cat givedb`
do
ORACLE_SID=$i
export ORACLE_SID
svrmgrl << !
connect internal;
shutdown immediate;
!
echo "database has been shutdown properly"
done
#vi startdb
for i in 'cat givedb'
do
svrmgrl << !
connect internal;
startup force;
!
lsnrctl start
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2002 05:29 AM
тАО04-24-2002 05:29 AM
Re: startup/shutdown script for oracle 8i database
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2002 05:30 AM
тАО04-24-2002 05:30 AM
Re: startup/shutdown script for oracle 8i database
Thanks,
Dave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2002 05:32 AM
тАО04-24-2002 05:32 AM
Re: startup/shutdown script for oracle 8i database
How did you get on?
Regards,
Dave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2002 11:00 AM
тАО04-24-2002 11:00 AM
Re: startup/shutdown script for oracle 8i database
svrmgrl <
connect internal
startup
--execute sys.dbms_shared_pool.keep('SYS.STANDARD', 'P');
--execute sys.dbms_shared_pool.keep('SYS.PLITBLM', 'P');
--execute sys.dbms_shared_pool.keep('SYS.DBMS_STANDARD', 'P');
--execute sys.dbms_shared_pool.keep('SYS.DBMS_SYS_SQL', 'P');
--execute sys.dbms_shared_pool.keep('SYS.DBMS_SQL', 'P');
--execute sys.dbms_shared_pool.keep('SYS.DBMS_DESCRIBE', 'P');
--execute sys.dbms_shared_pool.keep('SYS.DBMS_OUTPUT', 'P');
--execute sys.dbms_shared_pool.keep('SYS.DBMS_UTILITY', 'P');
--execute sys.dbms_shared_pool.keep('SYS.DBMS_APPLICATION_INFO', 'P');
--execute sys.dbms_shared_pool.keep('SYS.AUDSES$', 'Q');
exit
EOF
I have never seen these "--execute sys.dbms_???" statements. Are you overriding oracle shared_pool settings?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2002 12:09 PM
тАО05-01-2002 12:09 PM