RAC 恢復(備份後建立的表空間(leviton)恢復後會自動重建)

lyf625發表於2010-09-21

Mon Sep 20 16:05:40 2010
create tablespace leviton datafile '+DG1' size 10m
Mon Sep 20 16:05:42 2010
Completed: create tablespace leviton datafile '+DG1' size 10m
Mon Sep 20 16:09:45 2010
alter database add logfile thread 1 group 5 size 50m
Mon Sep 20 16:10:03 2010
Completed: alter database add logfile thread 1 group 5 size 50m
Mon Sep 20 16:12:11 2010
alter database add logfile thread 1 group 5 size 50M
Mon Sep 20 16:12:11 2010
ORA-1184 signalled during: alter database add logfile thread 1 group 5 size 50M...
Mon Sep 20 16:12:36 2010
alter database add logfile thread 2 group 6 size 50M
Mon Sep 20 16:12:55 2010
Completed: alter database add logfile thread 2 group 6 size 50M
Mon Sep 20 21:30:39 2010
Shutting down instance (abort)
License high water mark = 11
Instance terminated by USER, pid = 14712
Mon Sep 20 21:48:42 2010
Starting ORACLE instance (normal)

 

rac01-> sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Sep 21 10:12:43 2010

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

SQL> conn /as sysdba
Connected.
SQL> !
rac01-> date
Tue Sep 21 10:13:05 CST 2010
rac01-> exit

SQL> create table mytable (col1 number) tablespace leviton;

Table created.

SQL> commit;

Commit complete.

SQL> !date
Tue Sep 21 10:15:57 CST 2010

SQL> insert into mytable values (1);

1 row created.

SQL> commit;

Commit complete.

SQL> !date
Tue Sep 21 10:16:32 CST 2010

SQL> insert into mytable values (2);

1 row created.

SQL> commit;

Commit complete.

SQL> !date
Tue Sep 21 10:17:01 CST 2010

SQL> drop table mytable;

Table dropped.

SQL> !date
Tue Sep 21 10:17:39 CST 2010

SQL> commit;     

Commit complete.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> !
rac01-> crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac01      
ora....01.lsnr application    ONLINE    ONLINE    rac01      
ora.rac01.gsd  application    ONLINE    ONLINE    rac01      
ora.rac01.ons  application    ONLINE    ONLINE    rac01      
ora.rac01.vip  application    ONLINE    ONLINE    rac01      
ora....SM2.asm application    ONLINE    ONLINE    rac02      
ora....02.lsnr application    ONLINE    ONLINE    rac02      
ora.rac02.gsd  application    ONLINE    ONLINE    rac02      
ora.rac02.ons  application    ONLINE    ONLINE    rac02      
ora.rac02.vip  application    ONLINE    ONLINE    rac02      
ora.test.db    application    OFFLINE   OFFLINE              
ora....iton.cs application    OFFLINE   OFFLINE              
ora....st1.srv application    OFFLINE   OFFLINE              
ora....t1.inst application    OFFLINE   OFFLINE              
ora....t2.inst application    OFFLINE   OFFLINE  
rac01-> rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Sep 21 10:22:46 2010

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

connected to target database (not started)

RMAN> startup mount;

Oracle instance started
database mounted

Total System Global Area     218103808 bytes

Fixed Size                     1218604 bytes
Variable Size                125831124 bytes
Database Buffers              88080384 bytes
Redo Buffers                   2973696 bytes


RMAN> restore database;

Starting restore at 21-SEP-10
using channel ORA_DISK_1

creating datafile fno=7 name=+DG1/test/datafile/leviton.296.730224341
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +DG1/test/datafile/system.256.729710591
restoring datafile 00002 to +DG1/test/datafile/undotbs1.258.729710593
restoring datafile 00003 to +DG1/test/datafile/sysaux.257.729710591
restoring datafile 00004 to +DG1/test/datafile/users.259.729710593
restoring datafile 00005 to +DG1/test/datafile/example.264.729710785
restoring datafile 00006 to +DG1/test/datafile/undotbs2.265.729710979
channel ORA_DISK_1: reading from backup piece +RECOVERYDEST/test/backupset/2010_09_17/nnndf0_tag20100917t222011_0.261.729987625
channel ORA_DISK_1: restored backup piece 1
piece handle=+RECOVERYDEST/test/backupset/2010_09_17/nnndf0_tag20100917t222011_0.261.729987625 tag=TAG20100917T222011
channel ORA_DISK_1: restore complete, elapsed time: 00:02:25
Finished restore at 21-SEP-10

