Decode360's Blog

          業(yè)精于勤而荒于嬉 QQ:150355677 MSN:decode360@hotmail.com

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 ::  :: 管理 ::
            397 隨筆 :: 33 文章 :: 29 評(píng)論 :: 0 Trackbacks
          關(guān)于DataFile的大小問題
          ?
          ??? 當(dāng)發(fā)生臨時(shí)表空間不夠時(shí),可以用以下語句來創(chuàng)建一個(gè)比較大的臨時(shí)表空間(各個(gè)文件可以創(chuàng)建到不同的磁盤以備用)
          ?
          SQL>create temporary tablespace TMPACCT2 tempfile '/u02/oradata/acct/tmpacct2-1.dbf' size 10M autoextend on next 10M maxsize 2000M;
          SQL> alter tablespace TMPACCT2 add tempfile '/u02/oradata/acct/tmpacct2-2.dbf' size 10M autoextend on next 10M maxsize 2000M;
          SQL> alter tablespace TMPACCT2 add tempfile '/u02/oradata/acct/tmpacct2-3.dbf' size 10M autoextend on next 10M maxsize 2000M;
          SQL> alter tablespace TMPACCT2 add tempfile '/u02/oradata/acct/tmpacct2-4.dbf' size 10M autoextend on next 10M maxsize 2000M;
          SQL> alter tablespace TMPACCT2 add tempfile '/u02/oradata/acct/tmpacct2-5.dbf' size 10M autoextend on next 10M maxsize 2000M;
          SQL> alter user TCICDR TEMPORARY TABLESPACE TMPACCT2;
          ?
          ?
          ??? 當(dāng)遇到ORA-01652: unable to extend temp segment by 128 in tablespace xxxxx問題的時(shí)候,并不代表就是temp表空間不足,因?yàn)殡m然Oracle會(huì)首先在臨時(shí)表空間中創(chuàng)建需要?jiǎng)?chuàng)建的object,但是在最后還是需要將其轉(zhuǎn)換到實(shí)際的tablespace中,而到tablespace空間不足時(shí),創(chuàng)建的事務(wù)被打斷,SMON檢測(cè)到之后就會(huì)find the temporary extents out there and clean them up,所以這里的“temp segment”其實(shí)是指實(shí)際的tablespace空間不足。可以用以下方法來增加tablespace的空間:

          SQL> alter database datafile '&f' autoextend off;
          old?? 1: alter database datafile '&f' autoextend off
          new?? 1: alter database datafile '/home/ora10gr2/oracle/product/10.2.0/oradata/ora10gr2/system01.dbf' autoextend off

          Database altered.

          SQL> create table ttt tablespace system as select * from all_objects;
          create table ttt tablespace system as select * from all_objects
          *
          ERROR at line 1:
          ORA-01652: unable to extend temp segment by 128 in tablespace SYSTEM

          SQL> alter database datafile '&f' autoextend on next 10m maxsize 31g;
          old?? 1: alter database datafile '&f' autoextend on next 10m maxsize 31g
          new?? 1: alter database datafile '/home/ora10gr2/oracle/product/10.2.0/oradata/ora10gr2/system01.dbf' autoextend on next 10m maxsize 31g

          Database altered.

          SQL> create table ttt tablespace system as select * from all_objects;

          Table created.

          --當(dāng)然僅為舉例,實(shí)際中千萬不要把用戶表創(chuàng)建到SYSTEM表空間

          ?
          posted on 2009-03-29 21:50 decode360 閱讀(177) 評(píng)論(0)  編輯  收藏 所屬分類: 07.Oracle
          主站蜘蛛池模板: 中超| 铁岭县| 竹北市| 曲水县| 来宾市| 搜索| 梧州市| 凉城县| 灵武市| 三亚市| 波密县| 明溪县| 嘉善县| 边坝县| 东城区| 上蔡县| 本溪| 濉溪县| 诏安县| 南乐县| 鹤山市| 宁乡县| 丹寨县| 益阳市| 鄄城县| 理塘县| 乐安县| 吉水县| 湘西| 洪雅县| 九江县| 东辽县| 嘉义县| 内江市| 塔河县| 紫阳县| 许昌市| 光泽县| 毕节市| 固镇县| 拉孜县|