成熟丰满熟妇高潮XXXXX,人妻无码AV中文系列久久兔费 ,国产精品一国产精品,国精品午夜福利视频不卡麻豆

您好,歡迎來到九壹網(wǎng)。
搜索
您的當(dāng)前位置:首頁(yè)如何在oracle11g中導(dǎo)出空表

如何在oracle11g中導(dǎo)出空表

來源:九壹網(wǎng)

如何在oracle 11g 中導(dǎo)出空表 由于oracle 11g的 延遲段創(chuàng)建的新特性,導(dǎo)致在沒有數(shù)據(jù)插入時(shí),oracle是不會(huì)分配數(shù)據(jù)段的,進(jìn)而導(dǎo)致exp 是不能導(dǎo)出11g數(shù)據(jù)庫(kù)的空表的。 當(dāng)然采用expdp就不存在這個(gè)問題了。 expdp hr/hr schemas=hr dumpfile=expdp.dmp director

  如何在oracle 11g 中導(dǎo)出空表

  由于oracle 11g的 延遲段創(chuàng)建的新特性,導(dǎo)致在沒有數(shù)據(jù)插入時(shí),oracle是不會(huì)分配數(shù)據(jù)段的,進(jìn)而導(dǎo)致exp 是不能導(dǎo)出11g數(shù)據(jù)庫(kù)的空表的。

  當(dāng)然采用expdp就不存在這個(gè)問題了。

  expdp hr/hr schemas=hr dumpfile=expdp.dmp directory=dbtest

  conn hr/hr

  select TABLE_NAME,NUM_ROWS from user_tables;

  TABLE_NAME NUM_ROWS

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

  LOCATIONS 23

  EMP_1 0

  PART_TIME_EMPLOYEES 0

  TEST3 5

  TEST1 5

  TEST 5

  PC_WELL_TEST 2

  PC_ALARM_SORT_TEST 1

  MVIEW_PC_WELL_TEST 2

  MV_CAPABILITIES_TABLE 14

  T 0

  TEST2

  SYS_EXPORT_SCHEMA_01

  SYS_EXPORT_SCHEMA_02

  HOURLY_EMPLOYEES 0

  COUNTRIES 25

  ADMIN_EXT_EMPLOYEES

  ADMIN_WORK_AREA

  EMPLOYEES 107

  DEPARTMENTS 27

  DIGITS 2

  REGIONS 4

  JOB_HISTORY 10

  JOBS 19

  24 rows selected.

  為什么這里的num_rows為空呢?

  那是因?yàn)楸韯偨?,?shù)據(jù)字典中還沒有這個(gè)表相關(guān)的統(tǒng)計(jì)信息呢。

  SQL> select 'alter table '||table_name||' allocate extent;' from user_tables where

  num_rows=0

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

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

  alter table PART_TIME_EMPLOYEES allocate extent;

  alter table EMP_1 allocate extent;

  alter table T allocate extent;

  alter table HOURLY_EMPLOYEES allocate extent;

  所以對(duì)于網(wǎng)上一些在oracle11g上先使用手工分配extent 再使用exp來導(dǎo)數(shù)據(jù)庫(kù),在實(shí)際上效果不怎么地,反而是多次一舉直接使用expdp來導(dǎo)oracle 11g數(shù)據(jù)庫(kù)中空表來的方便多了。

  當(dāng)然對(duì)那些要從11g導(dǎo)低版本,還是可以的采用這個(gè)辦法,,但是要注意,要么對(duì)所有相關(guān)的表進(jìn)行分析系,然后使用上述那個(gè)批量腳本?;蛘卟环治霰?,直接手工用ue編輯分配extent的命令。

  SQL> select TABLE_NAME,NUM_ROWS from user_tables where NUM_ROWS=0;

  TABLE_NAME NUM_ROWS

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

  PART_TIME_EMPLOYEES 0

  EMP_1 0

  T 0

  HOURLY_EMPLOYEES 0

  補(bǔ)充信息:

  USER_TABLES describes the relational tables owned by the current user. Its columns (except

  for OWNER) are the same as those in ALL_TABLES. To gather statistics for this view, use the

  DBMS_STATS package.

  收集表的統(tǒng)計(jì)信息:

  analyze table xxx compute statistics;

  or

  exec dbma_stats.gather_table_stats('USER', 'TABLE');

Copyright ? 2019- 91gzw.com 版權(quán)所有 湘ICP備2023023988號(hào)-2

違法及侵權(quán)請(qǐng)聯(lián)系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市萬商天勤律師事務(wù)所王興未律師提供法律服務(wù)