白天和黑夜只交替没交换无法想像对方的世界
分类: oracle
2013-06-19 16:07:12
配置data guard网络监听的时候,连接测试报错如下:
error:
ora-12514: tns:listener does not currently know of service requested in connect
descriptor
出错原因是由于,在修改init$oracle_sid.ora文件时,在主库里面新添加了一项db_unique_name=10gpri;
备库上新添加一项db_unique_name=10gstandby.
在配置监听文件和客户端tnsnames.ora时,就要修改global_dbname 成相应的10gpri或10standby.
[oracle@dg01 admin]$ cat listener.ora
listener =
(description_list =
(description =
(address_list =
(address = (protocol = tcp)(host = 172.21.1.30)(port = 1521))
)
)
)
sid_list_listener =
(sid_list =
(sid_desc =
(sid_name = plsextproc)
(oracle_home = /u01/oracle/product/10.2.0/db_1 )
(program = extproc)
)
(sid_desc =
(global_dbname = 10gpri)
(oracle_home = /u01/oracle/product/10.2.0/db_1)
(sid_name = dg01)
)
)
[oracle@dg01 admin]$ cat tnsnames.ora
10gpri=
(description =
(address = (protocol = tcp)(host = 172.21.1.30)(port = 1521))
(connect_data =
(server=dedicated)
(service_name = 10gpri)
)
)
10gstandby=
(description =
(address = (protocol = tcp)(host = 172.21.1.31)(port = 1521))
(connect_data =
(server=dedicated)
(service_name = 10gstandby)
)
)
在两个节点上测试如下:
节点dg01:
[oracle@dg01 dbs]$ sqlplus scott/tiger@10gstandby
sql*plus: release 10.2.0.1.0 - production on wed aug 24 03:29:28 2011
凯发app官方网站 copyright (c) 1982, 2005, oracle. all rights reserved.
connected to:
oracle database 10g enterprise edition release 10.2.0.1.0 - production
with the partitioning, olap and data mining options
scott_s:138_p:28085_10gstandby> show parameter name
name type value
------------------------------------ ----------- ------------------------------
db_file_name_convert string
db_name string dg01
db_unique_name string 10gstandby
global_names boolean false
instance_name string dg01
lock_name_space string
log_file_name_convert string
service_names string 10gstandby
节点dg02:
[oracle@dg02 dbs]$ sqlplus
sql*plus: release 10.2.0.1.0 - production on wed aug 24 03:29:28 2011
凯发app官方网站 copyright (c) 1982, 2005, oracle. all rights reserved.
connected to:
oracle database 10g enterprise edition release 10.2.0.1.0 - production
with the partitioning, olap and data mining options
scott_s:145_p:22710_10gpri> show parameter name
name type value
------------------------------------ ----------- ------------------------------
db_file_name_convert string
db_name string dg01
db_unique_name string 10gpri
global_names boolean false
instance_name string dg01
lock_name_space string
log_file_name_convert string
service_names string 10gpri