Creating a Default Temporary Tablespace (75)

本文介绍在Oracle数据库中,默认临时表空间的创建与管理方法。如果不指定用户的临时表空间,则默认使用SYSTEM表空间;若SYSTEM为本地管理,则不可作为临时表空间。推荐使用CREATEDATABASE语句的DEFAULTTEMPORARYTABLESPACE子句来设置。可通过ALTERDATABASE语句更改默认临时表空间。

The DEFAULT TEMPORARY TABLESPACE clause of the CREATE DATABASE statement
creates a default temporary tablespace for the database. Oracle Database assigns this
tablespace as the temporary tablespace for users who are not explicitly assigned a
temporary tablespace.

You can explicitly assign a temporary tablespace or tablespace group to a user in the
CREATE USER statement. However, if you do not do so, and if no default temporary
tablespace has been specified for the database, then by default these users are assigned
the SYSTEM tablespace as their temporary tablespace. It is not good practice to store
temporary data in the SYSTEM tablespace, and it is cumbersome to assign every user a
temporary tablespace individually. Therefore, Oracle recommends that you use the
DEFAULT TEMPORARY TABLESPACE clause of CREATE DATABASE.

Note: When you specify a locally managed SYSTEM tablespace,
the SYSTEM tablespace cannot be used as a temporary tablespace.

You can add or change the default temporary tablespace after database creation. You
do this by creating a new temporary tablespace or tablespace group with a CREATE
TEMPORARY TABLESPACE statement, and then assign it as the temporary tablespace
using the ALTER DATABASE DEFAULT TEMPORARY TABLESPACE statement. Users
will automatically be switched (or assigned) to the new default temporary tablespace.
The following statement assigns a new default temporary tablespace:

ALTER DATABASE DEFAULT TEMPORARY TABLESPACE tempts2;

The new default temporary tablespace must already exist. When using a locally
managed SYSTEM tablespace, the new default temporary tablespace must also be
locally managed.

You cannot drop or take offline a default temporary tablespace, but you can assign a
new default temporary tablespace and then drop or take offline the former one. You
cannot change a default temporary tablespace to a permanent tablespace.

Users can obtain the name of the current default temporary tablespace by querying the
PROPERTY_NAME and PROPERTY_VALUE columns of the DATABASE_PROPERTIES
view. These columns contain the values "DEFAULT_TEMP_TABLESPACE" and the
default temporary tablespace name, respectively.

创建默认临时表空家
1. 如果不为用户显示的指定默认临时表空间则缺省为system表空间
2. 如果system表空间为本地管理 , system表空间不能当作临时表空间使用
3. 使用ALTER DATABASE DEFAULT TEMPORARY TABLESPACE 语句 ,可改变默认的临时表空间
4. 不能删除 , 脱机默认临时表空间 , 不能改变为永久性表空间
5. 从DATABASE_PROPERTIES视图中的PROPERTY_NAME , PROPERTY_VALUE字段可以查询到当前默认
的临时表空间

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10599713/viewspace-995636/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10599713/viewspace-995636/

Enter user-name: system Enter password: Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options DROP USER PLMEE CASCADE * ERROR at line 1: ORA-01918: user 'PLMEE' does not exist DROP TABLESPACE PLMEE_DATA INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS * ERROR at line 1: ORA-00959: tablespace 'PLMEE_DATA' does not exist DROP TABLESPACE PLMEE_TEMP INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS * ERROR at line 1: ORA-00959: tablespace 'PLMEE_TEMP' does not exist CREATE TABLESPACE PLMEE_DATA DATAFILE 'D:\Oracle\oradata\PLM_DATA' SIZE 100M AUTOEXTEND ON NEXT 10M * ERROR at line 1: ORA-01119: error in creating database file 'D:\Oracle\oradata\PLM_DATA' ORA-27038: created file already exists OSD-04010: <create> option specified, file already exists CREATE TEMPORARY TABLESPACE PLMEE_TEMP TEMPFILE 'D:\Oracle\oradata\PLM_TEMP' SIZE 100M AUTOEXTEND ON NEXT 10M * ERROR at line 1: ORA-01119: error in creating database file 'D:\Oracle\oradata\PLM_TEMP' ORA-27038: created file already exists OSD-04010: <create> option specified, file already exists ALTER TABLESPACE PLMEE_DATA ADD DATAFILE 'E:\app\dba\oradata\PLMEE01_data' SIZE 100M AUTOEXTEND ON NEXT 10M * ERROR at line 1: ORA-00959: tablespace 'PLMEE_DATA' does not exist ALTER TABLESPACE PLMEE_DATA ADD DATAFILE 'E:\app\dba\oradata\PLMEE02_data' SIZE 100M AUTOEXTEND ON NEXT 10M * ERROR at line 1: ORA-00959: tablespace 'PLMEE_DATA' does not exist ALTER TABLESPACE PLMEE_DATA ADD DATAFILE 'E:\app\dba\oradata\PLMEE03_data' SIZE 100M AUTOEXTEND ON NEXT 10M * ERROR at line 1: ORA-00959: tablespace 'PLMEE_DATA' does not exist ALTER TABLESPACE PLMEE_DATA ADD DATAFILE 'E:\app\dba\oradata\PLMEE04_data' SIZE 100M AUTOEXTEND ON NEXT 10M * ERROR at line 1: ORA-00959: tablespace 'PLMEE_DATA' does not exist ALTER TABLESPACE PLMEE_DATA ADD DATAFILE 'E:\app\dba\oradata\PLMEE05_data' SIZE 100M AUTOEXTEND ON NEXT 10M * ERROR at line 1: ORA-00959: tablespace 'PLMEE_DATA' does not exist CREATE USER PLMEE IDENTIFIED BY PLMEE DEFAULT TABLESPACE PLMEE_DATA TEMPORARY TABLESPACE PLMEE_TEMP * ERROR at line 1: ORA-00959: tablespace 'PLMEE_DATA' does not exist GRANT CONNECT,RESOURCE TO PLMEE * ERROR at line 1: ORA-01917: user or role 'PLMEE' does not exist ALTER USER PLMEE QUOTA UNLIMITED ON PLMEE_DATA * ERROR at line 1: ORA-01918: user 'PLMEE' does not exist ALTER USER PLMEE QUOTA UNLIMITED ON PLM_DATA * ERROR at line 1: ORA-01918: user 'PLMEE' does not exist ALTER USER PLMEE QUOTA UNLIMITED ON USERS * ERROR at line 1: ORA-01918: user 'PLMEE' does not exist old 1: CREATE OR REPLACE DIRECTORY DUMP_DIR AS '&1' new 1: CREATE OR REPLACE DIRECTORY DUMP_DIR AS 'D:\dbInit\' Directory created. GRANT READ,WRITE ON DIRECTORY DUMP_DIR TO PLMEE * ERROR at line 1: ORA-01917: user or role 'PLMEE' does not exist Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options create user and make directory finished...
08-28
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值