Oracle: Create a temporary TEMP tablespace
CREATE TEMPORARY TABLESPACE TEMP_NEW TEMPFILE '/usr/opt/app/oracle/admin/gentest3/temp01/temp_01.dbf' SIZE 10m;
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP_NEW;
Retrieve ‘SID_NUMBER’ & ‘SERIAL#NUMBER’ of existing live session’s who are using old temporary tablespace ( i.e. TEMP ) and kill them.
set linesize 200
col STATUS format a10
col username format a15
col osuser format a10
SELECT b.tablespace,b.segfile#,b.segblk#,b.blocks,a.sid,a.serial#,
a.username,a.osuser, a.status
FROM v$session a,v$sort_usage b
WHERE a.saddr = b.session_addr;
Provide above inputs to following query, and kill session’s.
alter system kill session 'SID_NUMBER, SERIAL#NUMBER';
For example:
alter system kill session '59,57391';
DROP TABLESPACE TEMP including contents and datafiles;
CREATE TEMPORARY TABLESPACE TEMP TEMPFILE '/usr/opt/app/oracle/admin/gentest3/temp01/temp01.dbf' SIZE 10m autoextend on next 10m maxsize 32024M;
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP;
DROP TABLESPACE TEMP_NEW including contents and datafiles;
Comments
Post a Comment