任务:创建默认临时表空间组TMP_GRP,组成员temp1,temp2,数据文件大小10M
--查看当前数据库默认临时表空间是什么?
SYS@ENMOEDU>select property_value from database_properties where property_name = 'DEFAULT_TEMP_TABLESPACE';
PROPERTY_VALUE
--------------------------------------------------------------------------------
TEMPTS1
SYS@ENMOEDU>
--查看当前数据库有哪些类型的表空间
SYS@ENMOEDU>select tablespace_name,contents from dba_tablespaces;
TABLESPACE_NAME CONTENTS
------------------------------ ---------
SYSTEM PERMANENT
SYSAUX PERMANENT
UNDOTBS1 UNDO
TEMPTS1 TEMPORARY
USERS PERMANENT
SYS@ENMOEDU>
--创建临时表空间组TMP_GRP
SYS@ENMOEDU>create temporary tablespace temp1 tempfile '/u01/app/oracle/oradata/ENMOEDU/temp_01.dbf' size 10m tablespace group TMP_GRP;
Tablespace created.
SYS@ENMOEDU>create temporary tablespace temp2 tempfile '/u01/app/oracle/oradata/ENMOEDU/temp_02.dbf' size 10m tablespace group TMP_GRP;
Tablespace created.
SYS@ENMOEDU>
--查看表空间组情况
SYS@ENMOEDU>select tablespace_name,contents from dba_tablespaces;
TABLESPACE_NAME CONTENTS
------------------------------ ---------
SYSTEM PERMANENT
SYSAUX PERMANENT
UNDOTBS1 UNDO
TEMPTS1 TEMPORARY
USERS PERMANENT
TEMP1 TEMPORARY
TEMP2 TEMPORARY
7 rows selected.
SYS@ENMOEDU>select * from dba_tablespace_groups;
GROUP_NAME TABLESPACE_NAME
------------------------------ ------------------------------
TMP_GRP TEMP1
TMP_GRP TEMP2
SYS@ENMOEDU>
--修改临时表空间组TMP_GRP为数据库默认临时表空间
SYS@ENMOEDU>alter database default temporary tablespace TMP_GRP;
Database altered.
SYS@ENMOEDU>select property_value from database_properties where property_name = 'DEFAULT_TEMP_TABLESPACE';
PROPERTY_VALUE
--------------------------------------------------------------------------------
TMP_GRP
SYS@ENMOEDU>
--查看当前数据库默认临时表空间是什么?
SYS@ENMOEDU>select property_value from database_properties where property_name = 'DEFAULT_TEMP_TABLESPACE';
PROPERTY_VALUE
--------------------------------------------------------------------------------
TEMPTS1
SYS@ENMOEDU>
--查看当前数据库有哪些类型的表空间
SYS@ENMOEDU>select tablespace_name,contents from dba_tablespaces;
TABLESPACE_NAME CONTENTS
------------------------------ ---------
SYSTEM PERMANENT
SYSAUX PERMANENT
UNDOTBS1 UNDO
TEMPTS1 TEMPORARY
USERS PERMANENT
SYS@ENMOEDU>
--创建临时表空间组TMP_GRP
SYS@ENMOEDU>create temporary tablespace temp1 tempfile '/u01/app/oracle/oradata/ENMOEDU/temp_01.dbf' size 10m tablespace group TMP_GRP;
Tablespace created.
SYS@ENMOEDU>create temporary tablespace temp2 tempfile '/u01/app/oracle/oradata/ENMOEDU/temp_02.dbf' size 10m tablespace group TMP_GRP;
Tablespace created.
SYS@ENMOEDU>
--查看表空间组情况
SYS@ENMOEDU>select tablespace_name,contents from dba_tablespaces;
TABLESPACE_NAME CONTENTS
------------------------------ ---------
SYSTEM PERMANENT
SYSAUX PERMANENT
UNDOTBS1 UNDO
TEMPTS1 TEMPORARY
USERS PERMANENT
TEMP1 TEMPORARY
TEMP2 TEMPORARY
7 rows selected.
SYS@ENMOEDU>select * from dba_tablespace_groups;
GROUP_NAME TABLESPACE_NAME
------------------------------ ------------------------------
TMP_GRP TEMP1
TMP_GRP TEMP2
SYS@ENMOEDU>
--修改临时表空间组TMP_GRP为数据库默认临时表空间
SYS@ENMOEDU>alter database default temporary tablespace TMP_GRP;
Database altered.
SYS@ENMOEDU>select property_value from database_properties where property_name = 'DEFAULT_TEMP_TABLESPACE';
PROPERTY_VALUE
--------------------------------------------------------------------------------
TMP_GRP
SYS@ENMOEDU>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31400681/viewspace-2130614/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/31400681/viewspace-2130614/