1. 程式人生 > >Oracle 11g空表匯出方法

Oracle 11g空表匯出方法

解決方法:

1、先查詢一下當前使用者下的所有空表 

  select table_name from user_tables where NUM_ROWS=0; 

2、用以下這句查詢空表 

  select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0 

   把查詢結果匯出,執行匯出的語句 

  'ALTERTABLE'||TABLE_NAME||'ALLOCATEEXTENT;' 

  ----------------------------------------------------------- 

  alter table AQ$_AQ$_MEM_MC_H allocate extent; 

  alter table AQ$_AQ$_MEM_MC_G allocate extent; 

  alter table AQ$_AQ$_MEM_MC_I allocate extent; 

  alter table AQ$_AQ_PROP_TABLE_T allocate extent; 

  alter table AQ$_AQ_PROP_TABLE_H allocate extent; 

  alter table AQ$_AQ_PROP_TABLE_G allocate extent; 

  alter table AQ$_AQ_PROP_TABLE_I allocate extent; 

  alter table AQ$_KUPC$DATAPUMP_QUETAB_T allocate extent; 

  alter table AQ$_KUPC$DATAPUMP_QUETAB_H allocate extent; 

  alter table AQ$_KUPC$DATAPUMP_QUETAB_G allocate extent; 

  alter table AQ$_KUPC$DATAPUMP_QUETAB_I allocate extent; 

3、然後再執行 

   exp 使用者名稱/密碼@資料庫名 file=/home/oracle/exp.dmp log=/home/oracle/exp_smsrun.log   成功!