用Solaris 10中的SMF管理Oracle数据库的运行( 二 )


project='oracle'
resource_pool=':default'>
user='oracle'
group='dba'
supp_groups=':default'
privileges=':default'
limit_privileges=':default'/>






在上面的配置文件中,必须更改的项目有
ORACLE_HOME
ORACLE_SID
User(一般就是oracle)
Group(一般就是dba组)
Project(项目是Solaris的另一种资源管理方式,如果没有创建oracle的project,要通过运行projadd -U oracle -G dba oracle添加)
Working Directory (Oracle的工作目录,即oarcle用户的工作目录)
Instance name (实例名要和ORACLE_SID名称相同或者相应的LISTENER侦听器名称相同)
3. 将修改后的*.xml重新倒入到SMF控制中,每次修改xml后都要重复这一步骤:
#svccfgimport/var/svc/manifest/application/database/oracle-database-instance.xml
#svccfgimport/var/svc/manifest/application/database/oracle-listener-instance.xml
4. 通过svCADm启用oracle数据库服务和Oracle侦听服务:
#svcadmenablesvc:/application/oracle/database:mesodst
#svcadmenablesvc:/application/oracle/listener:MESODST_LISTENER
命令启用了实例名称为mesDost的oracle数据库和侦听器名称为MESODST_LISTENER的服务了 。这些服务的日志文件可以到/var/svc/log目录中找到,例如:
cvpdbviq02oraclemesodst$pwd
【用Solaris 10中的SMF管理Oracle数据库的运行】/var/svc/log
cvpdbviq02oraclemesodst$ls-l*oracle*
-rw-r--r-- 1rootroot1390Sep2916:11application-oracle-database:mesodst.log
-rw-r--r-- 1rootroot2647Sep2916:10application-oracle-listener:MESODST_LISTENER.log
cvpdbviq02oraclemesodst$catapplication-oracle-database:mesodst.log
[Sep2916:08:14Leavingmaintenancebecausedisablerequested.]
[Sep2916:08:14Disabled.]
[Sep2916:08:25Rereadingconfiguration.]
[Sep2916:08:43Enabled.]
[Sep2916:08:43Executingstartmethod("/lib/svc/method/ora-smfstartdatabasemesodst")]
Connectedtoanidleinstance.
ORACLEinstancestarted.
TotalSystemGlobalArea 841974576bytes
FixedSize 729904bytes
VariableSize419430400bytes
DatabaseBuffers 419430400bytes
RedoBuffers2383872bytes
Databasemounted.
Databaseopened.
databasemesodstisOPEN.
[Sep2916:08:52Method"start"exitedwithstatus0]
[Sep2916:09:48Stoppingbecauseservicedisabled.]
[Sep2916:09:49Executingstopmethod("/lib/svc/method/ora-smfstopdatabasemesodst")]
Databaseclosed.
Databasedismounted.
ORACLEinstanceshutdown.
[Sep2916:09:57Method"stop"exitedwithstatus0]
[Sep2916:10:40Enabled.]
[Sep2916:10:46Rereadingconfiguration.]
[Sep2916:10:55Executingstartmethod("/lib/svc/method/ora-smfstartdatabasemesodst")]
Connectedtoanidleinstance.
ORACLEinstancestarted.
TotalSystemGlobalArea 841974576bytes
FixedSize 729904bytes
VariableSize419430400bytes
DatabaseBuffers 419430400bytes
RedoBuffers2383872bytes
Databasemounted.
Databaseopened.
databasemesodstisOPEN.
[Sep2916:11:07Method"start"exitedwithstatus0]
cvpdbviq02oraclemesodst$
从日志文件可见Oracle数据库已经成功运行了,还可以看到,启动Oracle数据库的是/lib/svc/method/ora-smfstartdatabasemesodst命令,如果从log中看到启动错误,可以先运行这条命令确认oracle可以顺利启动,再排查其他问题 。

推荐阅读