码迷,mamicode.com
首页 > 其他好文 > 详细

rman 异地恢复过程日志

时间:2019-05-24 10:51:22      阅读:75      评论:0      收藏:0      [点我收藏+]

标签:done   lease   ack   copyright   mes   中国   smo   恢复   ram   

[oracle@169_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
[oracle@169_test ~]$ cd $ORACLE_HOME/dbs
[oracle@169_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
[oracle@169_test dbs]$ rm c-1190123479-2019052
c-1190123479-20190522-07 c-1190123479-20190523-03
[oracle@169_test dbs]$ rm c-1190123479-2019052*
[oracle@169_test dbs]$ rm spfileTSH1.ora
[oracle@169_test dbs]$ rm snapcf_TSH1.f
[oracle@169_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
[oracle@169_test dbs]$ rm hc_TSH1.dat
[oracle@169_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
[oracle@169_test dbs]$ cat lkORCL10G
DO NOT DELETE THIS FILE![oracle@169_test dbs]$
[oracle@169_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
[oracle@169_test dbs]$ cd $ORACL_BASE
[oracle@169_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
[oracle@169_test ~]$ cd /u01/app/oracle/
admin/ flash_recovery_area/ oradata/ oraInventory/ product/
[oracle@169_test ~]$ cd /u01/app/oracle/oradata/
[oracle@169_test oradata]$ ll
总用量 0
drwxr-xr-x 2 oracle oinstall 221 5月 23 11:08 orcl10g
[oracle@169_test oradata]$ cd orcl10g/
[oracle@169_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
[oracle@169_test orcl10g]$ rm -f .
[oracle@169_test orcl10g]$ ll
总用量 0
[oracle@169_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.
[oracle@169_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
[oracle@169_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

rman 异地恢复过程日志

标签:done   lease   ack   copyright   mes   中国   smo   恢复   ram   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!