您的位置:首页 > 数据库 > Oracle

Oracle 10g rac将归档日志从文件系统拷贝至ASM磁盘组

2017-11-24 10:35 711 查看
1、数据库版本

SQL> select * from v$version;

BANNER

----------------------------------------------------------------

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi

PL/SQL Release 10.2.0.5.0 - Production

CORE    10.2.0.5.0      Production

TNS for Linux: Version 10.2.0.5.0 - Production

NLSRTL Version 10.2.0.5.0 - Production

2、从备份中恢复归档日志

RMAN> run {

2> set archivelog destination to '/dbbackup/';

3> SQL 'ALTER SESSION SET NLS_DATE_FORMAT="YYYY-MM-DD:HH24:MI:SS"';

4> restore archivelog sequence 191446 thread 1;

5> } 

executing command: SET ARCHIVELOG DESTINATION

using target database control file instead of recovery catalog

sql statement: ALTER SESSION SET NLS_DATE_FORMAT="YYYY-MM-DD:HH24:MI:SS"

Starting restore at 24-117

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=1247 instance=webdb1 devtype=DISK

channel ORA_DISK_1: starting archive log restore to user-specified destination

archive log destination=/dbbackup/

channel ORA_DISK_1: restoring archive log

archive log thread=1 sequence=191446

channel ORA_DISK_1: reading from backup piece /dbbackup/webdb/archivelog_odska9a4_1_1.20171123

channel ORA_DISK_1: restored backup piece 1

piece handle=/dbbackup/webdb/archivelog_odska9a4_1_1.20171123 tag=TAG20171123T180027

channel ORA_DISK_1: restore complete, elapsed time: 00:08:25

Finished restore at 24-117

3、检查归档日志下的归档日志

/home/oracle@webrac1=>webdb1$cd /dbbackup/

/dbbackup@webrac1=>webdb1$ls

1_191446_774905290.dbf  datapump  lost+found  webdb

/dbbackup@webrac1=>webdb1$export ORACLE_SID=+ASM1

/dbbackup@webrac1=>+ASM1$asmcmd

ASMCMD> ls

DG/

DG1/

DG2/

ASMCMD> cd DG1     

ASMCMD> ls    

WEBDB/

ASMCMD> cd webdb

ASMCMD> ls

ARCHIVELOG/

DATAFILE/

ASMCMD> cd archivelog

ASMCMD> ls

2017_11_23/

2017_11_24/

ASMCMD> cd 2017_11_23

ASMCMD> ls

thread_1_seq_191447.448.960836171

thread_1_seq_191448.2790.960839761

thread_1_seq_191449.2005.960839809

thread_1_seq_191450.3934.960846973

thread_1_seq_191451.3983.960848653

thread_1_seq_191452.2160.960850567

thread_2_seq_77167.1155.960839763

thread_2_seq_77168.4631.960843379

thread_2_seq_77169.1853.960850569

thread_3_seq_75117.520.960839811

thread_3_seq_75118.3924.960850571

thread_3_seq_75119.1698.960854181

ASMCMD> 

ASMCMD> pwd

+DG1/webdb/archivelog/2017_11_23

ASMCMD> 

4、将归档日志从文件系统拷贝至ASM磁盘组

RMAN> copy archivelog '/dbbackup/1_191446_774905290.dbf' to '+DG1/webdb/archivelog/2017_11_23/1_191446_774905290.dbf';

Starting backup at 24-117

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=1252 instance=webdb1 devtype=DISK

channel ORA_DISK_1: starting archive copy

input archive log thread=1 sequence=191446 recid=1000981 stamp=960891464

output filename=+DG1/webdb/archivelog/2017_11_23/1_191446_774905290.dbf recid=1000982 stamp=960891835

channel ORA_DISK_1: archivelog copy complete, elapsed time: 00:00:26

Finished backup at 24-117

Starting Control File and SPFILE Autobackup at 24-117

piece handle=/dbbackup/webdb/c-3243882293-20171124-00 comment=NONE

Finished Control File and SPFILE Autobackup at 24-117

RMAN> 

6、检查确认拷贝后的文件

+DG1/webdb/archivelog/2017_11_23

ASMCMD> ls                              

1_191446_774905290.dbf

thread_1_seq_191447.448.960836171

thread_1_seq_191448.2790.960839761

thread_1_seq_191449.2005.960839809

thread_1_seq_191450.3934.960846973

thread_1_seq_191451.3983.960848653

thread_1_seq_191452.2160.960850567

thread_2_seq_77167.1155.960839763

thread_2_seq_77168.4631.960843379

thread_2_seq_77169.1853.960850569

thread_3_seq_75117.520.960839811

thread_3_seq_75118.3924.960850571

thread_3_seq_75119.1698.960854181

7、在控制文件中注册该归档日志

RMAN> catalog start with '+DG1/webdb/archivelog/2017_11_23/1_191446_774905290.dbf';

searching for all files that match the pattern +DG1/webdb/archivelog/2017_11_23/1_191446_774905290.dbf

no files found to be unknown to the database

RMAN> catalog start with '+DG1/webdb/archivelog/2017_11_23';

searching for all files that match the pattern +DG1/webdb/archivelog/2017_11_23

no files found to be unknown to the database

RMAN> catalog archivelog '+DG1/webdb/archivelog/2017_11_23/1_191446_774905290.dbf';

cataloged archive log

archive log filename=+DG1/webdb/archivelog/2017_11_23/1_191446_774905290.dbf recid=1000983 stamp=960891958

RMAN> 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