以下是一个缩小datafile大小的例子
oracle@JAB2:~/oradata/irdex> pwd
/opt/oracle/oradata/irdex
oracle@JAB2:~/oradata/irdex> ll
total 65021612
drwxr-xr-x 2 oracle oinstall 36864 2014-09-25 12:38 archive
-rw-r----- 1 oracle oinstall 1859584 2014-09-25 15:10 control01.ctl
-rw-r----- 1 oracle oinstall 1859584 2014-09-25 15:10 control02.ctl
-rw-r----- 1 oracle oinstall 1859584 2014-09-25 15:10 control03.ctl
-rw-r----- 1 oracle oinstall 52436992 2014-09-25 13:09 drsys01.dbf
-rw-r----- 1 oracle oinstall 26222592 2014-09-25 13:09 indx01.dbf
-rw-r----- 1 oracle oinstall 2147491840 2014-09-25 15:09 irdex01.dbf
-rw-r----- 1 oracle oinstall 2147491840 2014-09-25 15:10 irdex02.dbf
-rw-r----- 1 oracle oinstall 2147491840 2014-09-25 15:09 irdex03.dbf
-rw-r----- 1 oracle oinstall 4194312192 2014-09-25 13:09 irdex_arch01.dbf
-rw-r----- 1 oracle oinstall 4194312192 2014-09-25 13:09 irdex_arch02.dbf
-rw-r----- 1 oracle oinstall 4194312192 2014-09-25 13:09 irdex_arch03.dbf
-rw-r----- 1 oracle oinstall 4194312192 2014-09-25 13:09 irdex_arch04.dbf
-rw-r----- 1 oracle oinstall 4131397632 2014-09-25 13:09 irdex_arch05.dbf
-rw-r----- 1 oracle oinstall 4156563456 2014-09-25 13:09 irdex_arch06.dbf
-rw-r----- 1 oracle oinstall 20971528192 2014-09-25 13:09 irdex_arch07.dbf
-rw-r----- 1 oracle oinstall 10485768192 2014-09-25 13:09 irdex_arch08.dbf
-rw-r----- 1 oracle oinstall 104858112 2014-09-25 15:10 redo01.log
-rw-r----- 1 oracle oinstall 104858112 2014-09-25 09:42 redo02.log
-rw-r----- 1 oracle oinstall 104858112 2014-09-25 12:38 redo03.log
-rw-r----- 1 oracle oinstall 104858112 2014-09-25 06:55 redo04.log
-rw-r----- 1 oracle oinstall 524296192 2014-09-25 15:06 system01.dbf
-rw-r----- 1 oracle oinstall 419438592 2014-09-20 03:01 temp01.dbf
-rw-r----- 1 oracle oinstall 524296192 2014-09-25 13:09 tools01.dbf
-rw-r----- 1 oracle oinstall 1634738176 2014-09-25 15:09 undotbs01.dbf
-rw-r----- 1 oracle oinstall 52436992 2014-09-25 13:09 users01.dbf
-rw-r----- 1 oracle oinstall 104865792 2014-09-25 13:09 xdb01.dbf
Connected to Oracle9i Enterprise Edition Release 9.2.0.6.0
Connected as irdex
SQL> truncate table IRDEX_ARCH.ARCH_IRDEX_MSGDATA;
Table truncated
SQL> alter database datafile '/opt/oracle/oradata/irdex/irdex_arch08.dbf' resize 4000m;
Database altered
SQL> alter database datafile '/opt/oracle/oradata/irdex/irdex_arch07.dbf' resize 4000m
2 ;
Database altered
SQL> alter database datafile '/opt/oracle/oradata/irdex/irdex_arch08.dbf' resize 400m;
Database altered
SQL>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26870952/viewspace-1280592/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26870952/viewspace-1280592/