分类: Oracle
2008-04-11 17:36:04
SQL> select process, status, thread#, sequence#, block#, blocks from v$managed_standby;
PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS
----------------------------------------------------------------------------------------------------------------------ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
MRP0 WAIT_FOR_GAP 1 4028 0 0
RFS IDLE 1 4105 155073 2019
RFS IDLE 2 3900 120829 171
SQL> select * from v$archive_gap;
THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#
--------------------- ---------------------- ---------------------------------------
1 4028 4028
SQL> select * from v$archived_log where sequence#=4028;
no rows selected
说明备库缺少 sequence# = 4028 的归档日志,需要手工从主库拷贝到备机,并在备库中注册
主库操作
SQL> select name from v$archived_log where thread#=1 and sequence#=4028;
NAME
--------------------------------------------------------------------------------------------------------
+WARCH1/swrac/archivelog/2008_04_03/thread_1_seq_4028.341.651024283
主库操作
SQL> set wrap off
SQL> col owner for a10
SQL> col directory_name for a20
SQL> select * from dba_directories;
OWNER DIRECTORY_NAME DIRECTORY_PATH
---------- -------------------- ------------------------------------------------
SYS SOURCEDIR +WARCH2/swrac/archivelog/2008_04_08
SYS DP_DIR /backup/dp_dir
SYS DPDIR /backup/expdp0201
SYS DPDATA /backup/dpdata
SYS WORK_DIR /oracle/oracle/product/
SYS TEST_DIR /oracle/oracle/product/
SYS ADMIN_DIR /oracle/oracle/product/
SYS DATA_PUMP_DIR /oracle/oracle/product/
8 rows selected.
SQL> create directory asm_dir as '+WARCH1/swrac/archivelog/2008_04_03';
SQL>
begin dbms_file_transfer.copy_file('asm_dir','thread_1_seq_4028.341.651024283','dp_dir','thread_1_seq_4028.341.651024283');
end;
/
将此文件压缩后传到备机
$ scp thread_1_seq_4028.341.651024283.tar.gz
在备库上手工注册从主库拷贝来的日志
SQL> alter database register logfile '/backup/new/thread_1_seq_4028.341.651024283';
Database altered.