由于希望测试一个dg问题,所以在vmware上搭建测试环境,primary和standby放在同一台主机上。搭建过程就不赘述,但是在最后,遇到了一些问题,这里记录一下,以备
由于希望测试一个dg问题,所以在vmware上搭建测试环境,primary和standby放在同一台主机上。
搭建过程就不赘述,,但是在最后,遇到了一些问题,这里记录一下,以备后续查阅。
----搭建过程中的一些命令-----
1. backup database format '/tmp/bk_%u';2. backup current controlfile for standby format '/tmp/stdbyctl.bkp';3. catalog start with '/tmp/';4. set controlfile autobackup format for device type disk to '/tmp/%f';restore standby controlfile from '/tmp/stdbyctl.bkp'; 5. rman> connect target sys/oracle@db;rman> connect auxiliary sys/oracle@stddb;6. 最会std的pfile文件内容
db_file_name_convert= '+data/db/','+reco/stddb/' log_file_name_convert= '+reco/db/archivelog/','+reco/stddb/archivelog_std/' log_archive_format=%t_%s_%r.arc standby_file_management=auto compatible='11.2.0.0.0' control_files='+reco/stddb/controlfile/current.260.834947597' 问题一: 在设置listener的过程中,由于设定静态监听,在standby启动之后,同时又会注册一个动态监听,目前有两个监听,其中动态监听状态为blocked。
遇到的问题就是,在duplicate连接的时候,就会发生ora-12528错误,而不能正常连接到standby。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [oracle@oel ~]$ lsnrctl statuslsnrctl for linux: version 11.2.0.1.0 - production on 30-dec-2013 10:46:03copyright (c) 1991, 2009, oracle. all rights reserved.connecting to (address=(protocol=tcp)(host=)(port=1521)) status of the listener ------------------------ aliaslistener versiontnslsnr for linux: version 11.2.0.1.0 - production start date27-nov-2013 12:40:26 uptime32 days 22 hr. 5 min. 37 sec trace leveloff securityon: local os authentication snmpoff listener parameter file /u01/app/11.2.0/grid/network/admin/listener.ora listener log file/u01/app/oracle/diag/tnslsnr/oel/listener/alert/log.xml listening endpoints summary...(description=(address=(protocol=ipc)(key=extproc1521)))(description=(address=(protocol=tcp)(host=oel.localdomain)(port=1521))) services summary... service +asm has 1 instance(s).instance +asm, status ready, has 1 handler(s) for this service... service primdb has 1 instance(s).instance db, status ready, has 1 handler(s) for this service... service dbxdb has 1 instance(s).instance db, status ready, has 1 handler(s) for this service... service stbdb has 1 instance(s).instance stbdb, status unknown, has 1 handler(s) for this service... 通过设置tnsnames.ora,可以解决这个问题。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ stddb = (description =(address_list =(address = (protocol = tcp)(host = oel.localdomain)(port = 1521))) (connect_data = (service_name = stddb)(ur=a)) 问题二: 在执行下面命令之后,直接primary就crash掉,经过查询alert发现,是redo broken导致的
alter database recover managed standby database disconnect from session;
查询standby alert,发现如下信息:
(在alter database recover...开始之后,第一件事情就是clear redo log,这样就直接导致primary crash)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # tail -f alert_stddb.log clearing online redo logfile 1 complete clearing online redo logfile 2 +data/db/redo02.log clearing online log 2 of thread 1 sequence number 5 clearing online redo logfile 2 complete clearing online redo logfile 3 +data/db/redo03.log clearing online log 3 of thread 1 sequence number 3 tue dec 24 14:32:49 2013 clearing online redo logfile 3 complete tue dec 24 14:32:49 2013 media recovery waiting for thread 1 sequence 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~在重建几次之后,问题依然。
由于datafile和archivelog都使用convert参数转换了,但是redo是无法转换的,如何解决这个问题呢?
经过分析,发现在duplicate的最后,有一些警告信息:
~~~~~~~~~duplicate the standby databsae~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rman> connect target sys/oracle@db; rman> connect auxiliary sys/oracle@stddb;connected to auxiliary database: db (not mounted)rman> duplicate target database for standby;starting duplicate db at 24-dec-13 allocated channel: ora_aux_disk_1 channel ora_aux_disk_1: sid=13 device type=diskcontents of memory script: {restore clone standby controlfile; } executing memory scriptstarting restore at 24-dec-13 using channel ora_aux_disk_1channel ora_aux_disk_1: starting datafile backup set restore channel ora_aux_disk_1: restoring control file channel ora_aux_disk_1: reading from backup piece /tmp/stdbyctl.bkp channel ora_aux_disk_1: piece handle=/tmp/stdbyctl.bkp tag=tag20131224t133449 channel ora_aux_disk_1: restored backup piece 1 channel ora_aux_disk_1: restore complete, elapsed time: 00:00:08 output file name=+reco/stddb/controlfile/current.259.835018533 finished restore at 24-dec-13contents of memory script: {sql clone 'alter database mount standby database'; } executing memory scriptsql statement: alter database mount standby databasecontents of memory script: {set newname for tempfile 1 to +reco/stddb/temp01.dbf;switch clone tempfile all;set newname for datafile 1 to +reco/stddb/system01.dbf;set newname for datafile 2 to +reco/stddb/sysaux01.dbf;set newname for datafile 3 to +reco/stddb/undotbs01.dbf;set newname for datafile 4 to +reco/stddb/users01.dbf;restoreclone database; } executing memory scriptexecuting command: set newnamerenamed tempfile 1 to +reco/stddb/temp01.dbf in control fileexecuting command: set newnameexecuting command: set newnameexecuting command: set newnameexecuting command: set newnamestarting restore at 24-dec-13 using channel ora_aux_disk_1channel ora_aux_disk_1: starting datafile backup set restore channel ora_aux_disk_1: specifying datafile(s) to restore from backup set channel ora_aux_disk_1: restoring datafile 00001 to +reco/stddb/system01.dbf channel ora_aux_disk_1: restoring datafile 00002 to +reco/stddb/sysaux01.dbf channel ora_aux_disk_1: restoring datafile 00003 to +reco/stddb/undotbs01.dbf channel ora_aux_disk_1: restoring datafile 00004 to +reco/stddb/users01.dbf channel ora_aux_disk_1: reading from backup piece /tmp/bk_01osanei_1_1 channel ora_aux_disk_1: piece handle=/tmp/bk_01osanei_1_1 tag=tag20131224t132953 channel ora_aux_disk_1: restored backup piece 1 channel ora_aux_disk_1: restore complete, elapsed time: 00:04:27 finished restore at 24-dec-13contents of memory script: {switch clone datafile all; } executing memory scriptdatafile 1 switched to datafile copy input datafile copy recid=1 stamp=835019033 file name=+reco/stddb/system01.dbf datafile 2 switched to datafile copy input datafile copy recid=2 stamp=835019033 file name=+reco/stddb/sysaux01.dbf datafile 3 switched to datafile copy input datafile copy recid=3 stamp=835019033 file name=+reco/stddb/undotbs01.dbf datafile 4 switched to datafile copy input datafile copy recid=4 stamp=835019033 file name=+reco/stddb/users01.dbf oracle error from auxiliary database: ora-01511: error in renaming log/data files