国产探花免费观看_亚洲丰满少妇自慰呻吟_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


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 崇文区| 剑川县| 徐汇区| 中宁县| 云南省| 洞口县| 偏关县| 荥经县| 噶尔县| 朔州市| 舒兰市| 长岭县| 蓬莱市| 库伦旗| 曲水县| 梧州市| 登封市| 朝阳区| 十堰市| 云南省| 桃园市| 贺兰县| 陆川县| 米脂县| 巴彦淖尔市| 荥阳市| 和静县| 江源县| 松江区| 襄汾县| 敦煌市| 仪征市| 瑞安市| 托克托县| 克东县| 石泉县| 洱源县| 西和县| 易门县| 高清| 滦平县|