select dest_name,status,error from v$archive_dest  where rownum show..."/>
溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Dataguard 11.4 ORA-12154: TNS:could not resolve the connect identifier 處理

發(fā)布時(shí)間:2020-07-07 02:59:23 來源:網(wǎng)絡(luò) 閱讀:1201 作者:wangluochongzi 欄目:大數(shù)據(jù)

ORA-12154: TNS:could not resolve the connect identifier specified 處理

SQL> select dest_name,status,error from v$archive_dest  where rownum <3;


DEST_NAME                  STATUS    ERROR

--------------------------------------- -------------------------------

LOG_ARCHIVE_DEST_1         VALID

LOG_ARCHIVE_DEST_2         ERROR     ORA-12154: TNS:could not resolve the connect identifier specified

其中:

Tnsping tnsname 是通的,但是這里依舊報(bào)錯(cuò)排錯(cuò)原因:

Primary端:

log_archive_dest_2                   string      service=orcl_dg async

                                                   valid_for=(online_logfiles,p

                                                 rimary_role)

                                                   db_unique_name=orcl_dg

standby 端:

SQL> show parameter fal


NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

fal_client                           string      orcl_primary

fal_server                           string      orcl_standby

SQL> show parameter service_name          


NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

service_names                        string      orcl_dg

SQL>

檢查兩端Tnsnames.ora 配置:

orcl_primary =

(DESCRIPTION = 

        (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.1.244)(PORT = 1521)) 

    (CONNECT_DATA = 

             (SERVER = DEDICATED) 

                 (SERVICE_NAME = orcl_pm)

    )

)

orcl_standby =

(DESCRIPTION = 

        (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.1.245)(PORT = 1521)) 

    (CONNECT_DATA = 

             (SERVER = DEDICATED) 

                 (SERVICE_NAME = orcl_dg) 

    )

)

注:參數(shù)LOG_ARCHIVE_DEST_n Parameter Attributes里面的service是指:net_service_name

When you specify a SERVICE attribute:

You identify remote destinations by specifying the SERVICE attribute with a valid Oracle Net service name (SERVICE=net_service_name) that identifies the remote Oracle database instance to which the redo data will be sent.

The Oracle Net service name that you specify with the SERVICE attribute is translated into a connection descriptor that contains the information necessary for connecting to the remote database.

因此:log_archive_log_2中的service是指tnsnames.ora中的net_service_name,并不是standby庫中的service_name

在主庫中修改log_archive_log_2參數(shù):

alter system set  log_archive_dest_2='service=orcl_standby async

  valid_for=(online_logfiles,primary_role)

  db_unique_name=orcl_dg'  scope=spfile;

修改備庫:

alter system set log_archive_dest_2='service=orcl_primary async

 valid_for=(online_logfiles,primary_role) 

db_unique_name=orcl_pm' scope=spfile;

重啟庫和監(jiān)聽OK!

以前配置時(shí),service_name,unique_name,tnsname 都是一樣,沒有清楚的理解這里log_archive_dest_2中的service的概念。


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI