国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > Oracle > 正文

Oracle 9i新特性研究一(數據庫默認臨時表空間)

2024-08-29 13:46:44
字體:
來源:轉載
供稿:網友
Oracle 9i新特性研究 一數據庫默認臨時表空間作者:gototop  在9i之前,假如一個數據庫用戶沒有被指定默認臨時表空間,那么oracle就會使用system表空間作為該用戶的臨時表空間,這是很危險的。在9i里面,database可以被指定一個默認臨時表空間。這樣假如數據庫用戶沒有被明確指定臨時表空間,oracle 9i就會自動指定database的默認臨時表空間作為該用戶的臨時表空間。 我們可以通過下面的語句來查詢數據庫的默認臨時表空間:SQL> select * from database_PRoperties where property_name = 'DEFAULT_TEMP_TABLESPACE';PROPERTY_NAME            PROPERTY_VALUE              DESCRipTION--------------------- ------------------- ------------------------DEFAULT_TEMP_TABLESPACE   TEMP   Name of default temporary tablespace 默認臨時表空間的限制:1. 默認臨時表空間必須是TEMPORARY的:    SQL> alter database default temporary tablespace tools;   alter database default temporary tablespace tools   *   ERROR at line 1:   ORA-12902: default temporary tablespace must be SYSTEM or of TEMPORARY type 2. 默認臨時表空間一旦被指定,將無法在改成PERMANET:    SQL> alter tablespace temp2 permanent;   alter tablespace temp2 permanent   *   ERROR at line 1:   ORA-12904: default temporary tablespace cannot be altered to PERMANENT type3. 在刪除默認臨時表空間必須先重新指定默認臨時表空間:   SQL> drop tablespace temp including contents and datafiles;   drop tablespace temp including contents and datafiles   *   ERROR at line 1:   ORA-12906: cannot drop default temporary tablespace    SQL> create tablespace TEMP2     2  datafile '/data1/ora9data/temp2_01.dbf'      3  size 100k TEMPORARY;    Tablespace created.    SQL> alter database default temporary tablespace TEMP2;   Database altered.    SQL> drop tablespace temp including contents and datafiles;   Tablespace dropped. 4. 默認臨時表空間無法OFFLINE:   SQL> alter tablespace temp offline;   alter tablespace temp offline   *   ERROR at line 1:   ORA-12905: default temporary tablespace cannot be brought OFFLINE 5. 用戶的臨時表空間必須是TEMPORARY的(在9i之前沒有這個限制,可以是PERMANENT):     SQL>  alter user scott temporary tablespace TOOLS;    alter user scott temporary tablespace TOOLS
   *   ERROR at line 1:   ORA-12911: permanent tablespace cannot be temporary tablespace    SQL> create tablespace temp2      2  datafile  '/data1/ora9data/temp2_01.dbf'       3  size 100k temporary;    Tablespace created.    SQL> alter user scott temporary tablespace temp2;   User altered. 6. 假如刪除了用戶的臨時表空間,而這個臨時表空間又不是數據庫的默認臨時表空間(假如是數據庫的默認臨時表空間是刪不掉的),用戶的臨時表空間不會自動轉換到數據庫的默認臨時表空間上:   SQL> select tablespace_name, contents from dba_tablespaces where tablespace_name like 'TEMP%';    TABLESPACE_NAME                CONTENTS   ------------------------------ ---------   TEMP                           TEMPORARY   TEMP2                          TEMPORARY    SQL> select TEMPORARY_TABLESPACE from dba_users where username='SCOTT';    TEMPORARY_TABLESPACE   ------------------------------   TEMP2   SQL> drop tablespace TEMP2 including contents and datafiles;   Tablespace dropped.    SQL> select TEMPORARY_TABLESPACE from dba_users where username='SCOTT';   TEMPORARY_TABLESPACE   ------------------------------   TEMP2


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 龙门县| 长岛县| 新密市| 普定县| 沙雅县| 冷水江市| 兰考县| 河东区| 海阳市| 莱西市| 元朗区| 黔西县| 夏津县| 福鼎市| 镇康县| 芦山县| 错那县| 霞浦县| 蒙自县| 嘉义市| 彰武县| 麟游县| 临清市| 金湖县| 珠海市| 临洮县| 同仁县| 罗源县| 凉城县| 金山区| 唐海县| 黄骅市| 四平市| 大埔县| 枣庄市| 玉溪市| 遂昌县| 湖南省| 临潭县| 永川市| 化隆|