1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
| --数据库版本
sys@ORCL>select * from v$version;
BANNER
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
--创建环境
zx@ORCL>insert into t1 select * from dba_segments;
5887 rows created.
zx@ORCL>insert into t1 select * from dba_segments;
5887 rows created.
zx@ORCL>insert into t1 select * from dba_segments;
5887 rows created.
zx@ORCL>insert into t1 select * from dba_segments;
5887 rows created.
zx@ORCL>insert into t1 select * from dba_segments;
5887 rows created.
zx@ORCL>insert into t1 select * from dba_segments;
5887 rows created.
zx@ORCL>insert into t1 select * from dba_segments;
5887 rows created.
zx@ORCL>insert into t1 select * from dba_segments;
5887 rows created.
zx@ORCL>insert into t1 select * from dba_segments;
5887 rows created.
zx@ORCL>commit;
Commit complete.
zx@ORCL>delete from t1;
288463 rows deleted.
zx@ORCL>select status,sum(bytes)/1024/1024 from dba_undo_extents group by status;
STATUS SUM(BYTES)/1024/1024
--------------------------- --------------------
UNEXPIRED 9.125
EXPIRED .4375
ACTIVE 89.125
zx@ORCL>commit;
Commit complete.
--两次备份undo表空间文件
RMAN> backup datafile 5;
Starting backup at 2016-12-22 13:09:27
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=/u02/app/oracle/oradata/orcl/undotbs2_01.dbf
channel ORA_DISK_1: starting piece 1 at 2016-12-22 13:09:27
channel ORA_DISK_1: finished piece 1 at 2016-12-22 13:09:28
piece handle=/u02/app/oracle/product/11.2.4/db1/dbs/3aro4007_1_1 tag=TAG20161222T130927 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2016-12-22 13:09:28
Starting Control File and SPFILE Autobackup at 2016-12-22 13:09:28
piece handle=/u02/app/oracle/product/11.2.4/db1/dbs/c-1444351641-20161222-0f comment=NONE
Finished Control File and SPFILE Autobackup at 2016-12-22 13:09:31
--查看备份后的文件大小
RMAN> list backup of datafile 5;
List of Backup Sets
===================
--第一次备份文件大小99.27M
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
87 Full 99.27M DISK 00:00:03 2016-12-22 12:11:54
BP Key: 87 Status: AVAILABLE Compressed: NO Tag: TAG20161222T121151
Piece Name: /u02/app/oracle/product/11.2.4/db1/dbs/36ro3sk7_1_1
List of Datafiles in backup set 87
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ------------------- ----
5 Full 9042031 2016-12-22 12:11:51 /u02/app/oracle/oradata/orcl/undotbs2_01.dbf
--第二次备份文件大小2.16M
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
89 Full 2.16M DISK 00:00:01 2016-12-22 12:34:42
BP Key: 89 Status: AVAILABLE Compressed: NO Tag: TAG20161222T123441
Piece Name: /u02/app/oracle/product/11.2.4/db1/dbs/38ro3tv1_1_1
List of Datafiles in backup set 89
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ------------------- ----
5 Full 9042576 2016-12-22 12:34:41 /u02/app/oracle/oradata/orcl/undotbs2_01.dbf
--查看操作系统文件大小
[oracle@rhel6 release]$ ls -lh /u02/app/oracle/product/11.2.4/db1/dbs/36ro3sk7_1_1
-rw-r----- 1 oracle oinstall 100M Dec 22 12:11 /u02/app/oracle/product/11.2.4/db1/dbs/36ro3sk7_1_1
[oracle@rhel6 release]$ ls -lh /u02/app/oracle/product/11.2.4/db1/dbs/38ro3tv1_1_1
-rw-r----- 1 oracle oinstall 2.2M Dec 22 12:34 /u02/app/oracle/product/11.2.4/db1/dbs/38ro3tv1_1_1
|