2014-09-25 63 views
0

我有一個帶有節點的oracle數據警衛設置 - 一個是主節點,另一個是物理備用節點。我也已經配置了數據保護代理。ORA-12514:TNS:偵聽器當前不知道在使用數據保護代理進行切換時在連接描述符中請求的服務

問題是當我試圖切換,我只是得到上述錯誤。在使用DGMGRL(數據保護代理)的切換過程中,它成功完成切換作業,但無法在切換後啓動satndby數據庫。我必須手動啓動並掛載備用數據庫。

我也檢查了tnsnames.ora中的tnsping和服務名稱是正確的。 內容tnsnames.ora文件是:

PRI = 
    (DESCRIPTION = 
     (ADDRESS = (PROTOCOL = TCP)(HOST = vcslx502-rana-vm1)(PORT = 1521)) 
     (CONNECT_DATA = 
     (SERVER = DEDICATED) 
     (SERVICE_NAME = pri) 
    ) 
    ) 


STBY = 
    (DESCRIPTION= 
     (ADDRESS = (PROTOCOL = TCP) (HOST = vcslx502-rana-vm2) (PORT = 1521)) 
     (CONNECT_DATA = 
      (SERVER = DEDICATED) 
      (SERVICE_NAME = stby) 
     ) 
    ) 

和服務名稱的查詢結果如下: 小學:

SQL> select value from v$parameter where name='service_names'; 

VALUE 
-------------------------------------------------------------------------------- 
pri 

,並在待機:

SQL> select value from v$parameter where name='service_names'; 

VALUE 
-------------------------------------------------------------------------------- 
stby 

我還檢查了服務,發現這兩個服務都在運行。下面是這個結果...... 小學:

[[email protected] admin]$ lsnrctl services 

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 24-SEP-2014 11:45:15 

Copyright (c) 1991, 2013, Oracle. All rights reserved. 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) 
Services Summary... 
Service "pri" has 2 instance(s). 
    Instance "pri", status UNKNOWN, has 1 handler(s) for this service... 
    Handler(s): 
     "DEDICATED" established:0 refused:0 
     LOCAL SERVER 
    Instance "pri", status READY, has 1 handler(s) for this service... 
    Handler(s): 
     "DEDICATED" established:1 refused:0 state:ready 
     LOCAL SERVER 
Service "priXDB" has 1 instance(s). 
    Instance "pri", status READY, has 1 handler(s) for this service... 
    Handler(s): 
     "D000" established:0 refused:0 current:0 max:1022 state:ready 
     DISPATCHER <machine: vcslx502-rana-vm1, pid: 29432> 
     (ADDRESS=(PROTOCOL=tcp)(HOST=vcslx502-rana-vm1)(PORT=28706)) 
Service "pri_DGB" has 1 instance(s). 
    Instance "pri", status READY, has 1 handler(s) for this service... 
    Handler(s): 
     "DEDICATED" established:1 refused:0 state:ready 
     LOCAL SERVER 
The command completed successfully 

,並在待機:

[[email protected] admin]$ lsnrctl services 

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 24-SEP-2014 11:40:30 

Copyright (c) 1991, 2013, Oracle. All rights reserved. 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) 
Services Summary... 
Service "stby" has 2 instance(s). 
    Instance "stby", status UNKNOWN, has 1 handler(s) for this service... 
    Handler(s): 
     "DEDICATED" established:0 refused:0 
     LOCAL SERVER 
    Instance "stby", status READY, has 1 handler(s) for this service... 
    Handler(s): 
     "DEDICATED" established:1 refused:0 state:ready 
     LOCAL SERVER 
Service "stby_DGB" has 1 instance(s). 
    Instance "stby", status READY, has 1 handler(s) for this service... 
    Handler(s): 
     "DEDICATED" established:1 refused:0 state:ready 
     LOCAL SERVER 
The command completed successfully 

能有人幫我,讓每一次每當我使用DGMGRL做切換,我不不得不啓動並掛載備用數據庫?

還有一件事,我可以通過運行所需的每個命令來手動執行切換過程,而不會出現任何此類錯誤。

感謝,林蛙

+1

此主題適用於http://dba.stackexchange.com/ – 2014-09-25 05:30:56

+0

okk ..我沒有意識到這一點。我在這裏看到了這樣的一些問題,這就是我發佈它的原因。 – Rana 2014-09-25 05:49:45

回答

0

listener.ora文件應該是這樣的:

<unique_name>_LISTENER = 
    (DESCRIPTION_LIST = 
    (DESCRIPTION = 
     (ADDRESS = (PROTOCOL = TCP)(HOST = <hostname>)(PORT = <port>)) 
    ) 
) 

SID_LIST_LISTENER = 
    (SID_LIST = 
    (SID_DESC = 
     (GLOBAL_DBNAME = <unique_name>_DGMGRL.<domain>) 
     (SID_NAME = <oracle_sid>) 
     (ORACLE_HOME = <oracle_home>) 
    ) 
) 

你可以找到它在數據庫中。在我的情況下,它們如下:

SQL> select name as parameter,value from v$parameter 
     where name in ('service_names','db_domain','db_unique_name'); 

PARAMETER  VALUE 
--------------- -------------------- 
db_domain  rgolovko.com 
service_names RGTST.rgolovko.com 
db_unique_name RGTST 

後,我已經添加了域名的數據庫監聽器和SERVICE_NAME 的DataGuard的正確執行切換。

+0

是的,你是對的。我嘗試在listener.ora中添加域名,但在我的情況下,我沒有獲得成功,我不明白爲什麼。我通過更改數據庫的「StaticConnectIdentifier」屬性來獲得解決方案。我將此屬性中的「service_name」更改爲「servicename.localdomain」,並解決了上述問題。 – Rana 2015-01-06 07:24:03

相關問題