⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cleartemp.sql

📁 oracle数据库在使用一段时间后,会出现temp表空间过大的问题,此代码作用是清除oralce数据库temp表空间,并重建之
💻 SQL
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -