Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

0

积分

1

好友

10

主题
1#
发表于 2014-4-12 13:02:42 | 查看: 7118| 回复: 11
本帖最后由 xia 于 2014-4-15 15:23 编辑

环境  11.2.0.3 双节点rac,   单点dg 同样11.2.0.3版本,都是采用ASM 管理的方式;

节点1:
[root@xhdb1 ~]# cat /etc/hosts

127.0.0.1       racnode1 localhost.localdomain localhost
::1                  localhost6.localdomain6 localhost6


####RAC publi ip

192.168.80.141    xhdb1
192.168.80.142    xhdb2

####RAC virtual ip (vip)

192.168.80.143    xhdb1-vip
192.168.80.144    xhdb2-vip

####RAC private ip

195.168.80.141    xhdb1-priv
195.168.80.142    xhdb2-priv

####RAC scan ip

192.168.80.145    xhdb-scan


[oracle@xhdb1 admin]$ env |grep ORA
ORACLE_UNQNAME=xhdb
ORACLE_SID=xhdb1
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

节点2

[grid@xhdb2 ~]$ cat /etc/hosts


127.0.0.1               racnode2 localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6

####RAC publi ip

192.168.80.141    xhdb1
192.168.80.142    xhdb2

####RAC virtual ip (vip)

192.168.80.143    xhdb1-vip
192.168.80.144    xhdb2-vip

####RAC private ip

195.168.80.141    xhdb1-priv
195.168.80.142    xhdb2-priv

####RAC scan ip

192.168.80.145    xhdb-scan


[oracle@xhdb2 admin]$ env |grep ORA
ORACLE_UNQNAME=xhdb
ORACLE_SID=xhdb2
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

RAC ASM磁盘组

ASMCMD [+] > ls
CRS/
ORAARCH/
ORADATA/




dg1

[root@dg1 ~]# cat /etc/hosts


127.0.0.1       localhost.localdomain localhost
#::1            localhost6.localdomain6 localhost6
192.168.80.149  dg1


[oracle@dg1 ~]$ env |grep ORA
ORACLE_UNQNAME=mydb
ORACLE_SID=mydb
ORACLE_BASE=/u01/app/oracle
ORACLE_HOSTNAME=dg1
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

ASM磁盘组
ASMCMD [+] > ls
CRS/
ORAARCH/
ORADATA/

目前为止主库上操作的过程

1、修改归档模式和force log
SQL> select name,log_mode,force_logging from gv$database;

NAME      LOG_MODE     FOR
--------- ------------ ---
XHDB      ARCHIVELOG   YES
XHDB      ARCHIVELOG   YES

2、备份全库、 归档和创建standby 控制文件
RMAN> run {
2> allocate channel c1 type disk;
3> allocate channel c2 type disk;
4> backup database format '/rman_backup/Full_%U.bak';
5> release channel c1;
6> release channel c2;
7> }

RMAN> backup archivelog all format '/rman_backup/ARC_%U.bak';

RMAN> backup device type disk format '/rman_backup/standby_%U.ctl' current controlfile for standby;

3、 RAC 主库创建物理备库初始化参数文件

SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +ORADATA/xhdb/spfilexhdb.ora

SQL> create pfile='/rman_backup/initmydb.ora' from spfile;

4、RAC 主库修改口令文件,使双节点sys用户口令一致;
节点1 ;
SQL> alter user sys identified by aa123456;

到第二个节点也修改该SYS口令
SQL> alter user sys identified by aa123456;


物理备库准备工作
1、把主库的备份文件、初始化文件都拷贝到standby 上

2、把节点1上面的口令文件复制到DG节点上来,

[oracle@xhdb1 dbs]$ scp orapwxhdb1 192.168.80.149:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwmydb
oracle@192.168.80.149's password:
orapwxhdb1                                                                                          100% 1536     1.5KB/s   00:00


3、修改初始化参数

原主库的初始化参数
1 xhdb2.__db_cache_size=889192448
  2 xhdb1.__db_cache_size=687865856
  3 xhdb2.__java_pool_size=16777216
  4 xhdb1.__java_pool_size=16777216
  5 xhdb2.__large_pool_size=16777216
  6 xhdb1.__large_pool_size=16777216
  7 xhdb1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
  8 xhdb2.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
  9 xhdb2.__pga_aggregate_target=637534208
10 xhdb1.__pga_aggregate_target=637534208
11 xhdb2.__sga_target=1879048192
12 xhdb1.__sga_target=1879048192
13 xhdb2.__shared_io_pool_size=0
14 xhdb1.__shared_io_pool_size=0
15 xhdb2.__shared_pool_size=939524096
16 xhdb1.__shared_pool_size=1140850688
17 xhdb2.__streams_pool_size=0
18 xhdb1.__streams_pool_size=0   
19 *.audit_file_dest='/u01/app/oracle/admin/xhdb/adump'   //修改为mydb
20 *.audit_trail='db'
21 *.cluster_database=true   
22 *.compatible='11.2.0.0.0'
23 *.control_files='+ORADATA/xhdb/controlfile/current.260.837639849'
24 *.db_block_size=8192
25 *.db_create_file_dest='+ORADATA'
26 *.db_domain=''
27 *.db_name='xhdb'
28 *.diagnostic_dest='/u01/app/oracle'
29 *.dispatchers='(PROTOCOL=TCP) (SERVICE=xhdbXDB)'
30 xhdb2.instance_number=2
31 xhdb1.instance_number=1
32 *.log_archive_dest_1='LOCATION=+ORAARCH'
33 *.log_archive_format='%t_%s_%r.dbf'
34 *.open_cursors=300
35 *.pga_aggregate_target=624951296
36 *.processes=150
37 *.remote_listener='xhdb-scan:1521'
38 *.remote_login_passwordfile='exclusive'
39 *.sga_target=1874853888
40 xhdb2.thread=2
41 xhdb1.thread=1
42 xhdb1.undo_tablespace='UNDOTBS1'
43 xhdb2.undo_tablespace='UNDOTBS2'



修改之后的成为standby 初始化参数文件

  1 mydb.__db_cache_size=687865856
  2 mydb.__java_pool_size=16777216
  3 mydb.__large_pool_size=16777216
  4 mydb.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
  5 mydb.__pga_aggregate_target=637534208
  6 mydb.__sga_target=1879048192
  7 mydb.__shared_io_pool_size=0
  8 mydb.__shared_pool_size=1140850688
  9 mydb.__streams_pool_size=0                                    

10 *.audit_file_dest='/u01/app/oracle/admin/mydb/adump'     
11 *.audit_trail='db'
12 *.cluster_database=false                                                
13 *.compatible='11.2.0.0.0'
14 *.control_files='+ORADATA/mydb/controlfile/cont.ctl'                             
15 *.core_dump_dest='/u01/app/oracle/diag/rdbms/mydb/cdump'             
16 *.db_block_size=8192
17 *.db_create_file_dest='+ORADATA'                                                              
18 *.db_domain=''
19 *.db_file_name_convert='+ORADATA/xhdb/','+ORADATA/mydb/'                   
20 *.db_name='xhdb'
21 *.db_recovery_file_dest='+ORAARCH'                     //闪回恢复区,(我这里实际上是归档日志存放区)
22 *.db_recovery_file_dest_size=3113851289
23 *.db_unique_name='mydb'
24 *.diagnostic_dest='/u01/app/oracle'  
              
25 *.dispatchers='(PROTOCOL=TCP) (SERVICE=mydbXDB)'

26 *.fal_client='mydb'
27 *.fal_server='xhdb1','xhdb2'        

28 *.log_archive_config='dg_config=(xhdb,mydb)'  
   
29
30 *.log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles) db_unique_name=mydb'   
                                                                                             

31 *.log_archive_dest_2='service=xhdb1 valid_for=(online_logfiles,primary_role)     db_unique_name=xhdb'
32                                    
   
33 *.log_archive_format='ARC_%t_%S_%r.arc'               
34 *.log_file_name_convert='+ORADATA/xhdb/','+ORADATA/mydb/'           
35
36 *.open_cursors=300

37 *.pga_aggregate_target=624951296
38 *.processes=150
39 *.remote_login_passwordfile='exclusive'
40 *.sga_target=1874853888
41 *.service_names='mydb'
42
43 *.standby_file_management='auto'                      
44 *.thread=1
45 *.undo_management='auto'
46 *.undo_tablespace='UNDOTBS1'


4、修改主备库的tnsnames文件
4.1节点1 和节点2 一样
XHDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xhdb-scan)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = xhdb)
    )
  )

xhdb1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.80.143)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = xhdb)
      (INSTANCE_NAME = xhdb1)
    )
  )


xhdb2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.80.144)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = xhdb)
      (INSTANCE_NAME = xhdb2)
    )
  )



mydb =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.80.149)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = mydb)
    )
  )

4.2备库 的tnsname文件
XHDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.80.145)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = xhdb)
    )
  )

MYDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.80.149)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = mydb)
    )
  )

XHDB2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.80.144)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = xhdb)
      (INSTANCE_NAME = xhdb2)
    )
  )

XHDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.80.143)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = xhdb)
      (INSTANCE_NAME = xhdb1)
    )
  )

5、测试住备库的连通性

节点1,节点2和备库 测试实例联通性
SQL> conn sys/aa123456@xhdb as sysdba
Connected.
SQL> conn sys/aa123456@xhdb1 as sysdba
Connected.
SQL> conn sys/aa123456@xhdb2 as sysdba
Connected.
SQL> conn sys/aa123456@mydb as sysdba
Connected.




6、备库挂载在nomount下

SQL> startup nomount;
ORACLE instance started.
Total System Global Area 1870647296 bytes
Fixed Size                  2229424 bytes
Variable Size            1174408016 bytes
Database Buffers          687865856 bytes
Redo Buffers                6144000 bytes
2#
发表于 2014-4-12 13:05:46
7、备库恢复控制文件

RMAN 恢复备库控制文件
[oracle@dg1 dbs]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Fri Apr 11 16:53:49 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: XHDB (not mounted)

RMAN> restore standby controlfile from '/rman_backup/standby_0jp59qvf_1_1.ctl';

Starting restore at 11-APR-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=22 device type=DISK

channel ORA_DISK_1: restoring control file
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 04/11/2014 16:58:48
RMAN-10038: database session for channel ORA_DISK_1 terminated unexpectedly


解决的方法是根据网络上的一篇文章  http://www.2cto.com/database/201307/229233.html ,先手工创建一个库,然后在恢复控制文件,我不知道为什么要这么做才能恢复控制文件?



RMAN> restore standby controlfile from '/rman_backup/standby_0jp59qvf_1_1.ctl';

Starting restore at 11-APR-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=25 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=+ORADATA/mydb/controlfile/cont.ctl
Finished restore at 11-APR-14

[grid@dg1 ~]$ asmcmd
ASMCMD> ls
CRS/
ORAARCH/
ORADATA/

ASMCMD> pwd
+oradata/mydb/controlfile
ASMCMD> ls
cont.ctl
current.260.844628861



8、 MOUNT物理备库
SQL> alter database mount;

Database altered.

9、RMAN restore 物理备库


[oracle@dg1 ~]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Fri Apr 11 19:13:59 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: XHDB (DBID=4066872873, not open)
RMAN> run {
2> allocate channel c1 type disk;
3> allocate channel c2 type disk;
4> restore database;
5> release channel c1;
6> release channel c2;
7> }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=33 device type=DISK

allocated channel: c2
channel c2: SID=34 device type=DISK

Starting restore at 11-APR-14
Starting implicit crosscheck backup at 11-APR-14
Crosschecked 5 objects
Finished implicit crosscheck backup at 11-APR-14

Starting implicit crosscheck copy at 11-APR-14
Crosschecked 2 objects
Finished implicit crosscheck copy at 11-APR-14

searching for all files in the recovery area
cataloging files...
no files cataloged


channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00001 to +ORADATA/mydb/datafile/system.256.837639      769
channel c1: restoring datafile 00003 to +ORADATA/mydb/datafile/undotbs1.258.8376      39769
channel c1: restoring datafile 00004 to +ORADATA/mydb/datafile/users.259.8376397      69
channel c1: reading from backup piece /rman_backup/Full_0fp59qk7_1_1.bak
channel c2: starting datafile backup set restore
channel c2: specifying datafile(s) to restore from backup set
channel c2: restoring datafile 00002 to +ORADATA/mydb/datafile/sysaux.257.837639      769
channel c2: restoring datafile 00005 to +ORADATA/mydb/datafile/example.264.83763      9863
channel c2: restoring datafile 00006 to +ORADATA/mydb/datafile/undotbs2.265.8376      40043
channel c2: reading from backup piece /rman_backup/Full_0ep59qk7_1_1.bak
channel c1: piece handle=/rman_backup/Full_0fp59qk7_1_1.bak tag=TAG20140409T104423
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:01:24
channel c2: piece handle=/rman_backup/Full_0ep59qk7_1_1.bak tag=TAG20140409T104423
channel c2: restored backup piece 1
channel c2: restore complete, elapsed time: 00:01:33
Finished restore at 11-APR-14

released channel: c1

released channel: c2



10、备库创建standby logfile

10.1 备库文件

SQL> select name from v$datafile union select name from v$controlfile union select member from v$logfile;

NAME
--------------------------------------------------------------------------------
+ORADATA/mydb/controlfile/cont.ctl
+ORADATA/mydb/datafile/example.261.844629387
+ORADATA/mydb/datafile/sysaux.264.844629387
+ORADATA/mydb/datafile/system.265.844629387
+ORADATA/mydb/datafile/undotbs1.263.844629387
+ORADATA/mydb/datafile/undotbs2.259.844629387
+ORADATA/mydb/datafile/users.262.844629387
+ORADATA/mydb/onlinelog/group_101.273.843253809
+ORADATA/mydb/onlinelog/group_102.275.843253833
+ORADATA/mydb/onlinelog/group_103.271.843254831
+ORADATA/mydb/onlinelog/group_104.272.843254997

NAME
--------------------------------------------------------------------------------
+ORADATA/mydb/onlinelog/group_105.267.843255011
+ORADATA/mydb/onlinelog/group_201.274.843253825
+ORADATA/mydb/onlinelog/group_202.276.843253839
+ORADATA/mydb/onlinelog/group_203.269.843254957
+ORADATA/mydb/onlinelog/group_204.270.843255007
+ORADATA/mydb/onlinelog/group_205.266.843255017

17 rows selected.

SQL> select dbid,name,switchover_status,db_unique_name,database_role,open_mode,current_scn from v$database;

      DBID     NAME      SWITCHOVER_STATUS    DB_UNIQUE_NAME                     DATABASE_ROLE        OPEN_MODE            CURRENT_SCN
---------- --------- -------------------- ------------------------------ ---------------- -------------------- -----------
4066872873 XHDB      TO PRIMARY                       mydb                                   PHYSICAL STANDBY     MOUNTED                 22514702
                                                                                            
10.2主库上查看logfile文件

SQL> select * from v$logfile order by 1;

    GROUP# STATUS  TYPE    MEMBER                                                       IS_
---------- ------- ------- ------------------------------------------------------------ ---
       101         ONLINE  +ORADATA/mydb/onlinelog/group_101.273.843253809              NO
       102         ONLINE  +ORADATA/mydb/onlinelog/group_102.275.843253833              NO
       103         ONLINE  +ORADATA/mydb/onlinelog/group_103.271.843254831              NO
       104         ONLINE  +ORADATA/mydb/onlinelog/group_104.272.843254997              NO
       105         ONLINE  +ORADATA/mydb/onlinelog/group_105.267.843255011              NO
       201         ONLINE  +ORADATA/mydb/onlinelog/group_201.274.843253825              NO
       202         ONLINE  +ORADATA/mydb/onlinelog/group_202.276.843253839              NO
       203         ONLINE  +ORADATA/mydb/onlinelog/group_203.269.843254957              NO
       204         ONLINE  +ORADATA/mydb/onlinelog/group_204.270.843255007              NO
       205         ONLINE  +ORADATA/mydb/onlinelog/group_205.266.843255017              NO

10 rows selected.

SQL> select group#,thread#,members,bytes/1024/1024 M from v$log;

    GROUP#    THREAD#    MEMBERS          M
---------- ---------- ---------- ----------
       101          1          1         50
       102          1          1         50
       103          1          1         50
       104          1          1         50
       105          1          1         50
       201          2          1         50
       202          2          1         50
       203          2          1         50
       204          2          1         50
       205          2          1         50

10.2查看备库的v$standby_log

SQL> select * from v$standby_log;    //还没什么日志文件


no rows selected

回复 只看该作者 道具 举报

3#
发表于 2014-4-12 13:06:28
在备库上创建日志组文件
SQL> alter database add standby logfile thread 1 group 106 size 50m,group 107 size 50m,group 108 size 50m,group 109 size 50m,group 110 size 50m,group 111 size 50m;
Database altered.

SQL> alter database add standby logfile thread 2 group 206 size 50m,group 207 size 50m,group 208 size 50m,group 209 size 50m,group 210 size 50m,group 211 size 50m;


SQL>  select group#,thread#,bytes/1024/1024 M,used,archived,status from v$standby_log;

    GROUP#    THREAD#          M       USED ARC STATUS
---------- ---------- ---------- ---------- --- ----------
       106          1         50          0 YES UNASSIGNED
       107          1         50          0 YES UNASSIGNED
       108          1         50          0 YES UNASSIGNED
       109          1         50          0 YES UNASSIGNED
       110          1         50          0 YES UNASSIGNED
       111          1         50          0 YES UNASSIGNED
       206          2         50          0 YES UNASSIGNED
       207          2         50          0 YES UNASSIGNED
       208          2         50          0 YES UNASSIGNED
       209          2         50          0 YES UNASSIGNED
       210          2         50          0 YES UNASSIGNED
       211          2         50          0 YES UNASSIGNED

12 rows selected.

SQL> select group#,type,member from v$logfile order by 1;

    GROUP# TYPE    MEMBER
---------- ------- ------------------------------------------------------------
       101 ONLINE  +ORADATA/mydb/onlinelog/group_101.273.843253809
       102 ONLINE  +ORADATA/mydb/onlinelog/group_102.275.843253833
       103 ONLINE  +ORADATA/mydb/onlinelog/group_103.271.843254831
       104 ONLINE  +ORADATA/mydb/onlinelog/group_104.272.843254997
       105 ONLINE  +ORADATA/mydb/onlinelog/group_105.267.843255011
       106 STANDBY +ORAARCH/mydb/onlinelog/group_106.262.844636155
       106 STANDBY +ORADATA/mydb/onlinelog/group_106.268.844636155
       107 STANDBY +ORAARCH/mydb/onlinelog/group_107.261.844636185
       107 STANDBY +ORADATA/mydb/onlinelog/group_107.267.844636185
       108 STANDBY +ORAARCH/mydb/onlinelog/group_108.260.844636203
       108 STANDBY +ORADATA/mydb/onlinelog/group_108.266.844636203
       109 STANDBY +ORAARCH/mydb/onlinelog/group_109.259.844636215
       109 STANDBY +ORADATA/mydb/onlinelog/group_109.256.844636215
       110 STANDBY +ORADATA/mydb/onlinelog/group_110.257.844636223
       110 STANDBY +ORAARCH/mydb/onlinelog/group_110.258.844636223
       111 STANDBY +ORADATA/mydb/onlinelog/group_111.258.844636233
       111 STANDBY +ORAARCH/mydb/onlinelog/group_111.257.844636233
       201 ONLINE  +ORADATA/mydb/onlinelog/group_201.274.843253825
       202 ONLINE  +ORADATA/mydb/onlinelog/group_202.276.843253839
       203 ONLINE  +ORADATA/mydb/onlinelog/group_203.269.843254957
       204 ONLINE  +ORADATA/mydb/onlinelog/group_204.270.843255007
       205 ONLINE  +ORADATA/mydb/onlinelog/group_205.266.843255017
       206 STANDBY +ORADATA/mydb/onlinelog/group_206.269.844636425
       206 STANDBY +ORAARCH/mydb/onlinelog/group_206.263.844636425
       207 STANDBY +ORADATA/mydb/onlinelog/group_207.270.844636459
       207 STANDBY +ORAARCH/mydb/onlinelog/group_207.264.844636459
       208 STANDBY +ORADATA/mydb/onlinelog/group_208.271.844636471
       208 STANDBY +ORAARCH/mydb/onlinelog/group_208.265.844636471
       209 STANDBY +ORADATA/mydb/onlinelog/group_209.272.844636481
       209 STANDBY +ORAARCH/mydb/onlinelog/group_209.266.844636481
       210 STANDBY +ORADATA/mydb/onlinelog/group_210.273.844636491
       210 STANDBY +ORAARCH/mydb/onlinelog/group_210.267.844636493
       211 STANDBY +ORADATA/mydb/onlinelog/group_211.274.844636507
       211 STANDBY +ORAARCH/mydb/onlinelog/group_211.268.844636507

34 rows selected.

11、调整主库归档的参数。让主库归档日志传输到备库上去;

SQL> alter system set log_archive_dest_2='service=mydb lgwr sync valid_for=(online_logfiles,primary_role) db_unique_name=mydb' sid='*';

System altered.

SQL> alter system set log_archive_config='dg_config=(xhdb,mydb)' sid='*';

System altered.


这是备库上的日志

Sat Apr 12 08:16:39 2014
Using STANDBY_ARCHIVE_DEST parameter default value as USE_DB_RECOVERY_FILE_DEST





备库上仍然没有归档传递过来

RMAN> list archivelog all;

specification does not match any archived log in the repository

在节点1 和节点2 上的日志

节点1

GWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2
******************************************************************
Sat Apr 12 08:16:35 2014
NSS2 started with pid=39, OS id=29163
Sat Apr 12 08:16:38 2014
PING[ARC2]: Heartbeat failed to connect to standby 'mydb'. Error is 16057.
LGWR: Error 16057 disconnecting from destination LOG_ARCHIVE_DEST_2 standby host 'mydb'
Error 16057 for archive log file 103 to 'mydb'
LGWR: Failed to archive log 103 thread 1 sequence 304 (16057)
Thread 1 advanced to log sequence 304 (LGWR switch)
  Current log# 103 seq# 304 mem# 0: +ORADATA/xhdb/onlinelog/group_103.271.843254831
Sat Apr 12 08:16:41 2014
ARC1: Archivelog destination LOG_ARCHIVE_DEST_2 disabled: destination Data Guard configuration                               error
Archived Log entry 525 added for thread 1 sequence 303 ID 0xf2676426 dest 1:
Sat Apr 12 08:23:25 2014
ALTER SYSTEM SET log_archive_config='dg_config=(xhdb,mydb)' SCOPE=BOTH SID='*';
Sat Apr 12 08:28:34 2014
Thread 1 advanced to log sequence 305 (LGWR switch)
  Current log# 104 seq# 305 mem# 0: +ORADATA/xhdb/onlinelog/group_104.272.843254997
Sat Apr 12 08:28:34 2014
Archived Log entry 527 added for thread 1 sequence 304 ID 0xf2676426 dest 1:

节点2

PING[ARC2]: Heartbeat failed to connect to standby 'mydb'. Error is 16191.
Sat Apr 12 08:24:04 2014
Error 1017 received logging on to the standby
------------------------------------------------------------
Check that the primary and standby are using a password file
and remote_login_passwordfile is set to SHARED or EXCLUSIVE,
and that the SYS password is same in the password files.
      returning error ORA-16191



找不到从哪里下手,搞了一天了,搞不定 ,请有经验的网友帮我看看,谢谢!

回复 只看该作者 道具 举报

4#
发表于 2014-4-12 13:18:11
网上有类似的问题说是把密码文件复制到备库上,这个实验上测试主库连接备库,备库连接主库都是没问题的;

回复 只看该作者 道具 举报

5#
发表于 2014-4-12 20:11:04
该问题已归集为 密码文件配置不当 所造成

回复 只看该作者 道具 举报

6#
发表于 2014-4-14 13:13:54
这个问题算是解决了,是密码文件问题,把节点1的密码文件都拷贝到节点2和standby上,可以了。

回复 只看该作者 道具 举报

7#
发表于 2014-4-14 13:23:46
新问题又出现了:dg只接收到节点2的归档,接收不到节点1的归档:

DG节点

RMAN> list archivelog all;

List of Archived Log Copies for database with db_unique_name MYDB
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
1       2    220     A 09-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_12/thread_2_seq_220.256.844705027

3       2    221     A 09-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_12/thread_2_seq_221.270.844705027

2       2    222     A 10-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_12/thread_2_seq_222.269.844705027

5       2    223     A 10-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_12/thread_2_seq_223.271.844705029

