今天有个兄弟要删除不想用的temporary tablespace,,我大概整理了下面几点意见..
- 0. 创建好新的temporary tablespace,,修改用户的默认temporary tablespace,可能的话,,修改database的默认temporary tablespace.
1 |
create temporary tablespace tempyyy tempfile 'path_to_tempfile_yyy' size xxx; |
2 |
alter user zzz temporary tablespace tempyyy; |
3 |
alter database default temporary tablespace tempyyy; |
- 1. 所有用户的default temporary tablespace不是这个.
1 |
select username,temporary_tablespace from dba_users where temporary_tablespace = 'tempxxx' ; |
- 2. 确认没有用户正在使用当前的temporary tablespace.
1 |
select username,session_num,tablespace from v$sort_usage where tablespace = 'tempxxx' ; |
- 3. 对于temporary tablespace ,,可以一个数据文件,一个数据文件的删除.
1 |
alter database tempfile 'tempfilexxx' drop ; |