zoukankan      html  css  js  c++  java
  • Oracle导出空表(从来都没有用过的表)

    Oracle11g默认对空表不分配segment,故使用exp导出Oracle11g数据库时,空表不会导出!
    1、设置deferred_segment_creation参数为FALSE后,无论是空表还是非控表,都分配segment。
    在sqlplus命令窗口中,执行:
    SQL> show parameter deferred_segment_creation
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    deferred_segment_creation            boolean     TRUE
    
    SQL> alter system set deferred_segment_creation=false
      2  ;
    
    System altered
    
    SQL> show parameter deferred_segment_creation
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    deferred_segment_creation            boolean     FALSE
    
    SQL> 
    
    该值设置后只对后面新增的表产生作用,对之前建立的空表不起作用!
    
    2、使用 allocate extent
    查找空表信息
    select * from user_tables where num_rows=0 or num_rows is null;
    形成有效的执行SQL语句
    select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0 or num_rows is null;
    执行如表ABC
    alter table ABC allocate extent;
  • 相关阅读:
    python os模块
    python time、datetime模块
    python 导入模块、包
    python json、pickle
    python 装饰器
    python 生成器、迭代器
    python 内置函数
    python 函数的参数
    python 编码解码
    python 文件读写、shutil模块
  • 原文地址:https://www.cnblogs.com/xiaoxian1369/p/4384518.html
Copyright © 2011-2022 走看看