- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Oracle instance won't shut down
Operating System - HP-UX
1752596
Members
5000
Online
108788
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО11-21-2000 09:39 AM
тАО11-21-2000 09:39 AM
Oracle instance won't shut down
I have a problem with the full backup of our Oracle production database on our HP9000 K370 under HP-UX 11.00
From root-crontab a fbackup job is scheduled in a script. In this script a shutdown script is invoked with su - oracle -c.
The default oracle account is tied to our test-database (ORACLE_SID=C2K) so it has to be switched to the production database, which is C2P. The guys who installed our Oracle (and who wrote the script) use the export command. However, the Oracle-account uses de csh-shell which does not support the export command. Therefore, the command svrmgrl and shutdown will only shut down the test-database, not the production database. As far as I can see, the script as given below therefore has never worked. What can I do to solve this problem. I'm not a Oracle-DBA so I have to be a bit careful here..
Script:
-----------------------
#!/bin/sh
export ORACLE_HOME=/disk01/app/oracle/product/8.0.5
export ORACLE_SID=C2P
svrmgrl < connect internal
shutdown abort
startup
shutdown immediate
EOF
lsnrctl < stop
EOF2
---------------------------
From root-crontab a fbackup job is scheduled in a script. In this script a shutdown script is invoked with su - oracle -c.
The default oracle account is tied to our test-database (ORACLE_SID=C2K) so it has to be switched to the production database, which is C2P. The guys who installed our Oracle (and who wrote the script) use the export command. However, the Oracle-account uses de csh-shell which does not support the export command. Therefore, the command svrmgrl and shutdown will only shut down the test-database, not the production database. As far as I can see, the script as given below therefore has never worked. What can I do to solve this problem. I'm not a Oracle-DBA so I have to be a bit careful here..
Script:
-----------------------
#!/bin/sh
export ORACLE_HOME=/disk01/app/oracle/product/8.0.5
export ORACLE_SID=C2P
svrmgrl <
shutdown abort
startup
shutdown immediate
EOF
lsnrctl <
EOF2
---------------------------
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2000 10:16 AM
тАО11-21-2000 10:16 AM
Re: Oracle instance won't shut down
Hi Maarten,
As you have started your script with '#!...' I suggest that you change su - oracle -c '...' to su oracle -c '...'
This will not invoke the C shell at all.
Within the script itself, you need to add $ORACLE_HOME/bin to PATH. A tip that I would suggest here is to have some sort of 'ora_env' script that sets the Oracle environment according to /etc/oratab. This makes it much easier to upgrade a database, rather than check and change lots of scripts that have ORACLE_HOME etc coded in them you simply have to edit /etc/oratab. Oracle supply one which normally gets put in /usr/local/bin but I prefer to write my own : 'ora_env':-
export ORACLE_SID=${1:-XXXX}
ORAINFO=$(grep "^${ORACLE_SID}:" /etc/oratab 2>/dev/null)
if [[ -n ${ORAINFO} ]];
then ORAINFO=${ORAINFO%%\#*}
IFS=:
set ${ORAINFO}
unset IFS
export ORACLE_HOME=${2}
export PATH=${PATH}:${ORACLE_HOME}/bin
export SHLIB_PATH=$ORACLE_HOME/lib
else print "No info in /etc/oratab for SID ${ORACLE_SID}"
ORACLE_SID=""
fi
Code the following into your script to call it:
./ora_env
If you omit then it will default to XXXX, change that to whatever default you require.
I code the shutdown sequence as follows:-
shutdown immediate
monitor the svrmgrl process and if it hasn't completed in 5 minutes, kill it then
shutdown abort
startup restrict
shutdown
Regards,
John
As you have started your script with '#!...' I suggest that you change su - oracle -c '...' to su oracle -c '...'
This will not invoke the C shell at all.
Within the script itself, you need to add $ORACLE_HOME/bin to PATH. A tip that I would suggest here is to have some sort of 'ora_env' script that sets the Oracle environment according to /etc/oratab. This makes it much easier to upgrade a database, rather than check and change lots of scripts that have ORACLE_HOME etc coded in them you simply have to edit /etc/oratab. Oracle supply one which normally gets put in /usr/local/bin but I prefer to write my own : 'ora_env':-
export ORACLE_SID=${1:-XXXX}
ORAINFO=$(grep "^${ORACLE_SID}:" /etc/oratab 2>/dev/null)
if [[ -n ${ORAINFO} ]];
then ORAINFO=${ORAINFO%%\#*}
IFS=:
set ${ORAINFO}
unset IFS
export ORACLE_HOME=${2}
export PATH=${PATH}:${ORACLE_HOME}/bin
export SHLIB_PATH=$ORACLE_HOME/lib
else print "No info in /etc/oratab for SID ${ORACLE_SID}"
ORACLE_SID=""
fi
Code the following into your script to call it:
.
If you omit
I code the shutdown sequence as follows:-
shutdown immediate
monitor the svrmgrl process and if it hasn't completed in 5 minutes, kill it then
shutdown abort
startup restrict
shutdown
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2000 10:20 AM
тАО11-21-2000 10:20 AM
Re: Oracle instance won't shut down
Hi Maarten,
The script seems correct, so I wonder if there isnt something wrong with your ORACLE_HOME
Just thoughts
Best regards
Victor
The script seems correct, so I wonder if there isnt something wrong with your ORACLE_HOME
Just thoughts
Best regards
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2001 08:49 AM
тАО03-16-2001 08:49 AM
Re: Oracle instance won't shut down
Hi,
I saw the script these guys wrote. I hope you have good backups because they shoot down the database (shutdown abort). This is quite dangerous. Replace the shutdown abort by shutdown immediate, which does the same but is less dangerous.
Regards,
Dieter Degrendele
I saw the script these guys wrote. I hope you have good backups because they shoot down the database (shutdown abort). This is quite dangerous. Replace the shutdown abort by shutdown immediate, which does the same but is less dangerous.
Regards,
Dieter Degrendele
The possible we did, the unpossible we're doing but for a miracle you have to wait some time.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP