数据迁移详解

查找用户下所有空表并分配空间_解决不能导入exp空表

 

declare
  cursor c1 is
    select 'alter table ' || table_name || ' allocate extent' as xxx
      from user_tables
     where num_rows = 0;
  stmt varchar2(4000);
begin
  for cc in c1 loop
    BEGIN
      stmt := cc.xxx;
      dbms_output.put_line(stmt);
      execute immediate stmt;
    EXCEPTION
      WHEN OTHERS THEN
        dbms_output.put_line('error: ' || SUBSTR(sqlerrm, 1, 1000));
    end;
  end loop;
end;

你可能感兴趣的:(数据库,oracle,数据迁移)