4       2    224     A 11-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_12/thread_2_seq_224.272.844705029

8       2    225     A 11-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_12/thread_2_seq_225.273.844705031

6       2    226     A 11-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_12/thread_2_seq_226.274.844705031

7       2    227     A 12-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_12/thread_2_seq_227.275.844705033

9       2    228     A 12-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_12/thread_2_seq_228.276.844705035

11      2    229     A 12-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_12/thread_2_seq_229.277.844705035

12      2    230     A 12-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_12/thread_2_seq_230.278.844705035

10      2    231     A 12-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_12/thread_2_seq_231.279.844705035

13      2    232     A 12-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_12/thread_2_seq_232.280.844706711

14      2    233     A 12-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_12/thread_2_seq_233.281.844725747

15      2    234     A 12-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_13/thread_2_seq_234.282.844754427

16      2    235     A 13-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_13/thread_2_seq_235.283.844768853

17      2    236     A 13-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_13/thread_2_seq_236.284.844794883

18      2    237     A 13-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_14/thread_2_seq_237.285.844822763

19      2    238     A 14-APR-14
        Name: +ORAARCH/mydb/archivelog/2014_04_14/thread_2_seq_238.286.844849045


RMAN>

DG 日志

Sat Apr 12 16:17:05 2014
Primary database is in MAXIMUM PERFORMANCE mode
Sat Apr 12 16:17:06 2014
RFS[1]: Assigned to RFS process 19345
RFS[1]: Opened log for thread 2 sequence 220 dbid -228094423 branch 837639851
RFS[2]: Assigned to RFS process 19349
RFS[2]: Selected log 206 for thread 2 sequence 232 dbid -228094423 branch 837639851
Sat Apr 12 16:17:06 2014
RFS[3]: Assigned to RFS process 19333
RFS[3]: Opened log for thread 2 sequence 222 dbid -228094423 branch 837639851
Sat Apr 12 16:17:06 2014
RFS[4]: Assigned to RFS process 19361
RFS[4]: Opened log for thread 2 sequence 221 dbid -228094423 branch 837639851
Archived Log entry 1 added for thread 2 sequence 220 rlc 837639851 ID 0xf2676426 dest 2:
RFS[1]: Opened log for thread 2 sequence 223 dbid -228094423 branch 837639851
Archived Log entry 2 added for thread 2 sequence 222 rlc 837639851 ID 0xf2676426 dest 2:
RFS[3]: Opened log for thread 2 sequence 224 dbid -228094423 branch 837639851
Archived Log entry 3 added for thread 2 sequence 221 rlc 837639851 ID 0xf2676426 dest 2:
RFS[4]: Opened log for thread 2 sequence 225 dbid -228094423 branch 837639851
Archived Log entry 4 added for thread 2 sequence 224 rlc 837639851 ID 0xf2676426 dest 2:
RFS[3]: Opened log for thread 2 sequence 226 dbid -228094423 branch 837639851
Archived Log entry 5 added for thread 2 sequence 223 rlc 837639851 ID 0xf2676426 dest 2:
RFS[1]: Opened log for thread 2 sequence 227 dbid -228094423 branch 837639851
Archived Log entry 6 added for thread 2 sequence 226 rlc 837639851 ID 0xf2676426 dest 2:
Archived Log entry 7 added for thread 2 sequence 227 rlc 837639851 ID 0xf2676426 dest 2:
Archived Log entry 8 added for thread 2 sequence 225 rlc 837639851 ID 0xf2676426 dest 2:
RFS[3]: Opened log for thread 2 sequence 228 dbid -228094423 branch 837639851
RFS[1]: Opened log for thread 2 sequence 229 dbid -228094423 branch 837639851
Archived Log entry 9 added for thread 2 sequence 228 rlc 837639851 ID 0xf2676426 dest 2:
RFS[4]: Opened log for thread 2 sequence 230 dbid -228094423 branch 837639851
RFS[3]: Opened log for thread 2 sequence 231 dbid -228094423 branch 837639851
Archived Log entry 10 added for thread 2 sequence 231 rlc 837639851 ID 0xf2676426 dest 2:
Sat Apr 12 16:17:17 2014
Archived Log entry 11 added for thread 2 sequence 229 rlc 837639851 ID 0xf2676426 dest 2:
Sat Apr 12 16:17:17 2014
Archived Log entry 12 added for thread 2 sequence 230 rlc 837639851 ID 0xf2676426 dest 2:
Sat Apr 12 16:45:11 2014
RFS[2]: Selected log 207 for thread 2 sequence 233 dbid -228094423 branch 837639851
Sat Apr 12 16:45:12 2014
Archived Log entry 13 added for thread 2 sequence 232 ID 0xf2676426 dest 1:
Sat Apr 12 22:02:28 2014
RFS[2]: Selected log 206 for thread 2 sequence 234 dbid -228094423 branch 837639851
Sat Apr 12 22:02:29 2014
Archived Log entry 14 added for thread 2 sequence 233 ID 0xf2676426 dest 1:
Sun Apr 13 06:00:28 2014
RFS[2]: Selected log 207 for thread 2 sequence 235 dbid -228094423 branch 837639851
Sun Apr 13 06:00:28 2014
Archived Log entry 15 added for thread 2 sequence 234 ID 0xf2676426 dest 1:
Sun Apr 13 10:00:53 2014
RFS[2]: Selected log 206 for thread 2 sequence 236 dbid -228094423 branch 837639851
Sun Apr 13 10:00:53 2014
Archived Log entry 16 added for thread 2 sequence 235 ID 0xf2676426 dest 1:
Sun Apr 13 17:14:44 2014
RFS[2]: Selected log 207 for thread 2 sequence 237 dbid -228094423 branch 837639851
Sun Apr 13 17:14:44 2014
Archived Log entry 17 added for thread 2 sequence 236 ID 0xf2676426 dest 1:
Mon Apr 14 00:59:23 2014
RFS[2]: Selected log 206 for thread 2 sequence 238 dbid -228094423 branch 837639851
Mon Apr 14 00:59:23 2014
Archived Log entry 18 added for thread 2 sequence 237 ID 0xf2676426 dest 1:
Mon Apr 14 08:17:26 2014
RFS[2]: Selected log 207 for thread 2 sequence 239 dbid -228094423 branch 837639851
Mon Apr 14 08:17:26 2014
Archived Log entry 19 added for thread 2 sequence 238 ID 0xf2676426 dest 1:


