-
Shell Script to startup a database
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
Sitaram 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
Jim
Oracle Certified Professional
"Build your reputation by helping other people build theirs."
"Sarcasm may be the lowest form of wit but its still funny"
Click HERE to vist my website!
-
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
Sitaram KUlkarni
-
You'll need something similar to the following:
Code:
svrmgrl EOF
connect internal
startup
EOF
lsnrctl start
BTW there are 2 less-than symbols before the first EOF (post displays incorrectly if I add them here)
HTH
Last edited by jovery; 04-11-2003 at 09:20 AM.
Jim
Oracle Certified Professional
"Build your reputation by helping other people build theirs."
"Sarcasm may be the lowest form of wit but its still funny"
Click HERE to vist my website!
-
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
!
Last edited by adewri; 04-11-2003 at 09:44 AM.
Amar
"There is a difference between knowing the path and walking the path."
-
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
Sitaram KUlkarni
-
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
Sitaram KUlkarni
-
Is it waiting for a return? Amar's script has a ^M explicitly in it.
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|