楼主: wgz7747

关于对10g第二版service的理解

[复制链接]
论坛徽章:
6
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44生肖徽章2007版:鸡
日期:2008-01-02 17:35:532010新春纪念徽章
日期:2010-03-01 11:20:052011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282013年新春福章
日期:2013-02-25 14:51:24
11#
发表于 2007-8-8 17:15 | 只看该作者
I found the following errors when I tried to check the status of service with EM.
An error occurred when calling the SRVCTL utility on host: tst-rac01-ud-us-eqx. Ensure that CRS processes and
SRVCTL are functioning properly on this host. Refer to the following error:
Srvctl command: /opt/app/oracle/product/10.2.0/db_1/bin/srvctl status service
-d RTST -S 1 #@=info: operation={status} config={full} ver={10.2.0.0.0}
#@=service[0]: name={RTST1} enabled={true} pref={RTST1} avail={RTST2}
disabled_insts={} tafpolicy={none} type={user} Service name cannot be same as
the database default service name RTST

It said that my service name is same with the db_name.
my db_name is RTST and domain name is sun.net,
one of my services name is RTST.sun.net.Should I change my service name for this
error.But I found that the service name is same with db_name on my previous 9i
RAC and it is running well.

使用道具 举报

回复
论坛徽章:
6
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44生肖徽章2007版:鸡
日期:2008-01-02 17:35:532010新春纪念徽章
日期:2010-03-01 11:20:052011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282013年新春福章
日期:2013-02-25 14:51:24
12#
发表于 2007-8-8 17:16 | 只看该作者
SQL> show parameter service

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      RTST.sun.net

使用道具 举报

回复
论坛徽章:
6
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44生肖徽章2007版:鸡
日期:2008-01-02 17:35:532010新春纪念徽章
日期:2010-03-01 11:20:052011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282013年新春福章
日期:2013-02-25 14:51:24
13#
发表于 2007-8-8 17:18 | 只看该作者
there is no documents saying that I cant set the db_name same with the service_name..but in fact we cant in the real situation

使用道具 举报

回复
论坛徽章:
3
ITPUB元老
日期:2005-02-28 12:57:00授权会员
日期:2005-10-30 17:05:33ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41
14#
发表于 2007-8-9 01:49 | 只看该作者
最初由 henrybai 发布
[B]there is no documents saying that I cant set the db_name same with the service_name..but in fact we cant in the real situation [/B]


my db_name and service_name are same

service.jpg (40.57 KB, 下载次数: 7)

service.jpg

使用道具 举报

回复
论坛徽章:
124
生肖徽章:马
日期:2007-09-26 12:36:24生肖徽章:马
日期:2007-09-26 17:03:45生肖徽章:马
日期:2007-09-26 17:03:35生肖徽章:马
日期:2007-09-26 17:02:38生肖徽章:马
日期:2007-09-26 17:02:07生肖徽章:马
日期:2007-09-26 17:02:01生肖徽章:马
日期:2007-09-26 17:02:00生肖徽章:马
日期:2007-09-26 17:01:53生肖徽章:马
日期:2007-09-26 12:38:07生肖徽章:马
日期:2007-09-26 12:37:55
15#
发表于 2007-8-9 06:19 | 只看该作者
init file中的service_names可以高定为任何非 db_name的值。
并且 也可以在tnsnames.ora中设定service_name来连接
[php]
C:\Documents and Settings\Administrator>TNSPING VONGATES

TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 09-8月 -2007 06:15:07

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

已使用的参数文件:
C:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora


已使用 TNSNAMES 适配器来解析别名
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CO
NNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = VONGATES)))
OK (40 毫秒)

C:\Documents and Settings\Administrator>sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 8月 9 06:15:26 2007

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> conn system@vongates
输入口令:
已连接。
SQL> show user
USER 为 "SYSTEM"
SQL> show parameter service

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
service_names                        string
VONGATES
SQL> show parameter db_name

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
db_name                              string
orcl
SQL> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining options 断开

C:\Documents and Settings\Administrator>tnsping orcl

TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 09-8月 -2007 06:16:47

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

已使用的参数文件:
C:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora


已使用 TNSNAMES 适配器来解析别名
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CO
NNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
OK (190 毫秒)

C:\Documents and Settings\Administrator>sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 8月 9 06:16:55 2007

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> conn system@orcl
输入口令:
已连接。
SQL> show user
USER 为 "SYSTEM"
SQL> show parameter db_name

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
db_name                              string
orcl
SQL> show parameter service_name

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
service_names                        string
VONGATES
SQL>
--------------------------------

[/php]

使用道具 举报

