rman 异地恢复过程日志

[[email protected]_test ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Fri May 24 10:07:51 2019

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[[email protected]_test ~]$ cd $ORACLE_HOME/dbs
[[email protected]_test dbs]$ ll
总用量 20892
-rw-r----- 1 oracle oinstall 7143424 5月 22 19:19 c-1190123479-20190522-07
-rw-r----- 1 oracle oinstall 7143424 5月 23 11:08 c-1190123479-20190523-03
-rw-rw---- 1 oracle oinstall 1552 5月 24 10:08 hc_TSH1.dat
-rw-rw---- 1 oracle oinstall 12920 5月 3 2001 initdw.ora
-rw-rw---- 1 oracle oinstall 8387 5月 22 19:08 init.ora
-rw-rw---- 1 oracle oinstall 24 5月 22 19:16 lkORCL10G
-rw-r----- 1 oracle oinstall 1536 5月 22 19:00 orapworcl
-rw-r----- 1 oracle oinstall 7061504 5月 23 11:08 snapcf_TSH1.f
-rw-r----- 1 oracle oinstall 3584 5月 23 11:04 spfileTSH1.ora
[[email protected]_test dbs]$ rm c-1190123479-2019052
c-1190123479-20190522-07 c-1190123479-20190523-03
[[email protected]_test dbs]$ rm c-1190123479-2019052*
[[email protected]_test dbs]$ rm spfileTSH1.ora
[[email protected]_test dbs]$ rm snapcf_TSH1.f
[[email protected]_test dbs]$ ll
总用量 40
-rw-rw---- 1 oracle oinstall 1552 5月 24 10:08 hc_TSH1.dat
-rw-rw---- 1 oracle oinstall 12920 5月 3 2001 initdw.ora
-rw-rw---- 1 oracle oinstall 8387 5月 22 19:08 init.ora
-rw-rw---- 1 oracle oinstall 24 5月 22 19:16 lkORCL10G
-rw-r----- 1 oracle oinstall 1536 5月 22 19:00 orapworcl
[[email protected]_test dbs]$ rm hc_TSH1.dat
[[email protected]_test dbs]$ ll
总用量 36
-rw-rw---- 1 oracle oinstall 12920 5月 3 2001 initdw.ora
-rw-rw---- 1 oracle oinstall 8387 5月 22 19:08 init.ora
-rw-rw---- 1 oracle oinstall 24 5月 22 19:16 lkORCL10G
-rw-r----- 1 oracle oinstall 1536 5月 22 19:00 orapworcl
[[email protected]_test dbs]$ cat lkORCL10G
DO NOT DELETE THIS FILE![[email protected]9_test dbs]$
[[email protected]_test dbs]$ ll
总用量 36
-rw-rw---- 1 oracle oinstall 12920 5月 3 2001 initdw.ora
-rw-rw---- 1 oracle oinstall 8387 5月 22 19:08 init.ora
-rw-rw---- 1 oracle oinstall 24 5月 22 19:16 lkORCL10G
-rw-r----- 1 oracle oinstall 1536 5月 22 19:00 orapworcl
[[email protected]_test dbs]$ cd $ORACL_BASE
[[email protected]_test ~]$ ll
总用量 782848
-rw-r--r-- 1 oracle oinstall 801603584 4月 16 09:09 10201_database_linux_x86_64.cpio
drwxr-xr-x 6 oracle oinstall 101 10月 23 2005 database
-rw-r--r-- 1 oracle oinstall 16444 4月 16 11:45 dbca.rsp
-rw-r--r-- 1 oracle oinstall 920 4月 16 11:24 enterprise01.rsp
-rw-r--r-- 1 oracle oinstall 5742 4月 16 11:49 netca.rsp
[[email protected]_test ~]$ cd /u01/app/oracle/
admin/ flash_recovery_area/ oradata/ oraInventory/ product/
[[email protected]_test ~]$ cd /u01/app/oracle/oradata/
[[email protected]_test oradata]$ ll
总用量 0
drwxr-xr-x 2 oracle oinstall 221 5月 23 11:08 orcl10g
[[email protected]_test oradata]$ cd orcl10g/
[[email protected]_test orcl10g]$ ll
总用量 1078636
-rw-r----- 1 oracle oinstall 7061504 5月 24 10:08 control01.ctl
-rw-r----- 1 oracle oinstall 7061504 5月 24 10:08 control02.ctl
-rw-r----- 1 oracle oinstall 7061504 5月 24 10:08 control03.ctl
-rw-r----- 1 oracle oinstall 52429312 5月 24 10:08 redo01.log
-rw-r----- 1 oracle oinstall 52429312 5月 23 11:08 redo02.log
-rw-r----- 1 oracle oinstall 52429312 5月 24 01:00 redo03.log
-rw-r----- 1 oracle oinstall 367009792 5月 24 10:08 sysaux01.dbf
-rw-r----- 1 oracle oinstall 513810432 5月 24 10:08 system01.dbf
-rw-r----- 1 oracle oinstall 20979712 5月 23 22:00 temp01.dbf
-rw-r----- 1 oracle oinstall 26222592 5月 24 10:08 undotbs01.dbf
-rw-r----- 1 oracle oinstall 18358272 5月 24 10:08 users01.dbf
[[email protected]_test orcl10g]$ rm -f .
[[email protected]_test orcl10g]$ ll
总用量 0
[[email protected]_test orcl10g]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Fri May 24 10:12:31 2019

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database (not started)

RMAN> startup nomount;

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file ‘/u01/app/oracle/product/10.2.0/db_1/dbs/initTSH1.ora‘

starting Oracle instance without parameter file for retrival of spfile
Oracle instance started

Total System Global Area 159383552 bytes

Fixed Size 2019224 bytes
Variable Size 67108968 bytes
Database Buffers 83886080 bytes
Redo Buffers 6369280 bytes

RMAN> restore spfile from ‘/u01/app/backup/c-1190123479-20190523-02‘;

Starting restore at 24-MAY-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK

channel ORA_DISK_1: autobackup found: /u01/app/backup/c-1190123479-20190523-02
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 24-MAY-19

RMAN> shutdown immediate;

Oracle instance shut down

RMAN> startup nomount;

connected to target database (not started)
Oracle instance started

Total System Global Area 1224736768 bytes

Fixed Size 2020384 bytes
Variable Size 369101792 bytes
Database Buffers 838860800 bytes
Redo Buffers 14753792 bytes

RMAN> restore controlfile from ‘/u01/app/backup/rman_control_3iu28plf_1_1.ctl‘;

Starting restore at 24-MAY-19
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output filename=/u01/app/oracle/oradata/orcl10g/control01.ctl
output filename=/u01/app/oracle/oradata/orcl10g/control02.ctl
output filename=/u01/app/oracle/oradata/orcl10g/control03.ctl
Finished restore at 24-MAY-19

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN> crosscheck backup ;

Starting implicit crosscheck backup at 24-MAY-19
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 7 objects
Finished implicit crosscheck backup at 24-MAY-19

Starting implicit crosscheck copy at 24-MAY-19
using channel ORA_DISK_1
Finished implicit crosscheck copy at 24-MAY-19

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files

File Name: /u01/app/oracle/flash_recovery_area/ORCL10G/archivelog/2019_05_24/o1_mf_1_1ggfng8rt.arc

using channel ORA_DISK_1
crosschecked backup piece: found to be ‘AVAILABLE‘
backup piece handle=/u01/app/backup/rman_db_ORCL10G_108_20190523_1_3cu28pkm_1_1.bkupset recid=127 stamp=1009018518
crosschecked backup piece: found to be ‘AVAILABLE‘
backup piece handle=/u01/app/backup/rman_db_ORCL10G_107_20190523_1_3bu28pkm_1_1.bkupset recid=128 stamp=1009018518
crosschecked backup piece: found to be ‘AVAILABLE‘
backup piece handle=/u01/app/backup/rman_control_3du28pl5_1_1.ctl recid=129 stamp=1009018533
crosschecked backup piece: found to be ‘EXPIRED‘
backup piece handle=/u01/app/backup/skoda_spfile_3eu28pl6_1_1 recid=130 stamp=1009018534
crosschecked backup piece: found to be ‘EXPIRED‘
backup piece handle=/u01/app/oracle/product/10.2.0/db_1/dbs/c-1190123479-20190523-01 recid=131 stamp=1009018536
crosschecked backup piece: found to be ‘AVAILABLE‘
backup piece handle=/u01/app/backup/rman_arch_ORCL10G_112_20190523_1_3gu28plc_1_1.bkupset recid=132 stamp=1009018541
crosschecked backup piece: found to be ‘AVAILABLE‘
backup piece handle=/u01/app/backup/rman_arch_ORCL10G_113_20190523_1_3hu28plc_1_1.bkupset recid=133 stamp=1009018541
Crosschecked 7 objects

RMAN> crosscheck archivelog all;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
validation succeeded for archived log
archive log filename=/u01/app/oracle/flash_recovery_area/ORCL10G/archivelog/2019_05_24/o1_mf_1_1ggfng8rt.arc recid=41 stamp=1009102680
Crosschecked 1 objects

RMAN> run{
2>
3> restore database;
4>
5> recover database;
6>
7> }

Starting restore at 24-MAY-19
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /u01/app/oracle/oradata/orcl10g/undotbs01.dbf
restoring datafile 00003 to /u01/app/oracle/oradata/orcl10g/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/backup/rman_db_ORCL10G_108_20190523_1_3cu28pkm_1_1.bkupset
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/app/backup/rman_db_ORCL10G_108_20190523_1_3cu28pkm_1_1.bkupset tag=TAG20190523T105518
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/app/oracle/oradata/orcl10g/system01.dbf
restoring datafile 00004 to /u01/app/oracle/oradata/orcl10g/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/backup/rman_db_ORCL10G_107_20190523_1_3bu28pkm_1_1.bkupset
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/app/backup/rman_db_ORCL10G_107_20190523_1_3bu28pkm_1_1.bkupset tag=TAG20190523T105518
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 24-MAY-19

Starting recover at 24-MAY-19
using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 1 is already on disk as file /u01/app/oracle/flash_recovery_area/ORCL10G/archivelog/2019_05_24/o1_mf_1_1ggfng8rt.arc
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=65
channel ORA_DISK_1: reading from backup piece /u01/app/backup/rman_arch_ORCL10G_112_20190523_1_3gu28plc_1_1.bkupset
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/app/backup/rman_arch_ORCL10G_112_20190523_1_3gu28plc_1_1.bkupset tag=TAG20190523T105540
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archive log filename=/u01/app/oracle/flash_recovery_area/ORCL10G/archivelog/2019_05_24/o1_mf_1_65gggo7r1s.arc thread=1 sequence=65
channel default: deleting archive log(s)
archive log filename=/u01/app/oracle/flash_recovery_area/ORCL10G/archivelog/2019_05_24/o1_mf_1_65gggo7r1s.arc recid=42 stamp=1009102840
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=66
channel ORA_DISK_1: reading from backup piece /u01/app/backup/rman_arch_ORCL10G_113_20190523_1_3hu28plc_1_1.bkupset
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/app/backup/rman_arch_ORCL10G_113_20190523_1_3hu28plc_1_1.bkupset tag=TAG20190523T105540
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
archive log filename=/u01/app/oracle/flash_recovery_area/ORCL10G/archivelog/2019_05_24/o1_mf_1_66gggo7t5o.arc thread=1 sequence=66
archive log filename=/u01/app/oracle/flash_recovery_area/ORCL10G/archivelog/2019_05_24/o1_mf_1_1ggfng8rt.arc thread=1 sequence=1
channel default: deleting archive log(s)
archive log filename=/u01/app/oracle/flash_recovery_area/ORCL10G/archivelog/2019_05_24/o1_mf_1_66gggo7t5o.arc recid=43 stamp=1009102842
unable to find archive log
archive log thread=1 sequence=2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 05/24/2019 10:21:09
RMAN-06054: media recovery requesting unknown log: thread 1 seq 2 lowscn 2003505

RMAN> alter database open resetlogs;

database opened

RMAN> exit

Recovery Manager complete.
[[email protected]_test orcl10g]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Fri May 24 10:22:44 2019

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> conn test/test;
Connected.
SQL> *select from test;**

    ID

NAME

     2

美国

     3

德国

     4

英国

    ID

NAME

     1

中国

SQL> shutdown immediate;
ORA-01031: insufficient privileges
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[[email protected]_test orcl10g]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Fri May 24 10:23:44 2019

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE instance started.

Total System Global Area 1224736768 bytes
Fixed Size 2020384 bytes
Variable Size 369101792 bytes
Database Buffers 838860800 bytes
Redo Buffers 14753792 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

原文地址:https://blog.51cto.com/860143/2399420

时间: 2024-09-30 16:41:53

rman 异地恢复过程日志的相关文章

使用rman异地恢复数据库试验(RAC恢复到单实例数据库)

前言 rman在实际应用中用到的不多,很多时候一个项目开始设置好备份策略,后续基本上都用不到了,除非数据库出现异常,可以说,rman是一个不常用但是却非常重要的技能,但是又非常容易忘记.为了不在关键时刻掉链子,做了一个rman异地恢复数据库的试验. 试验环境介绍 操作系统 数据库版本 RAC? 源系统 CentOS 6.3 x64 11.2.0.4 2节点 目标系统 RedHat 6.4 x64 11.2.0.4 单节点 Rman备份: 0级数据库全备 操作步骤 将rman备份文件从源库上面拷贝

oracle数据库rman异地恢复

自己想做两组rac之间的data guard,由于datafile,controlfile,甚至是archivelog都是存放在asm上的,直接复制数据有点不现实,asm磁盘总归都是要用的,所以想从a库做rman全备份,然后把备份文件拷贝到b库上做rman恢复,初衷就是这么简单,结果却遇到了n多的折腾,无法实现,下面是我自己经过无数次测试得到的方法. oracle版本:11.2.0.0 第一组RAC A PS:前面的hostname,冒号后面是instancenamerac1:orcl1rac2

RMAN数据库恢复之恢复归档日志文件

恢复归档日志文件如果只是为了在恢复数据文件之后应用归档文件,那并不需要手动对归档文件进行恢复,RMAN会在RECOVER时自动对适当的归档进行恢复.单独恢复归档文件一般是有特别的需求,如创建了Data Guard环境.Standby端丢失了部分归档文件,需要从Primary端重新获取.1.恢复全部归档日志文件RMAN> RESTORE ARCHIVELOG ALL; 2.恢复归档序号为20至30之间的归档文件RMAN> RESTOER ARCHIVELOG SEQUENCE BETWEEN 2

记录SQL Server2008日志文件损坏的恢复过程

记录SQL Server2008日志文件损坏的恢复过程: 环境:系统Windows Server2003 数据库SQL Server2008 故障原因:通过mstsc链接同一服务器时,用户界面不一致.决定重启服务器,未正确关闭应用程序的情况下(程序在访问数据库),导致数据库日志文件损坏,自然也就无法访问mdf文件!(都是微软自家的产品,重启服务器为什么不能检查数据库的状态,将数据库设置在安全状态后在重启呢??所以,要养成良好的习惯.关闭现有数据库链接,再重启服务器) 故障表现:无法访问数据文件,

[转]Oracle DB 使用RMAN执行恢复

? 在丢失关键或非关键数据文件后执行完全恢复 ? 使用增量更新的备份进行恢复 ? 切换到映像副本进行快速恢复 ? 将数据库还原到新主机上 ? 使用备份控制文件进行恢复 使用RMAN RESTORE和RECOVER命令 ? RESTORE命令:从备份中还原数据库文件 ? RECOVER命令:通过应用增量备份和重做日志文件中记录的更改来恢复已还原文件 RMAN> SQL 'ALTER TABLESPACE inv_tbs OFFLINE IMMEDIATE'; RMAN> RESTORE TABL

Oracle RMAN备份恢复指导书

目 录 1 目的与范围... 1 2 术语和定义... 1 3 角色和职责... 2 4 使用RMAN备份数据库... 2 4.1.1 检查数据库模式... 2 4.1.2 连接到target数据库... 3 4.1.3 查看备份信息... 3 4.1.4 备份数据库... 5 4.1.5 备份数据文件... 6 4.1.6 备份表空间... 6 4.1.7 备份控制文件... 6 4.1.8 备份归档日志文件... 7 4.1.9 备份闪回区... 8 4.1.10 增量备份... 8 4.2

mysqldunp增量恢复过程及详解

Mysql增量恢复必备条件 1.开启mysql log-bin日志功能 MySQL数据库开启了log-bin 参数记录binlog日志功能下: 小结:增量恢复的条件: 存在一份全备加上全备之后的时刻到出问题时刻的所有增量binlog文件备份. 创建模拟环境 [[email protected] 3306]# grep log-bin /data/3306/my.cnf log-bin = /data/3306/mysql-bin [[email protected] 3306]# mkdir -

Oracle rman 各种恢复

--恢复整个数据库run {shutdown immediate;startup mount;restore database;recover database;alter database open;} --恢复表空间usersrun {sql 'alter tablespace users offline';restore tablespace users;recover tablespace users;sql 'alter tablespace data online';} --恢复数据

Oracle RMAN备份恢复2-案例篇_超越OCP精通Oracle视频教程培训18

oracle视频教程目标 Oracle视频教程,风哥本套oracle教程培训学习oracle数据库如何设计一个TB级数据库的RMAN备份策略,RMAN备份与恢复案例-丢失所有文件,丢失单个数据文件,丢失整个数据和system表空间,丢失控制文件和参数文件,存储损坏数据丢失,丢失REDO重做日志文件,基于时间点,scn,cancel,备份控制文件的不完成恢复案例. 适用人群 IT相关从业人员.Oracle数据库技术人员.想加工资的.想升职的都可以. 视频在线学习地址: http://edu.51c