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>
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>
相关文章推荐
- 【翻译自mos文章】在rac中,使用asmcmd命令从 文件系统 move system datafile 到asm磁盘组的方法
- Oracle 10G RAC - 归档参数格式导致归档至ASM时出错的问题
- 将Oracle数据库改为归档模式并启用RMAN备份 如下Linux环境下对Oracle单节点数据库采用文件系统情况的配置归档模式过程。首先查看数据库归档模式和磁盘使用情况,确定归档文件放到什么位置。
- oracle 12c RMAN异机恢复还原RAC集群(ASM)为单实例库(文件系统)记录
- Windows下虚拟ASM磁盘搭建基于ASM的Oracle 10g数据库系统(2)
- Windows下虚拟ASM磁盘搭建基于ASM的Oracle 10g数据库系统(3)
- Oracle 10G RAC - 某个节点上缺失某些归档日志后删除报错问题
- 11g RAC 更改归档模式 ,归档文件存放在ASM 磁盘组
- 11g RAC 更改归档模式 ,归档文件存放在ASM 磁盘组
- Oracle 10g rac+asm 磁盘头备份与恢复实验
- Aix5.3下Oracle 10g设置归档模式到文件系统
- 11g RAC 更改归档模式 ,归档文件存放在ASM 磁盘组
- Linux 5.4 + oracle 10g RAC +ASM 环境增加ASM磁盘
- oracle 10g rac standby 归档日志自动删除脚本
- 从ASM磁盘中拷贝文件到本地文件系统
- 11g RAC 更改归档模式 ,归档文件存放在ASM 磁盘组(转载)
- Windows下虚拟ASM磁盘搭建基于ASM的Oracle 10g数据库系统(1)
- RedHat EL5 安装Oracle 10g RAC之--系统环境配置(1)
- oracle 日志切换归档模式查看归档文件的产生
- Redhat 5.4 + ASM + RAW+ Oracle 10g RAC 安装文档