资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

oracle怎么删空间,oracle数据库怎么删除表空间

oracle临时表空间删除和重建过程分享

临时表空间用来管理数据库排序操作以及用于存储临时表、中间排序结果等临时对象,当ORACLE里需要用到SORT的时候,并且当PGA中sort_area_size大小不够时,将会把数据放入临时表空间里进行排序。临时表空间存储大规模排序操作(小规模排序操作会直接在RAM里完成,大规模排序才需要磁盘排序Disk Sort)和散列操作的中间结果.它跟永久表空间不同的地方在于它由临时数据文件(temporary files)组成的,而不是永久数据文件(datafiles)。临时表空间不会存储永久类型的对象,所以它不会也不需要备份。另外,对临时数据文件的操作不产生redo日志,不过会生成undo日志。

创新互联于2013年创立,先为肥城等服务建站,肥城等地企业,进行企业商务咨询服务。为肥城企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。

创建临时表空间或临时表空间添加临时数据文件时,即使临时数据文件很大,添加过程也相当快。这是因为ORACLE的临时数据文件是一类特殊的数据文件:稀疏文件(Sparse File),当临时表空间文件创建时,它只会写入文件头部和最后块信息(only writes to the header and last block of the file)。它的空间是延后分配的.这就是你创建临时表空间或给临时表空间添加数据文件飞快的原因。

另外,临时表空间是NOLOGGING模式以及它不保存永久类型对象,因此即使数据库损毁,做Recovery也不需要恢复Temporary Tablespace。

STEP1: Find the existing temp tablespace details

STEP2: Create another Temporary Tablespace TEMP1

STEP3: Move Default Database temp tablespace

STEP4: If any sessions are using temp space, then kill them.

STEP5: Drop the original temp tablespace.

Drop temp tablespace

If you want to change the name from TEMP1 to TEMP, then follow the same process as below.

STEP6: Create TEMP tablespace

STEP7: Make TEMP as default tablespace

STEP8: Drop temporary for tablespace temp1

oracle怎么删除临时表空间?

首先查看temp是不是某些用户的默认表空间

SELECT USERNAME,TEMPORARY_TABLESPACE FROM DBA_USERS;

如果有用户的默认临时表空间是temp的话,建议进行更改

alter user xxx temporary tablespace tempdefault;

设置tempdefault为默认临时表空间

alter database default temporary tablespace tempdefault;

然后用你列出来的语句删除即可

drop tablespace temp including contents and datafile;

即便丢失了所有的临时表空间,只要不是数据库当中用到了order by、子查询、group by、distinct等需要消耗临时表空间的语句(而且要比较大才行,小的话就直接用pga的SORT_AREA区了),那么也不会对业务造成错误导致中断,发现问题之后只需要新建一个临时表空间就可以了。你要是了解备份恢复的话,实际上在进行备份的时候临时表空间都不会进行备份,而只是有一个创建临时表空间的语句而已。

ORACLE删除不掉表空间?

oracle可以删除表空间。

1、登录oracle数据库,如用plsql,需要用户具有删除表空间的权限。

2、打开一个SQL窗口。

3、输入如下语句,并执行:

drop tablespace 表空间名;

如何清除oracle temp表空间

temp表空间过大时,可通过如下方法重建

SQL

create

temporary

tablespace

temp2

tempfile

'/opt/oracle/oradata/conner/temp1.dbf'

size

200M

autoextend

off;

SQL

alter

database

default

temporary

tablespace

temp2;

SQL

drop

tablespace

temp;

或者SQL

drop

tablespace

temp

including

contents

and

datafiles

cascade

constraints(彻底删除包括操作系统中的临时表空间的数据文件)

最后在操作系统上把temp的文件删除,就可以释放空间。

如何删除oracle临时表空间

删除表空间temp,但不删除其文件

用:drop

tablespace

temp;

删除表空间temp同时删除表空间的数据对象

用drop

tablespace

temp

including

contents;

删除表空间temp及其包含数据对象以及数据文件

用drop

tablespace

temp

including

contents

and

datafiles;

希望能帮助你


网站名称:oracle怎么删空间,oracle数据库怎么删除表空间
浏览路径:http://cdkjz.cn/article/dssgsgs.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220