笔者在日常系统检查时,通过Oracle Enterprise Manager Console检查数据库表空间使用情况,发现系统表空间使用率100% ,而且每个用户所对应临时表空间为系统表空间。发现此情况后,为了不影响系统正常运行对此问题进行检查。
1、通过sql查看数据库临时表空间、用户对应的临时表空间、系统默认临时表空间
select tablespace_name,file_name,bytes/1024/1024 file_size,autoextensible from dba_temp_files; autoextensible 自动扩展列
select username,default_tablespace,temporary_tablespace from dba_users where username = "SYSTEM";
select * from database_properties where property_name="DEFAULT_TEMP_TABLESPACE"
SELECT temp_used.tablespace_name,
total - used as "Free",
total as "Total",
round(nvl(total - used, 0) * 100 / total, 3) "Free percent"
FROM (SELECT tablespace_name, SUM(bytes_used) / 1024 / 1024 used
FROM GV$TEMP_SPACE_HEADER
GROUP BY tablespace_name) temp_used,
(SELECT tablespace_name, SUM(bytes) / 1024 / 1024 total
FROM dba_temp_files
GROUP BY tablespace_name) temp_total
WHERE temp_used.tablespace_name = temp_total.tablespace_name
2、 为每个用户创建临时表空间
create temporary tablespace oastemp tempfile ‘/dev/vgoracle/rdboastemp.dbf’ size 1024M;
create temporary tablespace eletemp tempfile ‘/dev/vgoracle/rdbeletemp.dbf’ size 500M;
create temporary tablespace tcmtemp tempfile ‘/dev/vgoracle/rdbtcmtemp.dbf’ size 500M;
并且指定对应的用户。
3、创建系统默认表空间
//建立一个中转临时表空间:
(1)>create temporary tablespace temp2
tempfile "D:oracleoradata est emp2.dbf" size 512M
reuse autoextend on next 100M maxsize 2048M;
(2) >alter database default temporary tablespace temp2;
(3) >drop tablespace temp including contents and datafiles;//重新建立一个新的临时表空间:
(1)>create temporary tablespace temp
tempfile "D:oracleoradata est emp01.dbf" size 512M
reuse autoextend on next 100M maxsize 1024M;
(2) >alter database default temporary tablespace temp;//修改用户对应的表空间
(3) >drop tablespace temp2 including contents and datafiles;
对以上操作最好做下控制文件备份方法如下:1、将控制文件备份为二进制文件SQL>alter database backup controlfile to "i:oracleackupcontrol.bkp";2、将控制文件备份为文本文件(备份到oracleaseadminsidudump目录下的跟踪文件中,将在跟踪文件中生成一个SQL脚本)SQL>alter database backup controlfile to trace;3、通过spfile生成pfile文件备份控制文件SQL>create pfile="/pfile_backup.ora" from spfile="/home/oracle/product/10.2.0/db_1/dbs/spfileSID.ora";
相关阅读:Oracle 临时表空间的管理与受损恢复http://www.linuxidc.com/Linux/2013-06/86337.htmOracle 临时表空间过大问题解决 http://www.linuxidc.com/Linux/2008-11/17473.htm解决ORA-14450:试图访问已经在使用的事务处理临时表 http://www.linuxidc.com/Linux/2013-08/89267.htmOracle创建基于事务和基于会话的临时表及临时表建索引的实验 http://www.linuxidc.com/Linux/2013-10/91985.htmOracle 临时表之临时表空间组(TTG) http://www.linuxidc.com/Linux/2012-12/75449.htm更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12使用select语句查看Oracle的各种命中率和性能统计数据重命名Oracle数据库服务器相关资讯 Oracle临时表 Oracle临时表空间
- Oracle 12C RAC关于临时表空间的一 (08/27/2015 16:38:26)
- Oracle中临时表空间的清理 (06/06/2015 06:34:17)
- Oracle 锁定临时表统计信息及锁住 (11/21/2014 13:58:20)
| - Oracle系统默认临时表空间以及redo (07/08/2015 08:41:18)
- Oracle中的临时表、外部表和分区表 (03/02/2015 13:36:40)
- 被Oracle全局临时表坑了 (10/20/2014 18:40:25)
|
本文评论 查看全部评论 (0)