|
- select d.CHECKPOINT_CHANGE# ,d.NAME
- from v_$datafile d;
-
- select d.RESETLOGS_CHANGE#,
- d.CHECKPOINT_CHANGE#,
- d.CURRENT_SCN
- from v_$database d;
- alter tablespace users offline;
- alter tablespace users online;
- alter system checkpoint;
- alter tablespace users read only;
- alter tablespace users read write;
- ---------------------
- alter tablespace users begin backup;
- alter tablespace users end backup;
- ----------
- alter database datafile '+DATA/orcl/datafile/users.259.816169553' offline;
- alter database datafile '+DATA/orcl/datafile/users.259.816169553' online;
- ---------
- alter database rename file '+DATA/orcl/datafile/users.259.816169553' to
- '+data/orcl/DATAFILE/users.dbf';
- alter database datafile '+DATA/orcl/datafile/users.dbf' online;
- recover datafile '+DATA/orcl/datafile/users.dbf';
- alter database datafile '+DATA/orcl/datafile/users.dbf' online;
复制代码- alter tablespace sysaux offline;
- select d.CHECKPOINT_CHANGE# ,d.NAME
- from v_$datafile d;
-
- alter tablespace sysaux online;
- alter tablespace system offline;
复制代码 复杂的恢复实验的命令和过程:
- [oracle@station8 ~]$ rman target /
- Recovery Manager: Release 11.2.0.1.0 - Production on Sun Mar 18 17:46:47 2018
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- connected to target database: STATION8 (DBID=1918600045, not open)
- RMAN> recover database;
- Starting recover at 18-MAR-18
- using target database control file instead of recovery catalog
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: SID=200 device type=DISK
- starting media recovery
- media recovery failed
- RMAN-00571: ===========================================================
- RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
- RMAN-00571: ===========================================================
- RMAN-03002: failure of recover command at 03/18/2018 17:46:53
- ORA-00283: recovery session canceled due to errors
- RMAN-11003: failure during parse/execution of SQL statement: alter database recover if needed
- start
- ORA-00283: recovery session canceled due to errors
- ORA-00313: open failed for members of log group 1 of thread 1
- ORA-00312: online log 1 thread 1: '+FRA/station8/onlinelog/group_1.257.971108007'
- ORA-17503: ksfdopn:2 Failed to open file +FRA/station8/onlinelog/group_1.257.971108007
- ORA-15012: ASM file '+FRA/station8/onlinelog/group_1.257.971108007' does not exist
- ORA-00312: online log 1 thread 1: '+DATA/station8/onlinelog/group_1.261.971108005'
- ORA-17503: ksfdopn:2 Failed to open file +DATA/station8/online
- RMAN> restore database ;
- Starting restore at 18-MAR-18
- using channel ORA_DISK_1
- channel ORA_DISK_1: starting datafile backup set restore
- channel ORA_DISK_1: specifying datafile(s) to restore from backup set
- channel ORA_DISK_1: restoring datafile 00001 to +DATA/station8/datafile/system.256.966024907
- channel ORA_DISK_1: restoring datafile 00002 to +DATA/station8/datafile/sysaux.257.966024907
- channel ORA_DISK_1: restoring datafile 00003 to +DATA/station8/datafile/undotbs1.258.966024907
- channel ORA_DISK_1: restoring datafile 00004 to +DATA/station8/datafile/users.259.966024907
- channel ORA_DISK_1: restoring datafile 00005 to +DATA/station8/datafile/example.266.966025087
- channel ORA_DISK_1: reading from backup piece +FRA/station8/backupset/2018_03_18/nnndf0_tag20180318t135033_0.262.971099435
- channel ORA_DISK_1: piece handle=+FRA/station8/backupset/2018_03_18/nnndf0_tag20180318t135033_0.262.971099435 tag=TAG20180318T135033
- channel ORA_DISK_1: restored backup piece 1
- channel ORA_DISK_1: restore complete, elapsed time: 00:01:05
- Finished restore at 18-MAR-18
- RMAN> recover database;
- Starting recover at 18-MAR-18
- using channel ORA_DISK_1
- starting media recovery
- archived log for thread 1 with sequence 13 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_13.264.971103469
- archived log for thread 1 with sequence 14 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_14.265.971106935
- archived log for thread 1 with sequence 15 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_15.266.971106935
- archived log for thread 1 with sequence 16 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_16.267.971106935
- archived log for thread 1 with sequence 17 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_17.268.971106935
- archived log for thread 1 with sequence 18 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_18.269.971106937
- archived log for thread 1 with sequence 19 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_19.270.971106939
- archived log for thread 1 with sequence 20 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_20.271.971108005
- archived log for thread 1 with sequence 1 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_1.273.971111433
- archived log for thread 1 with sequence 2 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_2.274.971111433
- archived log for thread 1 with sequence 3 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_3.275.971111435
- archived log for thread 1 with sequence 4 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_4.276.971111437
- archived log for thread 1 with sequence 5 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_5.277.971111437
- archived log for thread 1 with sequence 6 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_6.278.971111439
- archived log for thread 1 with sequence 7 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_7.279.971111659
- archived log for thread 1 with sequence 8 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_8.280.971111659
- archived log for thread 1 with sequence 9 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_9.281.971111659
- archived log for thread 1 with sequence 10 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_10.282.971111661
- archived log for thread 1 with sequence 11 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_11.283.971111663
- archived log for thread 1 with sequence 12 is already on disk as file +FRA/station8/archivelog/2018_03_18/thread_1_seq_12.284.971111663
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_13.264.971103469 thread=1 sequence=13
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_14.265.971106935 thread=1 sequence=14
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_15.266.971106935 thread=1 sequence=15
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_16.267.971106935 thread=1 sequence=16
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_17.268.971106935 thread=1 sequence=17
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_18.269.971106937 thread=1 sequence=18
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_19.270.971106939 thread=1 sequence=19
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_20.271.971108005 thread=1 sequence=20
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_1.273.971111433 thread=1 sequence=1
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_2.274.971111433 thread=1 sequence=2
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_3.275.971111435 thread=1 sequence=3
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_4.276.971111437 thread=1 sequence=4
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_5.277.971111437 thread=1 sequence=5
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_6.278.971111439 thread=1 sequence=6
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_7.279.971111659 thread=1 sequence=7
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_8.280.971111659 thread=1 sequence=8
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_9.281.971111659 thread=1 sequence=9
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_10.282.971111661 thread=1 sequence=10
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_11.283.971111663 thread=1 sequence=11
- archived log file name=+FRA/station8/archivelog/2018_03_18/thread_1_seq_12.284.971111663 thread=1 sequence=12
- RMAN-00571: ===========================================================
- RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
- RMAN-00571: ===========================================================
- RMAN-03002: failure of recover command at 03/18/2018 17:48:46
- ORA-00283: recovery session canceled due to errors
- RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '+FRA/station8/archivelog/2018_03_18/thread_1_seq_12.284.971111663'
- ORA-00283: recovery session canceled due to errors
- ORA-00313: open failed for members of log group 1 of thread 1
- ORA-00312: online log 1 thread 1: '+FRA/station8/onlinelog/group_1.257.971108007'
- ORA-17503: ksfdopn:2 Failed to open file +FRA/station8/onlinelog/group_1.257.971108007
- ORA-15012: ASM file '+FRA/station8/onlinelog/group_1.257.971108007' does not exist
- ORA-00312: online log 1 thread 1: '+DATA/station8/onlinelog/group_1.261.971108005'
- ORA-17503: ksfdopn:2 Failed to open file +DATA/station8/online
- RMAN> run {
- 2> set until sequence 12 thread 1;
- 3> recover database;
- 4> }
- executing command: SET until clause
- Starting recover at 18-MAR-18
- using channel ORA_DISK_1
- RMAN-00571: ===========================================================
- RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
- RMAN-00571: ===========================================================
- RMAN-03002: failure of recover command at 03/18/2018 17:52:18
- RMAN-06556: datafile 1 must be restored from backup older than SCN 1311543
- RMAN> exit
- Recovery Manager complete.
- [oracle@station8 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Sun Mar 18 17:52:43 2018
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn / as sysdba
- Connected.
- SQL> recover database;
- ORA-00283: recovery session canceled due to errors
- ORA-00313: open failed for members of log group 1 of thread 1
- ORA-00312: online log 1 thread 1:
- '+FRA/station8/onlinelog/group_1.257.971108007'
- ORA-17503: ksfdopn:2 Failed to open file
- +FRA/station8/onlinelog/group_1.257.971108007
- ORA-15012: ASM file '+FRA/station8/onlinelog/group_1.257.971108007' does not
- exist
- ORA-00312: online log 1 thread 1:
- '+DATA/station8/onlinelog/group_1.261.971108005'
- ORA-17503: ksfdopn:2 Failed to open file +DATA/station8/online
- SQL> recover database until cancel ;
- ORA-00279: change 1311548 generated at 03/18/2018 17:14:23 needed for thread 1
- ORA-00289: suggestion : +FRA
- ORA-00280: change 1311548 for thread 1 is in sequence #13
- Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
- ORA-00308: cannot open archived log '+FRA'
- ORA-17503: ksfdopn:2 Failed to open file +FRA
- ORA-15045: ASM file name '+FRA' is not in reference form
- SQL> recover database until cancel ;
- ORA-00279: change 1311548 generated at 03/18/2018 17:14:23 needed for thread 1
- ORA-00289: suggestion : +FRA
- ORA-00280: change 1311548 for thread 1 is in sequence #13
- Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
- cancel
- Media recovery cancelled.
- SQL> alter database open resetlogs;
- Database altered.
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Partitioning, Automatic Storage Management, OLAP, Data Mining
- and Real Application Testing options
- [oracle@station8 ~]$ rman target /
- Recovery Manager: Release 11.2.0.1.0 - Production on Sun Mar 18 17:55:35 2018
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- connected to target database: STATION8 (DBID=1918600045)
- RMAN> list incarnation of database ;
- using target database control file instead of recovery catalog
- List of Database Incarnations
- DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
- ------- ------- -------- ---------------- --- ---------- ----------
- 1 1 STATION8 1918600045 PARENT 1 15-AUG-09
- 2 2 STATION8 1918600045 PARENT 945184 21-JAN-18
- 3 3 STATION8 1918600045 PARENT 1308049 18-MAR-18
- 4 4 STATION8 1918600045 CURRENT 1311549 18-MAR-18
- RMAN>
复制代码
|
|