回复
论坛徽章:
124
生肖徽章:马
日期:2007-09-26 12:36:24生肖徽章:马
日期:2007-09-26 17:03:45生肖徽章:马
日期:2007-09-26 17:03:35生肖徽章:马
日期:2007-09-26 17:02:38生肖徽章:马
日期:2007-09-26 17:02:07生肖徽章:马
日期:2007-09-26 17:02:01生肖徽章:马
日期:2007-09-26 17:02:00生肖徽章:马
日期:2007-09-26 17:01:53生肖徽章:马
日期:2007-09-26 12:38:07生肖徽章:马
日期:2007-09-26 12:37:55
16#
发表于 2007-8-9 06:21 | 只看该作者
我们在两次tnsping的tns是不一样的。不过差别只在service_name的值。
个人认为这个service_name为dg的环境提供了更大的灵活性。当然RAC也一样。

使用道具 举报

回复
论坛徽章:
124
生肖徽章:马
日期:2007-09-26 12:36:24生肖徽章:马
日期:2007-09-26 17:03:45生肖徽章:马
日期:2007-09-26 17:03:35生肖徽章:马
日期:2007-09-26 17:02:38生肖徽章:马
日期:2007-09-26 17:02:07生肖徽章:马
日期:2007-09-26 17:02:01生肖徽章:马
日期:2007-09-26 17:02:00生肖徽章:马
日期:2007-09-26 17:01:53生肖徽章:马
日期:2007-09-26 12:38:07生肖徽章:马
日期:2007-09-26 12:37:55
17#
发表于 2007-8-9 06:22 | 只看该作者
上面例子中的tns entry

[php]

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

vongates =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = VONGATES)
    )
  )
-----------------------
[/php]

使用道具 举报

回复
论坛徽章:
6
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44生肖徽章2007版:鸡
日期:2008-01-02 17:35:532010新春纪念徽章
日期:2010-03-01 11:20:052011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282013年新春福章
日期:2013-02-25 14:51:24
18#
发表于 2007-8-9 11:11 | 只看该作者
最初由 linzhan 发布
[B]

my db_name and service_name are same [/B]

你的domain_name设置了么。若设置了这个则数据库名为全局名字,service name 不是全局的名字,所以你的这种情况和我的不一样。
怀疑是BUG。

使用道具 举报

回复
论坛徽章:
6
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44生肖徽章2007版:鸡
日期:2008-01-02 17:35:532010新春纪念徽章
日期:2010-03-01 11:20:052011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282013年新春福章
日期:2013-02-25 14:51:24
19#
发表于 2007-8-9 11:12 | 只看该作者
I manually started the services RTST1 and RTST2 and remove the RTST service from crs
$ srvctl start service -d RTST -s RTST1
$ srvctl start service -d RTST -s RTST2

$ crs_unregister ora.RTST.RTST.RTST1.srv
$ crs_unregister ora.RTST.RTST.RTST2.srv
$ crs_unregister ora.RTST.RTST.cs
$ crs_stat -t
Name           Type           Target    State     Host      
------------------------------------------------------------
ora....ST1.srv application    ONLINE    ONLINE    tst-...-eqx
ora....TST1.cs application    ONLINE    ONLINE    tst-...-eqx
ora....T1.inst application    ONLINE    ONLINE    tst-...-eqx
ora....ST2.srv application    ONLINE    ONLINE    tst-...-eqx
ora....TST2.cs application    ONLINE    ONLINE    tst-...-eqx
ora....T2.inst application    ONLINE    ONLINE    tst-...-eqx
ora.RTST.db    application    ONLINE    ONLINE    tst-...-eqx
ora....QX.lsnr application    ONLINE    ONLINE    tst-...-eqx
ora....eqx.ons application    ONLINE    ONLINE    tst-...-eqx
ora....eqx.vip application    ONLINE    ONLINE    tst-...-eqx
ora....QX.lsnr application    ONLINE    ONLINE    tst-...-eqx
ora....eqx.ons application    ONLINE    ONLINE    tst-...-eqx
ora....eqx.vip application    ONLINE    ONLINE    tst-...-eqx

BUT, EM and srvctl still complain about the service "RTST":

$ srvctl status service -d RTST
Service RTST1 is running on instance(s) RTST1
PRKO-2017 : Service RTST does not exist for database RTST.
Service RTST2 is running on instance(s) RTST2

I am unable to remove it vis srvctl or dbca
$ srvctl remove service -d RTST -s RTST -f
Service name cannot be same as the database default service name RTST

There is Metalink  Note:362645.1 for a similar issue...different version.

使用道具 举报

回复
论坛徽章:
6
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44生肖徽章2007版:鸡
日期:2008-01-02 17:35:532010新春纪念徽章
日期:2010-03-01 11:20:052011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282013年新春福章
日期:2013-02-25 14:51:24
20#
发表于 2007-8-9 11:13 | 只看该作者
Applies to:
Oracle Server - Enterprise Edition - Version: 10.2.0.2
This problem can occur on any platform.
Solaris 10
Oracle Clusterware 10.2.0.2.0
Automatic Storage Management (ASM) 10.2.0.2.0
RAC Database 10.2.0.2.0
Symptoms
You created a service with dbca during db creation time with same name as
database (RPAPP):
HA Resource Target State
----------- ------ -----
ora.RPAPP.RPAPP.RPAPP1.srv ONLINE ONLINE on uxrdb01
ora.RPAPP.RPAPP.RPAPP2.srv ONLINE ONLINE on uxrdb02
ora.RPAPP.RPAPP.cs OFFLINE ONLINE ONLINE on uxrdb01

