WEB开发网
开发学院数据库Oracle 当表空间不足时Oracle管理Recyclebin 阅读

当表空间不足时Oracle管理Recyclebin

 2008-08-26 12:44:02 来源:WEB开发网   
核心提示:我们知道,在Oracle 10g中,drop table如果没有加 purge选项.实际数据并没有删除,因而没有释放表空间. 那么当被删除的对象占用了所有空间时,会发生什么? 相信看完以下测试,一切皆会明白YXYUP@dbatest>selecttablespace_name,sum(bytes)/1024/10

我们知道,在Oracle 10g中,drop table如果没有加 purge选项.实际数据并没有删除,因而没有释放表空间.

那么当被删除的对象占用了所有空间时,会发生什么? 相信看完以下测试,一切皆会明白 

YXYUP@dbatest>selecttablespace_name,sum(bytes)/1024/1024fromdba_data_fileswheretablespace_name='TBS'groupbytablespace_name;
  TABLESPACE_NAMESUM(BYTES)/1024/1024
  ----------------------------------------
  TBS17
  Elapsed:00:00:00.02
  YXYUP@dbatest>selectsegment_name,bytes/1024/1024,tablespace_namefromuser_segments;
  SEGMENT_NAMEBYTES/1024/1024TABLESPACE_NAME
  -----------------------------------------------------------------
  TEST_BAK6TBS
  TEST016TBS
  Elapsed:00:00:00.07
  YXYUP@dbatest>createtabletest02tablespacetbsasselect*fromdba_objects;
  createtabletest02tablespacetbsasselect*fromdba_objects
  *
  ERRORatline1:
  ORA-01652:unabletoextendtempsegmentby128intablespaceTBS
  Elapsed:00:00:00.73
  YXYUP@dbatest>droptabletest01;
  Tabledropped.
  Elapsed:00:00:00.04
  YXYUP@dbatest>showrecyclebin;
  ORIGINALNAMERECYCLEBINNAMEOBJECTTYPEDROPTIME
  -----------------------------------------------------------------------------
  TEST01BIN$VPH4ibnKVd/gQAB/AQA0Nw==$0TABLE2008-08-21:14:56:55
  YXYUP@dbatest>
  YXYUP@dbatest>select*fromtab;
  TNAMETABTYPECLUSTERID
  -----------------------------------------------
  BIN$VPH4ibnKVd/gQAB/AQA0Nw==$0TABLE
  TEST_BAKTABLE
  Elapsed:00:00:00.01
  YXYUP@dbatest>createtabletest02tablespacetbsasselect*fromdba_objects;
  Tablecreated.
  Elapsed:00:00:00.84
  YXYUP@dbatest>showrecyclebin;
  YXYUP@dbatest>select*fromtab;
  TNAMETABTYPECLUSTERID
  -----------------------------------------------
  TEST_BAKTABLE
  TEST02TABLE
  Elapsed:00:00:00.01

1 2  下一页

Tags:空间 不足 Oracle

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接