cleartemp.sql
来自「oracle数据库在使用一段时间后,会出现temp表空间过大的问题,此代码作用是」· SQL 代码 · 共 17 行
SQL
17 行
1、 --启动数据库
sqlplus /nolog
conn sys/pwd@ora92 as sysdba
startup
2、--创建中转临时表空间
create temporary tablespace TEMP2 TEMPFILE 'D:\oracle\oradata\nc\temp02.dbf' SIZE 512M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED;
3、--改变系统默认临时表空间 为刚刚创建的新临时表空间temp2
alter database default temporary tablespace temp2;
4、--删除原来临时表空间temp
drop tablespace temp including contents and datafiles;
5、--重新创建临时表空间temp
create temporary tablespace TEMP TEMPFILE 'D:\oracle\oradata\nc\temp01.dbf' SIZE 512M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED;
6、 --重置系统默认临时表空间
alter database default temporary tablespace temp;
7、--删除中转临时表空间temp2
drop tablespace temp2 including contents and datafiles;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?