0
点赞
收藏
分享

微信扫一扫

oracle12cR2使用DBCA创建DG standby备库时报错ORA-17627 ORA-12154 TNS could not resolve the connect identifier s


oracle12cR2使用DBCA创建DG standby备库时报错ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified 在测试12C的DBCA创建DG STANDBY数据库时遇到如下错误:

$ dbca -silent -createDuplicateDB -gdbName bys2 -sid bys2std5 -sysPassword oracle -primaryDBConnectionString 192.168.57.211:1521/bys2 -createAsStandby -dbUniqueName bys2std -initParams db_create_file_dest=/u01/app/oracle12c/oradata/bys2std,db_recovery_file_dest=/u01/app/oracle12c/fast_recovery_area/bys2std,local_listener="listener_bys2"
Listener config step
33% complete
Auxiliary instance creation
66% complete
RMAN duplicate
DBCA Operation failed.
Look at the log file "/u01/app/oracle12c/cfgtoollogs/dbca/bys2std/bys29.log" for further details.
查看日志中报错是:
channel ORA_DISK_2: SID=14 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 11/01/2017 13:54:03
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/01/2017 13:54:03
ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified
ORA-17629: Cannot connect to the remote database server

经排查测试,原因是主库中/etc/hosts中未包含备库的主机名IP信息条目(即使tnsnames.ora中都用的IP,dbca -silent命令里连接串也用的IP)。 这个错误比较有隐蔽性,在主备库的/etc/hosts包括自己主机名条目、tnsnames.ora中使用IP时也会报这错误,查看日志、使用dbca -silent ***event="17627 trace name errorstack level 3"也没有更详细信息。如下测试验证这一点: 测试1:主库未配置/etc/hosts中备库主机信息

主库信息:
$ date
Wed Nov 1 13:54:42 CST 2017
$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.57.211 bys1 bys1.bys.com
#192.168.57.212 bys2

备库进行DBCA配置:
$ date
Wed Nov 1 13:53:00 CST 2017
$ dbca -silent -createDuplicateDB -gdbName bys2 -sid bys2std5 -sysPassword oracle -primaryDBConnectionString 192.168.57.211:1521/bys2 -createAsStandby -dbUniqueName bys2std -initParams db_create_file_dest=/u01/app/oracle12c/oradata/bys2std,db_recovery_file_dest=/u01/app/oracle12c/fast_recovery_area/bys2std,local_listener="listener_bys2"
Listener config step
33% complete
Auxiliary instance creation
66% complete
RMAN duplicate
DBCA Operation failed.
Look at the log file "/u01/app/oracle12c/cfgtoollogs/dbca/bys2std/bys29.log" for further details.

查看报错日志:
# tail -n 50 /u01/app/oracle12c/cfgtoollogs/dbca/bys2std/bys29.log
[ 2017-11-01 13:53:41.748 CST ] Listener config step
DBCA_PROGRESS : 33%
[ 2017-11-01 13:53:41.919 CST ] Auxiliary instance creation
DBCA_PROGRESS : 66%
[ 2017-11-01 13:53:58.663 CST ] RMAN duplicate
[ 2017-11-01 13:54:04.118 CST ] echo set off
RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 21> 22> 23> 24> 25> 26> 27> 28> 29> 30> 31> 32> 33> 34> 35> 36> 37> 38> 39> 40> 41>
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting Duplicate Db at 01-NOV-17
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=36 device type=DISK
allocated channel: ORA_AUX_DISK_2
channel ORA_AUX_DISK_2: SID=37 device type=DISK
current log archived
contents of Memory Script:
{
backup as copy reuse
targetfile '/u01/app/oracle/product/12.2.0/dbhome_1/dbs/orapwbys2' auxiliary format
'/u01/app/oracle/product/12.2.0/dbhome_1/dbs/orapwbys2std5' ;
restore clone from service '192.168.57.211:1521/bys2' spfile to
'/u01/app/oracle/product/12.2.0/dbhome_1/dbs/spfilebys2std5.ora';
sql clone "alter system set spfile= ''/u01/app/oracle/product/12.2.0/dbhome_1/dbs/spfilebys2std5.ora''";
}
executing Memory Script
Starting backup at 01-NOV-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=414 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=14 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 11/01/2017 13:54:03
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/01/2017 13:54:03
ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified
ORA-17629: Cannot connect to the remote database server
RMAN>
echo set on

[ 2017-11-01 13:54:04.286 CST ] DBCA_PROGRESS : DBCA Operation failed.

测试2: 主库配置/etc/hosts中备库主机信息

]# date
Wed Nov 1 13:54:57 CST 2017
# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.57.211 bys1 bys1.bys.com
192.168.57.212 bys2


备库DBCA创建:
$ date
Wed Nov 1 13:55:25 CST 2017
$ dbca -silent -createDuplicateDB -gdbName bys2 -sid bys2std5 -sysPassword oracle -primaryDBConnectionString 192.168.57.211:1521/bys2 -createAsStandby -dbUniqueName bys2std -initParams db_create_file_dest=/u01/app/oracle12c/oradata/bys2std,db_recovery_file_dest=/u01/app/oracle12c/fast_recovery_area/bys2std,local_listener="listener_bys2"
Listener config step
33% complete
Auxiliary instance creation
66% complete
RMAN duplicate
100% complete
Look at the log file "/u01/app/oracle12c/cfgtoollogs/dbca/bys2std/bys210.log" for further details.

举报

相关推荐

0 条评论