ORACLE备份&恢复案例(2)
2008-09-09 12:52:41 来源:WEB开发网3、删除测试表,在删除之前,便于测试,继续插入数据并应用到归档,并获取删除前的scn号。
SQL> insert into test values(2);
1 row inserted
SQL> commit;
Commit complete
SQL> select * from test;
A
---------------------------------------
1
2
SQL> alter system switch logfile;
Statement processed.
SQL> alter system switch logfile;
Statement processed.
SQL> select max(ktuxescnw * power(2, 32) + ktuxescnb) scn from x$ktuxe;
SCN
----------
31014
SQL> drop table test;
Table dropped.
4、准备恢复到SCN 31014,先关闭数据库,然后启动到mount下
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 53126412 bytes
Fixed Size 70924 bytes
Variable Size 26763264 bytes
Database Buffers 26214400 bytes
Redo Buffers 77824 bytes
Database mounted.
5、开始恢复到改变点SCN 31014
RMAN> run{
2> allocate channel c1 type disk;
3> restore database;
4> recover database until scn 31014;
5> sql 'ALTER DATABASE OPEN RESETLOGS';
6> release channel c1;
7> }
RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-08030: allocated channel: c1
RMAN-08500: channel c1: sid=10 devtype=DISK
RMAN-03022: compiling command: restore
RMAN-03022: compiling command: IRESTORE
RMAN-03023: executing command: IRESTORE
RMAN-08016: channel c1: starting datafile backupset restore
RMAN-08502: set_count=1 set_stamp=494613682 creation_time=21-MAY-03
RMAN-08089: channel c1: specifying datafile(s) to restore from backup set
RMAN-08523: restoring datafile 00001 to D:ORACLEORADATATESTSYSTEM01.DBF
RMAN-08523: restoring datafile 00002 to D:ORACLEORADATATESTRBS01.DBF
RMAN-08523: restoring datafile 00003 to D:ORACLEORADATATESTUSERS01.DBF
RMAN-08523: restoring datafile 00004 to D:ORACLEORADATATESTTEMP01.DBF
RMAN-08523: restoring datafile 00005 to D:ORACLEORADATATESTTOOLS01.DBF
RMAN-08523: restoring datafile 00006 to D:ORACLEORADATATESTINDX01.DBF
RMAN-08023: channel c1: restored backup piece 1
RMAN-08511: piece handle=D:BACKUPFULL01ENMD5I_1_1 tag=DBFULL params=NULL
RMAN-08024: channel c1: restore complete
RMAN-03023: executing command: partial resync
RMAN-08003: starting partial resync of recovery catalog
RMAN-08005: partial resync complete
RMAN-03022: compiling command: recover
RMAN-03022: compiling command: recover(1)
RMAN-03022: compiling command: recover(2)
RMAN-03022: compiling command: recover(3)
RMAN-03023: executing command: recover(3)
RMAN-08054: starting media recovery
RMAN-03022: compiling command: recover(4)
RMAN-06050: archivelog thread 1 sequence 191 is already on disk as file D:ORACL
EORADATATESTARCHIVETESTT001S00191.ARC
RMAN-06050: archivelog thread 1 sequence 192 is already on disk as file D:ORACL
EORADATATESTARCHIVETESTT001S00192.ARC
RMAN-03023: executing command: recover(4)
RMAN-08515: archivelog filename=D:ORACLEORADATATESTARCHIVETESTT001S00191.AR
C thread=1 sequence=191
RMAN-08515: archivelog filename=D:ORACLEORADATATESTARCHIVETESTT001S00192.AR
C thread=1 sequence=192
RMAN-08055: media recovery complete
RMAN-03022: compiling command: sql
RMAN-06162: sql statement: ALTER DATABASE OPEN RESETLOGS
RMAN-03023: executing command: sql
RMAN-03022: compiling command: release
RMAN-03023: executing command: release
RMAN-08031: released channel: c1
- ››oracle 中 UPDATE nowait 的使用方法
- ››Oracle ORA-12560解决方法
- ››Oracle 10g RAC 常用维护命令
- ››Oracle如何在ASM中定位文件的分布
- ››Oracle的DBMS_RANDOM.STRING 的用法
- ››oracle 外部表导入时间日期类型数据,多字段导入
- ››Oracle中查找重复记录
- ››oracle修改用户登录密码
- ››Oracle创建删除用户、角色、表空间、导入导出等命...
- ››Oracle中登陆时报ORA-28000: the account is lock...
- ››Oracle数据库在配置文件中更改最大连接数
- ››Oracle中在pl/sql developer修改表的两种方式
更多精彩
赞助商链接