RMAN> recover database until time "to_date('21-SEP-2010 10:17:01','DD-MON-YYYY HH24:MI:SS')"
2>
3> run

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "run": expecting one of: "archivelog, auxiliary, allow, check, delete, from, high, noredo, noparallel, parallel, ;, skip, test, until, undo"
RMAN-01007: at line 3 column 1 file: standard input

RMAN> run
2> {recover database
3> until time "to_date('21-SEP-2010 10:17:01','DD-MON-YYYY HH24:MI:SS')" ;
4> }

Starting recover at 21-SEP-10
using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 13 is already on disk as file +DG1/test/1_13_729710716.dbf
archive log thread 1 sequence 14 is already on disk as file +DG1/test/1_14_729710716.dbf
archive log thread 1 sequence 15 is already on disk as file +DG1/test/1_15_729710716.dbf
archive log thread 1 sequence 16 is already on disk as file +DG1/test/1_16_729710716.dbf
archive log thread 1 sequence 17 is already on disk as file +DG1/test/1_17_729710716.dbf
archive log thread 1 sequence 18 is already on disk as file +DG1/test/1_18_729710716.dbf
archive log thread 1 sequence 19 is already on disk as file +DG1/test/1_19_729710716.dbf
archive log thread 1 sequence 20 is already on disk as file +DG1/test/1_20_729710716.dbf
archive log thread 1 sequence 21 is already on disk as file +DG1/test/1_21_729710716.dbf
archive log thread 1 sequence 22 is already on disk as file +DG1/test/1_22_729710716.dbf
archive log thread 2 sequence 9 is already on disk as file +DG1/test/2_9_729710716.dbf
archive log thread 2 sequence 10 is already on disk as file +DG1/test/2_10_729710716.dbf
archive log thread 2 sequence 11 is already on disk as file +DG1/test/2_11_729710716.dbf
archive log thread 2 sequence 12 is already on disk as file +DG1/test/2_12_729710716.dbf
archive log thread 2 sequence 13 is already on disk as file +DG1/test/2_13_729710716.dbf
archive log thread 2 sequence 14 is already on disk as file +DG1/test/2_14_729710716.dbf
archive log thread 2 sequence 15 is already on disk as file +DG1/test/2_15_729710716.dbf
archive log filename=+DG1/test/1_13_729710716.dbf thread=1 sequence=13
archive log filename=+DG1/test/2_9_729710716.dbf thread=2 sequence=9
archive log filename=+DG1/test/2_10_729710716.dbf thread=2 sequence=10
archive log filename=+DG1/test/1_14_729710716.dbf thread=1 sequence=14
archive log filename=+DG1/test/1_15_729710716.dbf thread=1 sequence=15
archive log filename=+DG1/test/1_16_729710716.dbf thread=1 sequence=16
archive log filename=+DG1/test/2_11_729710716.dbf thread=2 sequence=11
archive log filename=+DG1/test/1_17_729710716.dbf thread=1 sequence=17
archive log filename=+DG1/test/2_12_729710716.dbf thread=2 sequence=12
archive log filename=+DG1/test/2_13_729710716.dbf thread=2 sequence=13
archive log filename=+DG1/test/1_18_729710716.dbf thread=1 sequence=18
archive log filename=+DG1/test/1_19_729710716.dbf thread=1 sequence=19
archive log filename=+DG1/test/1_20_729710716.dbf thread=1 sequence=20
media recovery complete, elapsed time: 00:03:17
Finished recover at 21-SEP-10

RMAN> alter database open;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 09/21/2010 10:35:02
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

RMAN> alter database open resetlogs;

database opened

RMAN> exit


Recovery Manager complete.
rac01-> sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Sep 21 10:38:06 2010

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

SQL> conn /as sysdba
Connected.
SQL> select * from mytable;

      COL1
----------
         1
         2

SQL> select file_name,bytes/1024/1024 from dba_data_files;


FILE_NAME                                          BYTES/1024/1024
-------------------------------------------------- ---------------
+DG1/test/datafile/users.259.729710593                           5
+DG1/test/datafile/sysaux.257.729710591                        300
+DG1/test/datafile/undotbs1.258.729710593                       40
+DG1/test/datafile/system.256.729710591                        490
+DG1/test/datafile/example.264.729710785                       100
+DG1/test/datafile/undotbs2.265.729710979                       25
+DG1/test/datafile/leviton.296.730224341                        10

7 rows selected.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13024285/viewspace-674542/,如需轉載,請註明出處,否則將追究法律責任。

相關文章