从看不到有节点1的归档信息

节点1 日志


Sun Apr 13 14:00:52 2014
Archived Log entry 558 added for thread 1 sequence 311 ID 0xf2676426 dest 1:
Sun Apr 13 22:00:22 2014
Thread 1 advanced to log sequence 313 (LGWR switch)
  Current log# 101 seq# 313 mem# 0: +ORADATA/xhdb/onlinelog/group_101.273.843253809
Sun Apr 13 22:00:24 2014
Archived Log entry 561 added for thread 1 sequence 312 ID 0xf2676426 dest 1:
Mon Apr 14 02:00:00 2014
Closing scheduler window
Closing Resource Manager plan via scheduler window
Clearing Resource Manager plan via parameter
Mon Apr 14 07:00:37 2014
Thread 1 advanced to log sequence 314 (LGWR switch)
  Current log# 103 seq# 314 mem# 0: +ORADATA/xhdb/onlinelog/group_103.271.843254831
Mon Apr 14 07:00:38 2014
Archived Log entry 564 added for thread 1 sequence 313 ID 0xf2676426 dest 1:
Mon Apr 14 08:11:46 2014
Thread 1 advanced to log sequence 315 (LGWR switch)
  Current log# 104 seq# 315 mem# 0: +ORADATA/xhdb/onlinelog/group_104.272.843254997
Mon Apr 14 08:11:47 2014
Archived Log entry 565 added for thread 1 sequence 314 ID 0xf2676426 dest 1:

也看不到报错;

节点2 日志


Sun Apr 13 06:00:29 2014
Archived Log entry 552 added for thread 2 sequence 234 ID 0xf2676426 dest 1:
Sun Apr 13 10:00:52 2014
LGWR: Standby redo logfile selected for thread 2 sequence 236 for destination LOG_ARCHIVE_DEST_2
Thread 2 advanced to log sequence 236 (LGWR switch)
  Current log# 201 seq# 236 mem# 0: +ORADATA/xhdb/onlinelog/group_201.274.843253825
Sun Apr 13 10:00:53 2014
Archived Log entry 557 added for thread 2 sequence 235 ID 0xf2676426 dest 1:
Sun Apr 13 17:14:43 2014
LGWR: Standby redo logfile selected for thread 2 sequence 237 for destination LOG_ARCHIVE_DEST_2
Thread 2 advanced to log sequence 237 (LGWR switch)
  Current log# 203 seq# 237 mem# 0: +ORADATA/xhdb/onlinelog/group_203.269.843254957
Sun Apr 13 17:14:44 2014
Archived Log entry 560 added for thread 2 sequence 236 ID 0xf2676426 dest 1:
Mon Apr 14 00:59:22 2014
LGWR: Standby redo logfile selected for thread 2 sequence 238 for destination LOG_ARCHIVE_DEST_2
Thread 2 advanced to log sequence 238 (LGWR switch)
  Current log# 204 seq# 238 mem# 0: +ORADATA/xhdb/onlinelog/group_204.270.843255007
Mon Apr 14 00:59:23 2014
Archived Log entry 563 added for thread 2 sequence 237 ID 0xf2676426 dest 1:
Mon Apr 14 02:00:00 2014
Closing Resource Manager plan via scheduler window
Clearing Resource Manager plan via parameter
Mon Apr 14 08:17:24 2014
LGWR: Standby redo logfile selected for thread 2 sequence 239 for destination LOG_ARCHIVE_DEST_2
Thread 2 advanced to log sequence 239 (LGWR switch)
  Current log# 205 seq# 239 mem# 0: +ORADATA/xhdb/onlinelog/group_205.266.843255017
Mon Apr 14 08:17:25 2014
Archived Log entry 567 added for thread 2 sequence 238 ID 0xf2676426 dest 1:




从节点2的日志看出比节点1 多了一条
LGWR: Standby redo logfile selected for thread 2 sequence 238 for destination LOG_ARCHIVE_DEST_2



回复 只看该作者 道具 举报

8#
发表于 2014-4-15 09:57:56
上面的问题已解决;
把运行重做传输服务传log_archive_dest_state 关闭然后在打开就,日志就能穿送到DG 备库了;

回复 只看该作者 道具 举报

9#
发表于 2014-4-15 10:03:30
新的问题又出现了:
备库应用归档:
SQL> alter database recover managed standby database using current logfile disconnect from session;

Database altered.



备库日志中有许多报错

