Oracle重建临时表空间
2013-07-13 23:22
435 查看
[oracle@hd58 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 27 11:58:25 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@JOY:~>col PROPERTY_VALUE format a15
SYS@JOY:~>col DESCRIPTION format a37
SYS@JOY:~>select PROPERTY_VALUE,DESCRIPTION from database_properties where property_name='DEFAULT_TEMP_TABLESPACE';
PROPERTY_VALUE DESCRIPTION
--------------- -------------------------------------
TEMP Name of default temporary tablespace
SYS@JOY:~>select username,temporary_tablespace from dba_users where rownum < 10;
USERNAME TEMPORARY_TABLESPACE
------------------------------ ------------------------------
MGMT_VIEW TEMP
SYS TEMP
SYSTEM TEMP
DBSNMP TEMP
SYSMAN TEMP
SCOTT TEMP
HR TEMP
OUTLN TEMP
FLOWS_FILES TEMP
9 rows selected.
SYS@JOY:~>select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
/opt/app/oracle/oradata/JOY/temp01.dbf
SYS@JOY:~>
当前默认temp tablespace是temp,对应数据文件是/opt/app/oracle/oradata/JOY/temp01.dbf
创建新临时表空间并切换
SYS@JOY:~>create temporary tablespace temp02 tempfile '/opt/app/oracle/oradata/JOY/temp02.dbf' size 10m autoextend on next 2m maxsize unlimited;
Tablespace created.
SYS@JOY:~>alter tablespace temp02 add tempfile '/opt/app/oracle/oradata/JOY/temp02_01.dbf' size 10m autoextend on next 2m maxsize unlimited;
Tablespace altered.
SYS@JOY:~>alter database default temporary tablespace temp02;
Database altered.
SYS@JOY:~>select PROPERTY_VALUE,DESCRIPTION from database_properties where property_name='DEFAULT_TEMP_TABLESPACE';
PROPERTY_VALUE DESCRIPTION
--------------- -------------------------------------
TEMP02 Name of default temporary tablespace
SYS@JOY:~>drop tablespace temp including contents and datafiles;
Tablespace dropped.
SYS@JOY:~>select username,temporary_tablespace from dba_users where rownum < 10;
USERNAME TEMPORARY_TABLESPACE
------------------------------ ------------------------------
MGMT_VIEW TEMP02
SYS TEMP02
SYSTEM TEMP02
DBSNMP TEMP02
SYSMAN TEMP02
SCOTT TEMP02
HR TEMP02
OUTLN TEMP02
FLOWS_FILES TEMP02
9 rows selected.
SYS@JOY:~>select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
/opt/app/oracle/oradata/JOY/temp02.dbf
/opt/app/oracle/oradata/JOY/temp02_01.dbf
转载:http://blog.csdn.net/staricqxyz/article/details/8308017
SQL*Plus: Release 11.2.0.3.0 Production on Wed Jun 27 11:58:25 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@JOY:~>col PROPERTY_VALUE format a15
SYS@JOY:~>col DESCRIPTION format a37
SYS@JOY:~>select PROPERTY_VALUE,DESCRIPTION from database_properties where property_name='DEFAULT_TEMP_TABLESPACE';
PROPERTY_VALUE DESCRIPTION
--------------- -------------------------------------
TEMP Name of default temporary tablespace
SYS@JOY:~>select username,temporary_tablespace from dba_users where rownum < 10;
USERNAME TEMPORARY_TABLESPACE
------------------------------ ------------------------------
MGMT_VIEW TEMP
SYS TEMP
SYSTEM TEMP
DBSNMP TEMP
SYSMAN TEMP
SCOTT TEMP
HR TEMP
OUTLN TEMP
FLOWS_FILES TEMP
9 rows selected.
SYS@JOY:~>select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
/opt/app/oracle/oradata/JOY/temp01.dbf
SYS@JOY:~>
当前默认temp tablespace是temp,对应数据文件是/opt/app/oracle/oradata/JOY/temp01.dbf
创建新临时表空间并切换
SYS@JOY:~>create temporary tablespace temp02 tempfile '/opt/app/oracle/oradata/JOY/temp02.dbf' size 10m autoextend on next 2m maxsize unlimited;
Tablespace created.
SYS@JOY:~>alter tablespace temp02 add tempfile '/opt/app/oracle/oradata/JOY/temp02_01.dbf' size 10m autoextend on next 2m maxsize unlimited;
Tablespace altered.
SYS@JOY:~>alter database default temporary tablespace temp02;
Database altered.
SYS@JOY:~>select PROPERTY_VALUE,DESCRIPTION from database_properties where property_name='DEFAULT_TEMP_TABLESPACE';
PROPERTY_VALUE DESCRIPTION
--------------- -------------------------------------
TEMP02 Name of default temporary tablespace
SYS@JOY:~>drop tablespace temp including contents and datafiles;
Tablespace dropped.
SYS@JOY:~>select username,temporary_tablespace from dba_users where rownum < 10;
USERNAME TEMPORARY_TABLESPACE
------------------------------ ------------------------------
MGMT_VIEW TEMP02
SYS TEMP02
SYSTEM TEMP02
DBSNMP TEMP02
SYSMAN TEMP02
SCOTT TEMP02
HR TEMP02
OUTLN TEMP02
FLOWS_FILES TEMP02
9 rows selected.
SYS@JOY:~>select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
/opt/app/oracle/oradata/JOY/temp02.dbf
/opt/app/oracle/oradata/JOY/temp02_01.dbf
转载:http://blog.csdn.net/staricqxyz/article/details/8308017
相关文章推荐
- ORACLE 在线重建临时表空间
- 重建oracle临时表空间
- Oracle 重建控制文件对只读表空间和临时表空间影响的测试
- Oracle 重建控制文件 对 只读表空间 和 临时表空间 影响 测试
- Oracle中如何重建与切换临时表空间
- 17_Oracle_Admin_表空间的管理方式以及UNDO和临时表空间
- oracle 重建OEM
- oracle 12c 重建序列SEQUENCE
- ora-01652问题 oracle 如何缩小和重建temp表空间的数据文件
- 重建Oracle 10g EM
- oracle总结-临时表空间
- Oracle重建undo表空间
- 误删除$ORACLE_HOME/dbs下的参数文件、密码文件,如何快速重建
- ORACLE 临时表空间
- Oracle 临时表空间收缩
- 查找oracle临时表空间占用情况
- ORACLE重建索引详解
- Oracle 创建索引、重建索引、删除索引的语法
- ORACLE重建控制文件
- oracle冷备份恢复重建控制文件