- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- root, oracle,rdbms and sqlplus
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
тАО07-31-2003 10:23 AM
тАО07-31-2003 10:23 AM
root, oracle,rdbms and sqlplus
su oracle -c /../../..sqlplus sess.sql ....
I get sqlplus not found even after setting path etc.....
PATH=$PATH;/opt/oracle/8.1.7/bin/;.
ORACLE_SID=$1
ORACLE_SCRIPT=/opt/oracle/admin/script
ORACLE_HOME=/opt/oracle/8.1.7
export ORACLE_SID
export ORACLE_HOME
export SESSLOC=/opt/oracle/admin/script/sess.sql
export SQL=/opt/oracle/admin/script/sqlplus.sh
SES=`su oracle "$SQL system $SESSLOC |grep rows |cut -d " " -f 1"`
echo "The number of active sessions is $SES"
Any ideas? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2003 10:28 AM
тАО07-31-2003 10:28 AM
Re: root, oracle,rdbms and sqlplus
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2003 10:29 AM
тАО07-31-2003 10:29 AM
Re: root, oracle,rdbms and sqlplus
the "-" tells su to execute the login environment.
This helps (no hope needed !)
Volker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2003 02:03 PM
тАО07-31-2003 02:03 PM
Re: root, oracle,rdbms and sqlplus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2003 02:15 PM
тАО07-31-2003 02:15 PM
Re: root, oracle,rdbms and sqlplus
if [[ -t 0 ]]
then
...
...
fi
The better way is to create a file (e.g. /usr/local/bin/oraenv.sh) and let your script and oracle's .profile source it via
. /usr/local/bin/oraenv.sh
This will insure that both your scripts and oracle's .profile will use exactly the same environment. NOTE: This sources file must not contain an exit or return statement.
Your specific problem is that you used semicolons rather than colons in the construction of your PATH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2003 03:16 PM
тАО07-31-2003 03:16 PM
Re: root, oracle,rdbms and sqlplus
oracle database script:
if [ "$LOGNAME" = "root" ]
then
echo "User root shells to oracle"
/usr/bin/su - oracle -c "/usr/contrib/bin/shut.oracle"
exit 1
fi