ORACLE11g 区的管理与分配

这篇文章是对ORACLE空间管理实验2:区的管理与分配中实验四的一个补充。

具体还请到连接中查看和其中我的一个评论(在这里我就直接贴实验代码了):

SQL> create tablespace test1 datafile '/u01/app/oracle/oradata/normal/test01.dbf' size 10M;

Tablespace created.

SQL> alter tablespace test1 add datafile '/u01/app/oracle/oradata/normal/test02.dbf' size 20M;

Tablespace altered.

SQL> alter tablespace test1 add datafile '/u01/app/oracle/oradata/normal/test03.dbf' size 10M;

Tablespace altered.

SQL> select a.tablespace_name,a.file_id,b.file_name,a.bytes/1024/1024 file_byte_mb from dba_free_space a,dba_data_files b where a.file_id=b.file_id and  a.tablespace_name='TEST1';   

TABLESPACE_NAME                   FILE_ID FILE_NAME                                          FILE_BYTE_MB
------------------------------ ---------- -------------------------------------------------- ------------
TEST1                                  10 /u01/app/oracle/oradata/normal/test02.dbf                    19
TEST1                                  11 /u01/app/oracle/oradata/normal/test03.dbf                     9
TEST1                                   9 /u01/app/oracle/oradata/normal/test01.dbf                     9

SQL> create table t1 (id number) tablespace test1 storage(initial 10M);

Table created.

SQL> select a.tablespace_name,a.file_id,b.file_name,a.bytes/1024/1024 file_byte_mb from dba_free_space a,dba_data_files b where a.file_id=b.file_id and  a.tablespace_name='TEST1';   

TABLESPACE_NAME                   FILE_ID FILE_NAME                                          FILE_BYTE_MB
------------------------------ ---------- -------------------------------------------------- ------------
TEST1                                  10 /u01/app/oracle/oradata/normal/test02.dbf                    11
TEST1                                  11 /u01/app/oracle/oradata/normal/test03.dbf                     8
TEST1                                   9 /u01/app/oracle/oradata/normal/test01.dbf                     8

SQL> alter table t1 allocate extent(size 1M);

Table altered.

SQL> select a.tablespace_name,a.file_id,b.file_name,a.bytes/1024/1024 file_byte_mb from dba_free_space a,dba_data_files b where a.file_id=b.file_id and  a.tablespace_name='TEST1';   

TABLESPACE_NAME                   FILE_ID FILE_NAME                                          FILE_BYTE_MB
------------------------------ ---------- -------------------------------------------------- ------------
TEST1                                  10 /u01/app/oracle/oradata/normal/test02.dbf                    10
TEST1                                  11 /u01/app/oracle/oradata/normal/test03.dbf                     8
TEST1                                   9 /u01/app/oracle/oradata/normal/test01.dbf                     8

SQL> alter table t1 allocate extent(size 1M);

Table altered.

SQL> select a.tablespace_name,a.file_id,b.file_name,a.bytes/1024/1024 file_byte_mb from dba_free_space a,dba_data_files b where a.file_id=b.file_id and  a.tablespace_name='TEST1';   

TABLESPACE_NAME                   FILE_ID FILE_NAME                                          FILE_BYTE_MB
------------------------------ ---------- -------------------------------------------------- ------------
TEST1                                  10 /u01/app/oracle/oradata/normal/test02.dbf                    10
TEST1                                  11 /u01/app/oracle/oradata/normal/test03.dbf                     7
TEST1                                   9 /u01/app/oracle/oradata/normal/test01.dbf                     8

SQL> alter table t1 allocate extent(size 1M);

Table altered.

SQL> select a.tablespace_name,a.file_id,b.file_name,a.bytes/1024/1024 file_byte_mb from dba_free_space a,dba_data_files b where a.file_id=b.file_id and  a.tablespace_name='TEST1';   

TABLESPACE_NAME                   FILE_ID FILE_NAME                                          FILE_BYTE_MB
------------------------------ ---------- -------------------------------------------------- ------------
TEST1                                  10 /u01/app/oracle/oradata/normal/test02.dbf                    10
TEST1                                  11 /u01/app/oracle/oradata/normal/test03.dbf                     7
TEST1                                   9 /u01/app/oracle/oradata/normal/test01.dbf                     7

SQL> alter table t1 allocate extent(size 1M);

Table altered.

SQL> select a.tablespace_name,a.file_id,b.file_name,a.bytes/1024/1024 file_byte_mb from dba_free_space a,dba_data_files b where a.file_id=b.file_id and  a.tablespace_name='TEST1';   

TABLESPACE_NAME                   FILE_ID FILE_NAME                                          FILE_BYTE_MB
------------------------------ ---------- -------------------------------------------------- ------------
TEST1                                  10 /u01/app/oracle/oradata/normal/test02.dbf                     9
TEST1                                  11 /u01/app/oracle/oradata/normal/test03.dbf                     7
TEST1                                   9 /u01/app/oracle/oradata/normal/test01.dbf                     7


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值