如何对表手工扩展一个extent或多个extent
用alter table allocate extent 命令来实现
SQL> show user
USER is "SYS"
SQL> create table test_extent(a number,b varchar2(10)); ===============> table created
Table created.
SQL> select OWNER,SEGMENT_NAME,SEGMENT_TYPE,EXTENT_ID from dba_extents where segment_name='TEST_EXTENT'; ==============> Checked the extents
OWNER SEGMENT_NAME SEGMENT_TYPE EXTENT_ID
---------- -------------------- ------------------ ----------
SYS TEST_EXTENT TABLE 0
SQL> alter table test_extent allocate extent; =============================> added an extent
Table altered.
SQL> select OWNER,SEGMENT_NAME,SEGMENT_TYPE,EXTENT_ID from dba_extents where segment_name='TEST_EXTENT'; =====> Adds one extent only
OWNER SEGMENT_NAME SEGMENT_TYPE EXTENT_ID
---------- -------------------- ------------------ ----------
SYS TEST_EXTENT TABLE 0
SYS TEST_EXTENT TABLE 1
SQL> alter table test_extent allocate extent(size 5m); ==============================> This will add multiple extents in a single alter statement
Table altered.
SQL> select OWNER,SEGMENT_NAME,SEGMENT_TYPE,EXTENT_ID from dba_extents where segment_name='TEST_EXTENT'; =====> Multiple extents added
OWNER SEGMENT_NAME SEGMENT_TYPE EXTENT_ID
---------- -------------------- ------------------ ----------
SYS TEST_EXTENT TABLE 0
SYS TEST_EXTENT TABLE 1
SYS TEST_EXTENT TABLE 2
SYS TEST_EXTENT TABLE 3
SYS TEST_EXTENT TABLE 4
SYS TEST_EXTENT TABLE 5
SYS TEST_EXTENT TABLE 6
7 rows selected.