- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Asking for user password while running a scrip...
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
тАО03-07-2007 04:38 PM
тАО03-07-2007 04:38 PM
#!/bin/sh
su -oracle
export ORACLE_HOME=/cramerapps/oracleAS
echo $ORACLE_HOME
export ORACLE_SID=asdb
lsnrctl start
sqlplus "sys/syspassword @ asdb as sysdba" <
exit
EOF
~
But after executing, the script will prompt for oracle password. How to skip the password prompt? How can i put the password into the script??
Solved! Go to Solution.
- Tags:
- su
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2007 04:47 PM
тАО03-07-2007 04:47 PM
Re: Asking for user password while running a script
http://www.orafaq.com/forum/t/37241/0/
http://www.adp-gmbh.ch/ora/misc/read_sql_from_shell_script.html
http://www.dbasupport.com/forums/archive/index.php/t-8424.html
http://www.unix.com/showthread.php?t=17437
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
тАО03-08-2007 03:53 AM
тАО03-08-2007 03:53 AM
Re: Asking for user password while running a script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2007 04:44 AM
тАО03-08-2007 04:44 AM
Re: Asking for user password while running a script
Who will be executing this script?
If root is running it then you don't need a password. If a non-root user is running the script then one of the option is to to setup sudo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2007 12:23 PM
тАО03-08-2007 12:23 PM
Re: Asking for user password while running a script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2007 06:38 PM
тАО03-08-2007 06:38 PM
SolutionFirstly OS password cannot be embedded in scripts,
Also if oracle user is (which I assume as oracle software owner and oracle db release >= 9i) script owner, then no
need to provide sys/syspasswd
U can do like this,
login as oracle
create ur script say Start_db_lsnr.sh as
!# /usr/bin/ksh
export ORACLE_HOME=/cramerapps/oracleAS
export ORACLE_SID=asdb
$ORACLE_HOME/bin/lsnrctl start
$ORACLE_HOME/bin/sqlplus "/as sysdba" <
exit
EOF
if root is invoking this script then use
# su - oracle -c
for any other user use sudo to give access for this script to
other users
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/sudo-1.6.8p12/
for this u have to configure /etc/sudoers using visudo command as root
# visudo
..
...
..
..
save and exit
now login as
sudo
- Santosh
- Tags:
- sudo