Hi ,
I am new to Linux Platform and I am looking for a .sh script to startup a database and start the lsnrctl.
Something like this
su - oracle
oracle>svrmgrl
connect internal
startup
exit (exit from svrmgrl)
root>lsnrctl start
Thanx
Kulkarni
Printable View
Hi ,
I am new to Linux Platform and I am looking for a .sh script to startup a database and start the lsnrctl.
Something like this
su - oracle
oracle>svrmgrl
connect internal
startup
exit (exit from svrmgrl)
root>lsnrctl start
Thanx
Kulkarni
If you look at the before you install manual for Linux there should be a section on getting databases to automatically startup. There should be a file in $ORACLE_HOME/bin called dbstart. It will look at the /var/optt/oracle/oratab file and determine which databases need to be started based on the third field.
sidname:/usr/oracle/9.2.0.2:Y
Then there is a diectory in /etc, I don't remember which one off hand but you basically create a symbolic link there. It is all spelled out in the manual which you should read before installing Oracle on a new platform anyway in case there is something that you should know or change.
Not used Linux but I will assume you have the same scripts as those on Solaris, if so you can use the $ORACLE_HOME/bin/dbstart and $ORACLE_HOME/bin/dbstop scripts to start and stop all the instances on the host.
Regards
hi thanx for the response I dont need auto start of the Database .. I want to manually start the database.
I want to use these commands
su - oracle
oracle>svrmgrl
connect internal
startup
exit (exit from svrmgrl)
root>lsnrctl start
but when I execute the script its stopping at
SVRMGR>
Can u tell me how to writethe .sh script?
Thanx
You'll need something similar to the following:
BTW there are 2 less-than symbols before the first EOF (post displays incorrectly if I add them here)Code:svrmgrl EOF
connect internal
startup
EOF
lsnrctl start
HTH
for 9i you can use something like the following in your startup.sh script
Code:sqlplus -s /NOLOG << ! >/dev/null
spool start.log
connect sys as sysdba
^M
startup
spool off
exit
!
Hi jovery,
Thanx for that .. i am able to use the script when i paste the same on the terminal window .. but when i save it as a shell script and execute it, its getting stopped after logging in as oracle.
and once i exit from the oracle user.. remaining commands are being executed.
su - oracle
svrmgrl << EOF
connect internal
startup
EOF
lsnrctl start
exit
exit
It's probaby waiting for a password, which user are you su'ing from?
Hi ,
I am su'ing from the root ..so it shudnt ask for the password.. when i am just pasting this script on the terminal it works..
Thanx
Is it waiting for a return? Amar's script has a ^M explicitly in it.