![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SuperUser | maconte | UNIX for Dummies Questions & Answers | 0 | 03-19-2007 01:36 PM |
| runing a script as superuser | bcheaib | UNIX for Dummies Questions & Answers | 2 | 07-07-2004 01:24 AM |
| how to check my hard disk is below 10%, and then send mail to superuser | foong | Shell Programming and Scripting | 3 | 08-07-2003 11:28 AM |
| No user able to login except root(superuser) | konda | UNIX for Advanced & Expert Users | 2 | 06-25-2002 12:19 PM |
| superuser password change | apalex | UNIX for Dummies Questions & Answers | 4 | 04-12-2002 11:38 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
to run sql as superuser
hi All,
In my script I want to run some drop and select statements in the same host as a different user.I am inputting password for the superuser from the user who will be executing the script. ie , Quote:
|
|
||||
|
Imagine big bold letters here: Don't Do That.
Simply run su - user -c "commands" and su will take care of prompting for the password. Reading the root password in a userspace script is not recommended. |
|
||||
|
Hi ,
Thanks a lot for your reply. Can you pls site an example also? I tried reproducing the command but failed. I was actually trying... Code:
su - user1 -c "echo 'user123'" sleep 10 sqlplus "/as systemdba" select name from v$database; <<+ENDOFSQL+ exit +ENDOFSQL+ exit The password expected is not root password. |
|
||||
|
You said "superuser password", I assumed root password.
The idea would be 'su - user1 "commands to connect to sql"' -- if it's a long script then just put that in a file and execute that file. |
| Sponsored Links | ||
|
|