Tue Apr 15 08:37:58 2014
alter database recover managed standby database using current logfile disconnect from session
Attempt to start background Managed Standby Recovery process (mydb)
Tue Apr 15 08:37:58 2014
MRP0 started with pid=38, OS id=9738
MRP0: Background Managed Standby Recovery process started (mydb)
Serial Media Recovery started
Managed Standby Recovery starting Real Time Apply
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 101 of thread 1
ORA-00312: online log 101 thread 1: '+ORADATA/mydb/onlinelog/group_101.273.843253809'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_101.273.843253809
ORA-15012: ASM file '+ORADATA/mydb/onlinelog/group_101.273.843253809' does not exist
Clearing online redo logfile 101 +ORADATA/mydb/onlinelog/group_101.273.843253809
Clearing online log 101 of thread 1 sequence number 324
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 101 of thread 1
ORA-00312: online log 101 thread 1: '+ORADATA/mydb/onlinelog/group_101.273.843253809'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_101.273.843253809
ORA-15173: entry 'group_101.273.843253809' does not exist in directory 'onlinelog'
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 101 of thread 1
ORA-00312: online log 101 thread 1: '+ORADATA/mydb/onlinelog/group_101.273.843253809'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_101.273.843253809
ORA-15173: entry 'group_101.273.843253809' does not exist in directory 'onlinelog'
Deleted Oracle managed file +ORADATA/mydb/onlinelog/group_101.273.843253809
Completed: alter database recover managed standby database using current logfile disconnect from session
Clearing online redo logfile 101 complete
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 102 of thread 1
ORA-00312: online log 102 thread 1: '+ORADATA/mydb/onlinelog/group_102.275.843253833'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_102.275.843253833
ORA-15012: ASM file '+ORADATA/mydb/onlinelog/group_102.275.843253833' does not exist
Clearing online redo logfile 102 +ORADATA/mydb/onlinelog/group_102.275.843253833
Clearing online log 102 of thread 1 sequence number 323
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 102 of thread 1
ORA-00312: online log 102 thread 1: '+ORADATA/mydb/onlinelog/group_102.275.843253833'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_102.275.843253833
ORA-15173: entry 'group_102.275.843253833' does not exist in directory 'onlinelog'
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 102 of thread 1
ORA-00312: online log 102 thread 1: '+ORADATA/mydb/onlinelog/group_102.275.843253833'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_102.275.843253833
ORA-15173: entry 'group_102.275.843253833' does not exist in directory 'onlinelog'
Deleted Oracle managed file +ORADATA/mydb/onlinelog/group_102.275.843253833
Clearing online redo logfile 102 complete
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 103 of thread 1
ORA-00312: online log 103 thread 1: '+ORADATA/mydb/onlinelog/group_103.271.843254831'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_103.271.843254831
ORA-15012: ASM file '+ORADATA/mydb/onlinelog/group_103.271.843254831' does not exist
Clearing online redo logfile 103 +ORADATA/mydb/onlinelog/group_103.271.843254831
Clearing online log 103 of thread 1 sequence number 324
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 103 of thread 1
ORA-00312: online log 103 thread 1: '+ORADATA/mydb/onlinelog/group_103.271.843254831'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_103.271.843254831
ORA-15173: entry 'group_103.271.843254831' does not exist in directory 'onlinelog'
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 103 of thread 1
ORA-00312: online log 103 thread 1: '+ORADATA/mydb/onlinelog/group_103.271.843254831'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_103.271.843254831
ORA-15173: entry 'group_103.271.843254831' does not exist in directory 'onlinelog'
Deleted Oracle managed file +ORADATA/mydb/onlinelog/group_103.271.843254831
Tue Apr 15 08:38:09 2014
Clearing online redo logfile 103 complete
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 104 of thread 1
ORA-00312: online log 104 thread 1: '+ORADATA/mydb/onlinelog/group_104.272.843254997'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_104.272.843254997
ORA-15012: ASM file '+ORADATA/mydb/onlinelog/group_104.272.843254997' does not exist
Clearing online redo logfile 104 +ORADATA/mydb/onlinelog/group_104.272.843254997
Clearing online log 104 of thread 1 sequence number 321
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 104 of thread 1
ORA-00312: online log 104 thread 1: '+ORADATA/mydb/onlinelog/group_104.272.843254997'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_104.272.843254997
ORA-15173: entry 'group_104.272.843254997' does not exist in directory 'onlinelog'
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 104 of thread 1
ORA-00312: online log 104 thread 1: '+ORADATA/mydb/onlinelog/group_104.272.843254997'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_104.272.843254997
ORA-15173: entry 'group_104.272.843254997' does not exist in directory 'onlinelog'
Deleted Oracle managed file +ORADATA/mydb/onlinelog/group_104.272.843254997
Clearing online redo logfile 104 complete
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 105 of thread 1
ORA-00312: online log 105 thread 1: '+ORADATA/mydb/onlinelog/group_105.267.843255011'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_105.267.843255011
ORA-15012: ASM file '+ORADATA/mydb/onlinelog/group_105.267.843255011' does not exist
Clearing online redo logfile 105 +ORADATA/mydb/onlinelog/group_105.267.843255011
Clearing online log 105 of thread 1 sequence number 322
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 105 of thread 1
ORA-00312: online log 105 thread 1: '+ORADATA/mydb/onlinelog/group_105.267.843255011'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_105.267.843255011
ORA-15173: entry 'group_105.267.843255011' does not exist in directory 'onlinelog'
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 105 of thread 1
ORA-00312: online log 105 thread 1: '+ORADATA/mydb/onlinelog/group_105.267.843255011'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_105.267.843255011
ORA-15173: entry 'group_105.267.843255011' does not exist in directory 'onlinelog'
Deleted Oracle managed file +ORADATA/mydb/onlinelog/group_105.267.843255011
Clearing online redo logfile 105 complete
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:

回复 只看该作者 道具 举报

10#
发表于 2014-4-15 10:03:53
xia 发表于 2014-4-15 10:03
新的问题又出现了:
备库应用归档:
SQL> alter database recover managed standby database using current ...