Afterwards you noticed, that srvctl isn't able to manage this:
.
$ srvctl start service -d RPAPP
Service name cannot be same as the database default service name RPAPP
.
Trying to delete the service fails also:
$ srvctl remove service -d RPAPP -s RPAPP
PRKO-2120 : The internal database service RPAPP cannot be managed with srvctl.
.
Then you wanted to remove the service with DBCA. It raised a pop-up Window:
Failed to stop services "[RPAPP]" of cluster database "RPAPP","Service name cannot be the same
as the database default service name RPAPP".


Cause
The cause of this problem has been identified in internal Bug 4531124 "SERVICE APIS ALLOW DEFAULT DATABASE SERVICE TO BE MANAGED AS HA SERVICE.", which is duplicate of Bug 4171194 "PRKO-2120 - THE INTERNAL DATABASE SERVICE RAC CANNOT BE MANAGED WITH SRVCTL".
"PRKO-2120 - THE INTERNAL DATABASE SERVICE RAC CANNOT BE MANAGED WITH SRVCTL".
Bug 4171194 is fixed in 10.2, but due to internal Bug 4531124 it's still possible to create wrong service entry with dbca.
Solution

1. Stop Nodeapps

$ srvctl stop nodeapps -n uxrdb01
$ srvctl stop nodeapps -n uxrdb02

2. Stop CRS on BOTH nodes

# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.

3. Restore OCR from a  valid backup  (not containing the services)

# ocrconfig -restore /orabin/system/ocr/day.ocr

You can lookup http://download-west.oracle.com/ ... votocr.htm#i1016398 for details.


4. Start CRS again on BOTH nodes and check services

# crsctl start crs

$ $CRS_HOME/bin/crsstat
HA Resource Target State
----------- ------ -----
ora.uxrdb01.gsd ONLINE ONLINE on uxrdb01
ora.uxrdb01.ons ONLINE ONLINE on uxrdb01
ora.uxrdb01.vip ONLINE ONLINE on uxrdb01
ora.uxrdb02.gsd ONLINE ONLINE on uxrdb02
ora.uxrdb02.ons ONLINE ONLINE on uxrdb02
ora.uxrdb02.vip ONLINE ONLINE on uxrdb02

Backup restored was after CRS install and before DB Creation. Thus we need to add all other services manually.

5. Create listener service with netca

First we renamed "listener.ora" in $ORACLE_HOME/network/admin on both nodes.
Then we configured the listener with netca and afterwards the additional services are there:

$ $CRS_HOME/bin/crsstat | grep lsnr

HA Resource Target State
----------- ------ -----
ora.uxrdb01.LISTENER_UXRDB01.lsnr ONLINE ONLINE on uxrdb01
ora.uxrdb02.LISTENER_UXRDB02.lsnr ONLINE ONLINE on uxrdb02

6.  Adding ASM Services

$ srvctl add asm -n uxrdb01 -i +ASM1 -o /orabin/system/oracle/product/10.2/asm
$ srvctl add asm -n uxrdb02 -i +ASM2 -o /orabin/system/oracle/product/10.2/asm

7. Adding Database Services

$ srvctl add database -d RPAPP -o /orabin/system/oracle/product/10.2/db -p '+DATA/RPAPP/spfileRPAPP.ora'
$ srvctl add instance -d RPAPP -i RPAPP1 -n uxrdb01
$ srvctl add instance -d RPAPP -i RPAPP2 -n uxrdb02
$ srvctl start database -d RPAPP

8. Modifying Database Instance Services to add ASM dependency

Verified Instance Service and discovered, ASM dependency is missing in "REQUIRED_RESOURCES":

$ $CRS_HOME/bin/crs_stat -p ora.RPAPP.RPAPP1.inst
NAME=ora.RPAPP.RPAPP1.inst
...
REQUIRED_RESOURCES=ora.uxrdb01.vip

$ srvctl modify instance -d RPAPP -i RPAPP1 -s +ASM1
$ srvctl modify instance -d RPAPP -i RPAPP2 -s +ASM2

Afterwards the dependency exists:

$ $CRS_HOME/bin/crs_stat -p ora.RPAPP.RPAPP1.inst
NAME=ora.RPAPP.RPAPP1.inst
...
REQUIRED_RESOURCES=ora.uxrdb01.vip ora.uxrdb01.ASM1.asm

This dependency was missing, because we added instance with srvctl and not with DBCA,
which does this internally.

WARNING ! Steps 5-8 are only necessary, if you don't have a backup from before creating DB Services.
In our case our backup was from time after CRS install and before DB creation.

9. Verify if DBCA is able to add/delete services

It was possible to add a service named "RPSRV" and cleanly remove it again with DBCA.

10. Reboot Nodes and verify everything is started automatically

This also worked fine.
References
Errors
PRKO-2120

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表