標籤:檔案 結束 資料 segment cal bin 定位 移動 nts
1、概述
作用:提供了局部管理資料表空間的功能
2、包的組成
1)、segment_verify
作用:用於檢查段的區映像是否與位元影像一致
文法:dbms_space_admin.segment_verify(tablespace_name in varchar2,header_relative_file in positive,heaeder_block in positive,verify_option in positive default segment_verify_extents);
其中tablespace_name指定段所在的資料表空間,header_relative_file指定段頭所在的相對檔案好,heaeder_block指定段頭所在的塊號,verify_option指定檢查方式。
例子:exec dbms_space_admin.segment_verify(‘‘,9,68);
2)、segment_corrupt
作用:用於將區段標記為損壞或有效。
文法:dbms_space_admin.segment_corrupt(tablespace_name in varchar2,header_relative_file in positive,header_block in positive,corrupt_option in positive default segment_mark_corrupt);
其中corrupt_option指定損壞(segment_mark_corrupt)或有效(segment_mark_valid)選項。
例子:dbms_space_admin.segment_corrupt(‘USER3‘,9,68);
3)、segment_drop_corrupt
作用:用於刪除被標記為損壞的段。
文法:dbms_space_admin.segment_drop_corrupt(tablespace_name in varchar2,header_relative_file in positive,header_block in positive);
例子:exec dbms_space_admin.segment_drop_corrupt(‘USER3‘,9,68);
4)、segment_dump
作用:用於轉儲特定段的頭塊和區映像塊
文法:dbms_space_admin.segment_dump(tablespace_name in varchar2,header_relative_file in positive,header_block in positive,dump_option in positive default defult segment_dump_extent_map);
其中dump_option指定轉儲特項。
5)、tablespace_verify
作用:檢查資料表空間所有段的位元影像和區映像。
文法:dbms_space_admin.tablespace_verify(tablespace_name in varchar2,verify_option in positive default tablespace_verify_bitmap);
例子:exec dbms_space_admin.tablespace_verify(‘USERS3‘);
6)、tablespace_fix_bitmaps
作用:用於將特定範圍的空間標記為空白閑或已用。
文法:dbms_space_admin.tablespace_fix_bitmaps(tablespace_name in varchar2,dbarange_relative_file in positive,dbarange_begin_block in positive,
dbarange_end_block in positive,fix_option in positive);
其中dbarange_relative_file指定DBA範圍內的相對檔案號,dbarange_begin_block指定資料檔案區的起始塊編號,dbarange_end_block指定資料檔案區的結束塊編號,
fix_option指定選項(TABLESPACE_EXTENT_MAKE_FREE或TABLESPACE_EXTENT_MAKE_USED)
例子:exec dbms_space_admin.tablespace_fix_bitmaps(‘USES‘,4,33,83,7);
7)、tablespace_rebuild_bitmaps
作用:用於重建立立合適的位元影像。如果沒有指定位元影像塊,則將重建特定資料表空間的所有位元影像塊。
文法:dbms_space_admin.tablespace_rebuild_bitmaps(tablespace_name in varchar2,bitmap_relative_file in positive default null,bitmap_block in positive default null);
其中bitmap_relative_file指定位元影像塊的相對檔案號,bitmap_block指定位元影像塊的塊號。
例子:exec dbms_space_admin.tablespace_rebuild_bitmaps(‘users3‘);
8)、tablespace_rebuild_quotas
作用:用於重建資料表空間配額。
文法:dbms_space_admin.tablespace_rebuild_quotas(tablespace_name in varchar2);
例子:exec dbms_space_admin.tablespace_rebuild_quotas(‘USERS3‘);
9)、tablesapce_migrate_from_local
作用:用於將局部管理資料表空間轉變為字典管理資料表空間。
文法:dbms_space_admin.tablesapce_migrate_from_local(tablespace_name in varchar2);
例子:exec dbms_space_admin.tablesapce_migrate_from_local(‘USERS1‘);
10)、tablespace_miorate_to_local
作用:用於將字典管理資料表空間轉變為局部管理資料表空間
文法:dbms_space_admin.tablespace_miorate_to_local(tablespace_name in varchar2);
其中tablespace_name指定字典管理資料表空間名。
例子:dbms_space_admin.tablespace_miorate_to_local(‘USERS1‘);
11)、tablespace_reloacte_bitmaps
作用:用於移動位元影像到指定位置。
文法:dbms_space_admin.tablespace_reloacte_bitmaps(tablespace_name in varchar2,relative_fno in binary_integer,block_number in binary_integer);
其中relative_fno指定相對檔案號,block_number指定資料區塊編號。
例子:exec dbms_space_admin.tablespace_reloacte_bitmaps(‘USERS3‘,9,8);
12)、tablespace_fix_segment_states
作用:用於修正資料表空間的段狀態。當升級資料表空間時,如果出現常式終止,那麼為了重新升級資料表空間,必須要修正該資料表空間中相應段的狀態。
文法:dbms_space_admin.tablespace_fix_segment_states(tablespace_name);
例子:exec dbms_space_admin.tablespace_fix_segment_states(‘USERS3‘);
十六、dbms_space_admin(提供了局部管理資料表空間的功能)