ORA-00313: open failed for members of log group 201 of thread 2
ORA-00312: online log 201 thread 2: '+ORADATA/mydb/onlinelog/group_201.274.843253825'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_201.274.843253825
ORA-15012: ASM file '+ORADATA/mydb/onlinelog/group_201.274.843253825' does not exist
Clearing online redo logfile 201 +ORADATA/mydb/onlinelog/group_201.274.843253825
Clearing online log 201 of thread 2 sequence number 242
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 201 of thread 2
ORA-00312: online log 201 thread 2: '+ORADATA/mydb/onlinelog/group_201.274.843253825'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_201.274.843253825
ORA-15173: entry 'group_201.274.843253825' does not exist in directory 'onlinelog'
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 201 of thread 2
ORA-00312: online log 201 thread 2: '+ORADATA/mydb/onlinelog/group_201.274.843253825'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_201.274.843253825
ORA-15173: entry 'group_201.274.843253825' does not exist in directory 'onlinelog'
Deleted Oracle managed file +ORADATA/mydb/onlinelog/group_201.274.843253825
Clearing online redo logfile 201 complete
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 202 of thread 2
ORA-00312: online log 202 thread 2: '+ORADATA/mydb/onlinelog/group_202.276.843253839'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_202.276.843253839
ORA-15012: ASM file '+ORADATA/mydb/onlinelog/group_202.276.843253839' does not exist
Clearing online redo logfile 202 +ORADATA/mydb/onlinelog/group_202.276.843253839
Clearing online log 202 of thread 2 sequence number 245
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 202 of thread 2
ORA-00312: online log 202 thread 2: '+ORADATA/mydb/onlinelog/group_202.276.843253839'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_202.276.843253839
ORA-15173: entry 'group_202.276.843253839' does not exist in directory 'onlinelog'
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 202 of thread 2
ORA-00312: online log 202 thread 2: '+ORADATA/mydb/onlinelog/group_202.276.843253839'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_202.276.843253839
ORA-15173: entry 'group_202.276.843253839' does not exist in directory 'onlinelog'
Deleted Oracle managed file +ORADATA/mydb/onlinelog/group_202.276.843253839
Tue Apr 15 08:38:21 2014
Clearing online redo logfile 202 complete
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 203 of thread 2
ORA-00312: online log 203 thread 2: '+ORADATA/mydb/onlinelog/group_203.269.843254957'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_203.269.843254957
ORA-15012: ASM file '+ORADATA/mydb/onlinelog/group_203.269.843254957' does not exist
Clearing online redo logfile 203 +ORADATA/mydb/onlinelog/group_203.269.843254957
Clearing online log 203 of thread 2 sequence number 243
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 203 of thread 2
ORA-00312: online log 203 thread 2: '+ORADATA/mydb/onlinelog/group_203.269.843254957'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_203.269.843254957
ORA-15173: entry 'group_203.269.843254957' does not exist in directory 'onlinelog'
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 203 of thread 2
ORA-00312: online log 203 thread 2: '+ORADATA/mydb/onlinelog/group_203.269.843254957'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_203.269.843254957
ORA-15173: entry 'group_203.269.843254957' does not exist in directory 'onlinelog'
Deleted Oracle managed file +ORADATA/mydb/onlinelog/group_203.269.843254957
Clearing online redo logfile 203 complete
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 204 of thread 2
ORA-00312: online log 204 thread 2: '+ORADATA/mydb/onlinelog/group_204.270.843255007'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_204.270.843255007
ORA-15012: ASM file '+ORADATA/mydb/onlinelog/group_204.270.843255007' does not exist
Clearing online redo logfile 204 +ORADATA/mydb/onlinelog/group_204.270.843255007
Clearing online log 204 of thread 2 sequence number 244
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 204 of thread 2
ORA-00312: online log 204 thread 2: '+ORADATA/mydb/onlinelog/group_204.270.843255007'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_204.270.843255007
ORA-15173: entry 'group_204.270.843255007' does not exist in directory 'onlinelog'
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 204 of thread 2
ORA-00312: online log 204 thread 2: '+ORADATA/mydb/onlinelog/group_204.270.843255007'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_204.270.843255007
ORA-15173: entry 'group_204.270.843255007' does not exist in directory 'onlinelog'
Deleted Oracle managed file +ORADATA/mydb/onlinelog/group_204.270.843255007
Clearing online redo logfile 204 complete
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 205 of thread 2
ORA-00312: online log 205 thread 2: '+ORADATA/mydb/onlinelog/group_205.266.843255017'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_205.266.843255017
ORA-15012: ASM file '+ORADATA/mydb/onlinelog/group_205.266.843255017' does not exist
Clearing online redo logfile 205 +ORADATA/mydb/onlinelog/group_205.266.843255017
Clearing online log 205 of thread 2 sequence number 245
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 205 of thread 2
ORA-00312: online log 205 thread 2: '+ORADATA/mydb/onlinelog/group_205.266.843255017'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_205.266.843255017
ORA-15173: entry 'group_205.266.843255017' does not exist in directory 'onlinelog'
Errors in file /u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_mrp0_9738.trc:
ORA-00313: open failed for members of log group 205 of thread 2
ORA-00312: online log 205 thread 2: '+ORADATA/mydb/onlinelog/group_205.266.843255017'
ORA-17503: ksfdopn:2 Failed to open file +ORADATA/mydb/onlinelog/group_205.266.843255017
ORA-15173: entry 'group_205.266.843255017' does not exist in directory 'onlinelog'
Deleted Oracle managed file +ORADATA/mydb/onlinelog/group_205.266.843255017
Clearing online redo logfile 205 complete
Media Recovery Waiting for thread 1 sequence 293
Fetching gap sequence in thread 1, gap sequence 293-314
Tue Apr 15 08:40:18 2014

FAL[client]: Failed to request gap sequence
GAP - thread 1 sequence 293-314
DBID 4066872873 branch 837639851
FAL[client]: All defined FAL servers have been attempted.
------------------------------------------------------------
Check that the CONTROL_FILE_RECORD_KEEP_TIME initialization
parameter is defined to a value that's sufficiently large
enough to maintain adequate log switch information to resolve
archivelog gaps.
------------------------------------------------------------


回复 只看该作者 道具 举报

11#
发表于 2014-4-15 13:32:55
请问 :
在备库的gap 中发现节点1的293-314的归档没有传递到DG备库,而在主库上又找不到这几个归档 ,该怎么办?难道主库在重新生成控制文件和全备在传递到备库么?

dg:

SQL> select * from v$archive_gap;

   THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#
---------- ------------- --------------
         1           294            314

主库
SQL> select name from v$archived_log where thread#=1 and dest_id=1 and sequence# between 294 and 314;

NAME
----------------------------------------------------------------------------------------------------






















21 rows selected.

SQL>

回复 只看该作者 道具 举报

12#
发表于 2014-4-15 16:02:58
log_file_name_convert

Using LOG_FILE_NAME_CONVERT to Generate Names for Non-OMF or ASM Log Files

If the LOG_FILE clause has been omitted and none of the Oracle Managed Files initialization parameters DB_CREATE_FILE_DEST, DB_CREATE_ONLINE_DEST_n, or DB_RECOVERY_FILE_DEST are specified, then LOG_FILE_NAME_CONVERT can transforms target file names. This works in much the same way as the DB_FILE_NAME_CONVERT and can transform target file names from log_* to duplog_*. You can specify multiple conversion file name pairs with this parameter.

When you specify LOG_FILE_NAME_CONVERT, RMAN uses the REUSE parameter when creating the online redo logs. If an online redo log file already exists at the named location and is of the correct size, then it is reused for the duplicate.

Restrictions of LOG_FILE_NAME_CONVERT:
Do not specify LOG_FILE_NAME_CONVERT if you set Oracle Managed Files initialization parameters.

LOG_FILE_NAME_CONVERT cannot be specified as a DUPLICATE clause, it can only be specified in the initialization parameter of the auxiliary instance.

You cannot use the LOG_FILE_NAME_CONVERT initialization parameter to control generation of new names for files at the duplicate instance that are in the Oracle Managed Files (OMF) format at the source database instance.

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-6-15 00:06 , Processed in 0.056147 second(s), 20 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569