Oracle暫存資料表空間組

來源:互聯網
上載者:User

標籤:

Oracle 10g之前,同一使用者的多個會話只可以使用同一個暫存資料表空間,因為在給定的時間只有一個暫存資料表空間預設給使用者,為瞭解決這個潛在的瓶頸,Oracle支援暫存資料表空間組即包含多個暫存資料表空間的集合。暫存資料表空間組邏輯上就相當於一個暫存資料表空間。

Example:

 1 SQL>create temporary tablespace temp1 tempfile ‘/u01/app/oracle/oradata/orcl/temp01.dbf‘ size 10M; 2  3 SQL>create temporary tablespace temp2 tempfile ‘/u01/app/oracle/oradata/orcl/temp02.dbf‘ size 10M; 4  5 SQL>create temporary tablespace temp3 tempfile ‘/u01/app/oracle/oradata/orcl/temp03.dbf‘ size 10M; 6  7 SQL>select name from v$tempfile; 8  9 NAME10 11 -----------------------------------------------------------------------------------------------12 13 /u01/app/oracle/oradata/orcl/temp01.dbf14 15 /u01/app/oracle/oradata/orcl/temp02.dbf16 17 /u01/app/oracle/oradata/orcl/temp01.dbf18 19 SQL>select tablespace_name from dba_tablespaces where contents=‘TEMPORARY‘;20 21 TABLESPACE_NAME22 23 -----------------------------------------------------------------------------------------------24 25 TEMP126 27 TEMP228 29 TEMP330 31 添加temp1,temp2,temp3到暫存資料表空間組tempgrp中32 33 SQL>alter tablespace temp1 tablespace group tempgrp;34 35 SQL>alter tablespace temp2 tablespace group tempgrp;36 37 SQL>alter tablespace temp3 tablespace group tempgrp;38 39 啟用暫存資料表空間組40 41 SQL>alter database default temporary tablespace tempgrp;42 43 SQL>select * from dba_tablespace_groups;44 45 GROUP_NAME                               TABLESPACE_NAME46 47 -----------------------------------------------------------------------------------------48 49 TEMPGRP                 TEMP150 51 TEMPGRP                 TEMP252 53 TEMPGRP                 TEMP354 55 此時資料庫所有使用者的預設暫存資料表空間為tempgrp56 57 SQL>select username,defualt_tablespace,temporary_tablespace from dba_user where username=‘SCOTT‘;58 59 USERNAME                  DEFAULT_TABLESPACE                                  TEMPORARY_TABLESPACE60 61 ---------------------------------------------------------------------------------------------------------------62 63 SCOTT                        USERS                                                          TEMPGRP64 65 刪除暫存資料表空間組66 67 1.必須先刪除成員68 69 SQL>alter tablespace temp1 tablespace group ‘‘;(表示刪除temp1)70 71 SQL>select * from dba_tablespace_groups;72 73 GROUP_NAME                               TABLESPACE_NAME74 75 -----------------------------------------------------------------------------------------76 77 TEMPGRP                 TEMP278 79 TEMPGRP                 TEMP380 81 同理將temp2,temp3刪除82 83 當資料表空間組是資料庫預設資料表空間時,最後一個成員刪除報錯:ORA-10919:Defualt temporary tablespace group must be have at least one tablespace84 85 SQL>alter database default temporary tablespace temp;86 87 此時再刪除最後一個成員,暫存資料表空間組自動消失88 89 SQL>select * from dba_tablespace_groups;90 91 no rows selected92 93 刪除temp1資料表空間及資料檔案94 95 SQL>drop temporary tablespace temp1 including contents and datafiles;
View Code

 

Oracle暫存資料表空間組

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.