linux服务器开机启动oracle的设置方法
1、首先切换到Oracle用户
[oracle@oracletest~]$cd/u01/app/oracle/product/11.2.0/db_1/bin/-----标红字体部分数据库可能不一样,有的是dbhome_1,以自己实际配置目录为准 [oracle@oracletestbin]$vidbstart
LOGMSG="logger-puser.alert-s" trap'exit'123 #forscripttracing case$ORACLE_TRACEin T)set-x;; esac #Setpathifpathnotset(ifcalledfrom/etc/rc) SAVE_PATH=/bin:/usr/bin:/etc:${PATH};exportPATH SAVE_LLP=$LD_LIBRARY_PATH #FirstargumentisusedtobringupOracleNetListener ORACLE_HOME_LISTNER=$ORACLE_HOME############此处原来是$1,改成$ORACLE_HOME if[!$ORACLE_HOME_LISTNER];then echo"ORACLE_HOME_LISTNERisnotSET,unabletoauto-startOracleNetListener" echo"Usage:$0ORACLE_HOME" else LOG=$ORACLE_HOME_LISTNER/listener.log
2、用root用户编辑oratab和rc.local
[root@oracletest~]#vi/etc/oratab #ThisfileisusedbyORACLEutilities.Itiscreatedbyroot.sh #andupdatedbyeitherDatabaseConfigurationAssistantwhilecreating #adatabaseorASMConfigurationAssistantwhilecreatingASMinstance. #Acolon,':',isusedasthefieldterminator.Anewlineterminates #theentry.Linesbeginningwithapoundsign,'#',arecomments. # #Entriesareoftheform: #$ORACLE_SID:$ORACLE_HOME:: # #Thefirstandsecondfieldsarethesystemidentifierandhome #directoryofthedatabaserespectively.Thethirdfiledindicates #tothedbstartutilitythatthedatabaseshould,"Y",orshouldnot, #"N",bebroughtupatsystemboottime. # #Multipleentrieswiththesame$ORACLE_SIDarenotallowed. # # oadb:/u01/app/oracle/product/11.2.0/db_1:Y###此处原来是N,改为Y [root@oracletest~]#vi/etc/rc.d/rc.local #!/bin/sh # #Thisscriptwillbeexecuted*after*alltheotherinitscripts. #Youcanputyourowninitializationstuffinhereifyoudon't #wanttodothefullSysVstyleinitstuff. touch/var/lock/subsys/local #####在空白处添加下面两行,其中标红字体部分数据库可能不一样,有的是dbhome_1,以自己实际配置目录为准 suoracle-lc"/u01/app/oracle/product/11.2.0/db_1/bin/lsnrctlstart" suoracle-lc/u01/app/oracle/product/11.2.0/db_1/bin/dbstart
经过上面两步操作,数据库服务器重启后,数据库也会自动启动。
总结
以上所述是小编给大家介绍的linux服务器开机启动oracle的设置方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!
声明:本文内容来源于网络,版权归原作者所有,内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:czq8825#qq.com(发邮件时,请将#更换为@)进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。