oracle 11.2.0.4 DataGuard Broker配置過程中可能遇到的問題及解決方法

清風艾艾發表於2018-04-16
    本文記錄oracle 11.2.0.4 DG Broker配置過程中遇到的一些問題及解決方法,由於部署環境不同,問題現象和處理辦法供參考,如果
有問題歡迎批評指正。
1、歸檔引數log_archive_dest_2設定不當導致的主備庫告警日誌警告
問題現象:
主庫
Web Apr 11 14:17:16 2018
RFS[85]: Assigned to RFS proess 28893
RFS[85]: Database mount ID mismatch [0x59764e70:0x5976ad14](1500925552:1500949780)
RFS[85]: Client instance is standby database instead of primary
RFS[85]: Not using real application clusters

備庫
Web Apr 11 14:12:16 2018
PING[ARC2]: Heartbeat failed to connect to standby 'dbprimary'. Error is 16009.
處理辦法(MOS文件 ID 1450132.1):
備庫執行
alter system set log_archive_dest_state_2=defer scope=both sid='*'
或者
alter system set log_archive_dest_2='service=dbstandby arch sync valid_for=(online_logfiles,primary_role) db_unique_name=orcls' scope=both sid='*';

2、由於主備庫資料檔案路徑不一致且未適當設定db_file_name_convert和log_file_name_convert引數導致DDL無法同步到備庫
問題現象:
主庫告警日誌
ORA-01111:name for data file 5 is unknown - rename to correct file
ORA-01110: data file 5: '/opt/oracle/product/11.2.0.4/db/dbs/UNNAMED00005
ora-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01111: name for data file 5 is unknow - rename to correct file
ORA-01110: data file 5: '/opt/oracle/product/11.2.0.4/db/dbs/UNNAMED00005

處理辦法:
主備庫檢查convert引數
SQL>show parameter convert
NAME       TYPE          VALUE
--------------         -----------     --------------------------------------------
_convert_set_to_join   bollean         FALSE
db_file_name_convert   string          /opt/oracle/oradata/,/opt/oracle/oradata/
log_file_name_convert  string          /opt/oracle/oradata/,/opt/oracle/oradata/
DGMGRL檢查主備庫DG對映引數
DGMGRL>show configuration
Configuration - dgb_p
Protection Mode:Maxperformance
Databases:
  orcl  - Primary database
warning:ORA-16792: configurable property value is inconsistent with database setting
  orcls - Physical standby database
warning:ORA-16792: configurable property value is inconsistent with database setting
Fast-Start Failover:DISABLED
DGMGRL>show database ORCL
Database - orcl
Role: PRIMARY
Intended State:TRANSPORT-ON
Instance(s):
  orcl
    warning:ORA-16714:the value of property DbFileNameConvert is inconsistent with the database setting
Database Status:
WARNING
--透過verbose引數檢視具體的DbFileNameConvert引數值
show database VERBOSE ORCL

備庫執行
alter database recover managed standby database cancel;
alter database create datafile  '/opt/oracle/product/11.2.0.4/db/dbs/UNNAMED00005'  as  '/opt/oracle/oradata/test01.dbf';
備庫重新啟動日誌應用程式
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
主備庫的啟動引數檔案中加入,然後重新生成spfile
*.db_file_name_convert='/opt/oracle/oradata','/opt/oracle/oradata'
DGMGRL控制檯執行
DGMGRL>edit database orcl set property DbFileNameConvert = '/opt/oracle/oradata/,/opt/oracle/oradata/';

3、oracle dg配置時主備庫的db_unique_name不能相同,否則備庫無法新增而報錯
問題現象:
DGMGRL控制檯新增備庫時報錯
DGMGRL> add database orcls as connect identifier is dbstandby maintained as physical;
Error: ORA-16642: DB_UNIQUE_NAME mismatch.

處理辦法:
修改備庫啟動pfile中的db_unique_name(沒有該引數則新增)值與主庫中的db_unique_name值不同
重新生成spfile,重啟備庫

4、透過rman duplicate主庫到備機時sys使用者無法透過tns服務名登入主備庫
問題現象:
[oracle@centdgpri ~]$ tnsping dbprimary
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 16-APR-2018 00:35:27
Copyright (c) 1997, 2013, Oracle.  All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL =TCP)(HOST=centdgpri)(PORT=1521))) (CONNECT_DATA=(SID=orcl)(SERVER=DEDICATED)))
OK (160 msec)
[oracle@centdgpri ~]$ sqlplus "sys/WaterH2o@dbprimary as sysdba" 

SQL*Plus: Release 11.2.0.4.0 Production on Mon Apr 16 00:36:46 2018
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:

ORA-01017: invalid username/password; logon denied

問題處理:
確認sys密碼正確
如下SQL到主庫查詢無資料
SELECT * FROM V$PWFILE_USERS;
主庫oracle使用者執行如下命令,orapwd的檔名字是orapw$ORACLE_SID,路徑是$ORACLE_HOME/dbs下,否則生成的檔案無效

orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=WaterH2o entries=30 force=y
再次查詢確認



5、oracle DG Broke相關ADG特性使用中要求主備庫開啟閃回,而oracle rman duplicate克隆的備庫沒有自動開啟閃回,
對備庫開啟閃回功能的時候需要注意
停止日誌程式
recover managed standby database cancel;
建立閃回目錄
mkdir -p /opt/oracle/flash_recovery_area
設定資料庫閃回引數
alter system set db_recovery_file_dest_size=10g;
alter system set db_recovery_file_dest='/opt/oracle/flash_recovery_area';
開啟資料庫閃回功能
alter database flashback on;
確認資料庫閃回開啟
select name,db_unique_name,flashback_on from v$database;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29357786/viewspace-2152980/,如需轉載,請註明出處,否則將追究法律責任。

相關文章