- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Running db admin scripts as root
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
тАО09-19-2003 11:19 AM
тАО09-19-2003 11:19 AM
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-19-2003 11:26 AM
тАО09-19-2003 11:26 AM
Solution/usr/bin/su - oracle -c "command"
Run out of root cron, this will run without a password prompt.
It is never a good idea to run databse scripts as root.
It can tie up shared memory resources, lock your database, all kinds of ugly things.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-19-2003 11:36 AM
тАО09-19-2003 11:36 AM
Re: Running db admin scripts as root
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-19-2003 11:44 AM
тАО09-19-2003 11:44 AM
Re: Running db admin scripts as root
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-19-2003 11:47 AM
тАО09-19-2003 11:47 AM
Re: Running db admin scripts as root
You're shameless!
;^)
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-19-2003 11:57 AM
тАО09-19-2003 11:57 AM
Re: Running db admin scripts as root
/usr/bin/su - oracle -c "command"
rather than
/usr/bin/su oracle -c "command".
I know that you want to load Oracle's environment var's (ORACLE_HOME,ORACLE_SID,..) but the problem is that oracle's .profile contains statements like tset, tabs, tput ... which expect an interactive environment --- which you ain't. You can surround all those with
if [ -t 0 ]
then
tset
stty
tabs
fi
but a better way is to create a file (oraenv.sh) that sets and exports all those variables and then let your script AND oracle's .profile source this file.
e.g.
. /usr/local/bin/oraenv.sh
This will ensure that the environment is setup but not hang because no interactive environment is in play. Your oraenv.sh must not contain an exit or return statement because this would actually exit the shell because sourced files are not started as a separate process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-19-2003 12:05 PM
тАО09-19-2003 12:05 PM
Re: Running db admin scripts as root
My solution assumes that the oracle environment is correct.
The script called by the command section needs to call the correct oracle environment for the database to be used. ORACLE_HOME, ORACLE_SID and other required variables MUST be set or the script will fail.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com