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>;