- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Shutdown Oracle
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
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
тАО06-29-2008 08:08 AM
тАО06-29-2008 08:08 AM
Shutdown Oracle
I am trying to script an Oracle shutdown (10g on 11.23).. Here are the commands I would use just as the user to do so.
sql
Connect /as sysdba
Shutdown immediate;
Exit;
So I was planning on doing this from cron so I would su - user and then have that above in the script. Thing of it is when I try it the sql command never works? I can't seem to figure out where it is gettign the path from. I have checked the users .profile which then has a reference to another .profile and it kind of goes on and on. If the command works from the users prompt should it not work if the user is running it via script? Is it something to do with the su?
Thank you
Paul
su - user sql
ksh: sql: cannot open
su - user
sql
Works okay?
- Tags:
- Oracle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2008 09:22 AM
тАО06-29-2008 09:22 AM
Re: Shutdown Oracle
you must manipulate following script to run in HP-UX
http://www.oracle-base.com/articles/linux/AutomatingDatabaseStartupAndShutdownOnLinux.php
Best Regards
Murat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2008 11:01 AM
тАО06-29-2008 11:01 AM
Re: Shutdown Oracle
Remember that the environment for startup and shutdown scripts as well as the environment for a 'crontask', is very sparse. For instance, the PATH consists, by default, of only '/usr/sbin:/usr/bin:/sbin'.
There is never any harm in using absolute paths in your startup and cron'd scripts. You can easily find where your commands live with :
# whereis sql
(when the command is in your PATH; or):
# find / -type f -name sql
Your startup and shutdown script will be executed as root, so you will want to do something like:
# su - oracle -c "nohup ${ORACLE_HOME}/bin/dbshut &" > /dev/null 2>&
1
When a command works from a user's environment at commandline but not as a part of a 'crontab' or startup/shutdown script, generally something is missing from the environment. Using 'su - username' as shown cause the users' login profile to be sourced (read). This is one way to populate the necessary environmental variables. Another way is to simply declare what you need or source an independent file of variables in your script.
If you run:
# env
...after you login as the working user at commandline, you will see the environment that works.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2008 01:25 PM
тАО06-29-2008 01:25 PM
Re: Shutdown Oracle
$ whereis sql
sql:
$ echo $sql
$
I have tried doing a find but still can not find anything that result in the sql> prompt.
As for the env it is not much help as it seems there are about 1000 entries. Even searching the results for sql show nothing.
I have heard it is better to shutdown oracle from within sql then to use the shutdb start db scripts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2008 02:21 PM
тАО06-29-2008 02:21 PM
Re: Shutdown Oracle
> I have tried doing a find but still can not find anything that result in the sql> prompt.
I believe that you want 'sqlplus'. Make sure, too, that the ${ORACLE_SID} environment variable is set.
> I have heard it is better to shutdown oracle from within sql then to use the shutdb start db scripts?
This is a database, not a language question.
Regards!
...JRF...