- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Creating wrapper for another user
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
Forums
Discussions
Discussions
Discussions
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
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
03-23-2006 06:40 PM
03-23-2006 06:40 PM
I have following problem:
I vreated a script for Oracle9i that just does a simple Select-Query. If I run it under user oracle, I have no problems. But it hast to be run by another tool as root. This is why I wrote a second script, that just does
su - oracle -c "oracle-script.pl"
But I get Error (here is a part from the output)
___________________________________________
SQL> Connected to an idle instance.
SQL> SELECT to_char(sysDATE,'DD-MON-YY HH24:MI:SS') Zeit FROM dual
*
ERROR at line 1:
ORA-01034: ORACLE not available
SQL> Disconnected
logout
---------------------------------------------
For me, he cannot find some ENV-Vars, but I set them all within the sciprt.
Do you have any idea how to solve this?
Regards!
Kalin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 06:55 PM
03-23-2006 06:55 PM
Re: Creating wrapper for another user
jsut before the sqlplus command is issued from the script, display all your env-vars with "env | grep -i oracle".
You should defioned have at least:
ORACLE_HOME
ORACLE_SID
Also is the database up and running?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 07:06 PM
03-23-2006 07:06 PM
Re: Creating wrapper for another user
Login as oracle user:
Oracle$ env > /tmp/oracle.env
Login as root user.
root#su - oracle -c "env > /tmp/root.env"
root#diff /tmp/oracle.env /tmp/root.env
will tell you the reason.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 07:07 PM
03-23-2006 07:07 PM
Re: Creating wrapper for another user
Database is up.
Under root the oracle-script itself says
SQL> SQL> ERROR:
ORA-01031: insufficient privileges
which is what u usually get if doing some queries under root.
But why didn't the wrapper worked, which calls the oracle script with user oracle, is a secret for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 07:26 PM
03-23-2006 07:26 PM
Re: Creating wrapper for another user
For some reason logging with su doesn't take the SID.
Is there a way for specifying environment variables in the same session opened from su?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 07:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 07:35 PM
03-23-2006 07:35 PM
Re: Creating wrapper for another user
where did you set the ORACLE_SID?
Within your script or oracle's .profile?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 07:42 PM
03-23-2006 07:42 PM
Re: Creating wrapper for another user
I tried setting it up from the oracle script, getting it as a call-parameter from the root-script, but no success.
But there must be a sollution. Until now I have found solutions for many crazy problems :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 07:45 PM
03-23-2006 07:45 PM
Re: Creating wrapper for another user
Instead of setting manually, try to set in .profile for oracle user.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 07:45 PM
03-23-2006 07:45 PM
Re: Creating wrapper for another user
Thanks to everyone!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 07:49 PM
03-23-2006 07:49 PM
Re: Creating wrapper for another user
I tested this on my machine:
su - oracle
grep ORACLE .profile
gave:
ORACLE_HOME=/u01/app/oracle/product/10g
export ORACLE_HOME
ORACLE_BASE=/u01/app/oracle/product
export ORACLE_BASE
PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/lib:.
ORACLE_SID=tpol
export ORACLE_SID
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/dt/lib:/usr/lib; export LD_LIBRARY_PATH
SHLIB_PATH=$ORACLE_HOME/lib:/usr/dt/lib:/usr/lib; export SHLIB_PATH
Then created in /tmp
a.sh
#!/usr/bin/sh
cd /tmp
sqlplus system/manager @a.sql
and a.sql
select sysdate from dual;
exit;
chmod 777 a.sh a.sql
exit back to root user
I can then call:
su - oracle -c "/tmp/a.sh"