variable id number; begin declare name varchar2(100); descr varchar2(500); obj_id number; begin name:='Manual_Employees'; descr:='Segment Advisor Example';
select task_name, status from dba_advisor_tasks where owner = 'STEVE' and advisor_name = 'Segment Advisor'; TASK_NAME STATUS ------------------------------ ----------- Manual Employees COMPLETED
以下的例子說明如何查詢DBA_ADVISOR_*視圖從所有運行的Segment Advisor中檢索通過STEVE用戶提交的工作: select af.task_name, ao.attr2 segname, ao.attr3 partition, ao.type, af.message from dba_advisor_findings af, dba_advisor_objects ao where ao.task_id = af.task_id and ao.object_id = af.object_id and ao.owner = 'STEVE'; TASK_NAME SEGNAME PARTITION TYPE MESSAGE ------------------ ------------ --------------- ---------------- -------------------------- Manual_Employees EMPLOYEES TABLE The free space in the obje ct is less than 10MB. Manual_Salestable4 SALESTABLE4 SALESTABLE4_P1 TABLE PARTITION Perform shrink, estimated savings is 74444154 bytes. Manual_Salestable4 SALESTABLE4 SALESTABLE4_P2 TABLE PARTITION The free space in the obje ct is less than 10MB.
以下的語句deallocate段未使用的空間(表,索引或者cluster): ALTER TABLE table DEALLOCATE UNUSED KEEP <integer>; ALTER INDEX index DEALLOCATE UNUSED KEEP <integer>; ALTER CLUSTER cluster DEALLOCATE UNUSED KEEP <integer>;