一:构造一个UNNAMEDnnnnn文件
1 控制文件备份时当前联机日志状态如下
select group#,archived,sequence#,status from v$log
GROUP# ARC SEQUENCE# STATUS
---------- --- ---------- ----------------
1 YES 2 ACTIVE
2 YES 1 ACTIVE
3 YES 3 ACTIVE
4 YES 4 ACTIVE
5 YES 5 ACTIVE
6 NO 6 CURRENT
2 当前控制控制文件备份如下
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5 Full 7.11M DISK 00:00:03 14-DEC-12
BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20121214T062943
Piece Name: /Oracle/app/db1/dbs/0fnsqnsl_1_1
Control File Included: Ckp SCN: 2779647876 Ckp time: 14-DEC-12
3 创建表空间及测试数据时日志状态如下:
SQL> select group#,archived,sequence#,status from v$Log;
GROUP# ARC SEQUENCE# STATUS
---------- --- ---------- ----------------
1 YES 14 INACTIVE
2 YES 13 INACTIVE
3 NO 15 CURRENT
4 YES 10 INACTIVE
5 YES 11 INACTIVE
6 YES 12 INACTIVE
4 此时创建表空间
SQL> create tablespace jiujian datafile '/oracle/test/jiujian.dbf' size 1m;
Tablespace created.
SQL> select file#,name from v$datafile;
FILE# NAME
---------- ----------------------------------------
1 /oracle/test/system1.dbf
2 /oracle/test/zxb.dbf
3 /oracle/test/sysaux01.dbf
4 /oracle/test/users01.dbf
5 /oracle/test/zxa.dbf
6 /oracle/test/test1.dbf
7 /oracle/test/zxc.dbf
8 /oracle/test/undotbs1.dbf
9 /oracle/test/zxbig.dbf
10 /oracle/test2.dbf
11 /oracle/test/jiujian.dbf
5 插入测试数据:
SQL> create table t3(x int) tablespace jiujian1;
Table created.
SQL> begin
2 for i in 1..20 loop
3 insert into t3 values(i);
4 end loop;
5 commit;
6 end;
7 /
PL/SQL procedure successfully completed.
SQL> select * from t3;
X
----------
1
2
3
4
5
6
7
8
9
10
11
X
----------
12
13
14
15
16
17
18
19
20
6 6到14号归档的scn范围
SEQUENCE# NAME FIRST_CHANGE# NEXT_CHANGE#
---------- ---------------------------------------- ------------- ------------
6 /oracle/archive/1_6_801957264.dbf 2779647184 2779648239
7 /oracle/archive/1_7_801957264.dbf 2779648239 2779648241
8 /oracle/archive/1_8_801957264.dbf 2779648241 2779648243
9 /oracle/archive/1_9_801957264.dbf 2779648243 2779648245
10 /oracle/archive/1_10_801957264.dbf 2779648245 2779648247
11 /oracle/archive/1_11_801957264.dbf 2779648247 2779648250
12 /oracle/archive/1_12_801957264.dbf 2779648250 2779648252
13 /oracle/archive/1_13_801957264.dbf 2779648252 2779648254
14 /oracle/archive/1_14_801957264.dbf 2779648254 2779648256