-- check user segment
SELECT *
FROM dba_segments s
WHERE owner = 'PULSEUSER'
ORDER BY bytes DESC;
-- Check DBA segments
SELECT Trunc(SUM(s.bytes / 1024 / 1024 / 1024), 1) GB
FROM dba_segments s;
GB |
---|
299 |
-- Check user tablespace
SELECT tablespace_name,
Trunc(SUM(bytes / 1024 / 1024 / 1024), 1) GB
FROM dba_data_files
GROUP BY tablespace_name;
TABLESPACE_NAME | GB |
---|---|
PULSEFILES_TABLESPACE | 0 |
UNDOTBS1 | 14 |
SYSAUX | 1 |
USERS | 0 |
SYSTEM | 0.7 |
PULSEUSER_TABLESPACE | 299.2 |
TEST_TABLESPACE | 9.7 |
-- Check temp tablespace
SELECT Trunc(SUM(bytes_used / 1024 / 1024 / 1024), 1) GBUsed,
Trunc(SUM(bytes_free / 1024 / 1024 / 1024), 1) GBFree
FROM v$temp_space_header;
GBUSED | GBFREE |
---|---|
228 | 8.9 |
-- Add tablefile to tablespace
ALTER TABLESPACE temp ADD tempfile '/u01/app/oracle/oradata/pulse/temp20.dbf'
SIZE 2g REUSE autoextend ON NEXT 2g;
-- disconnect session using temp table space
set heading OFF
spool runme.SQL
SELECT 'alter system kill session '''
||a.sid
||','
||a.serial#
||''' immediate;'
FROM v$session a,
v$sort_usage b,
v$process c,
v$parameter d
WHERE d.name = 'db_block_size'
AND a.saddr = b.session_addr
AND a.paddr = c.addr
AND b.tablespace = 'TEMP'
ORDER BY b.tablespace,
b.segfile#,
b.segblk#,
b.blocks;
spool OFF;
@runme.SQL
-- DROP temp table file
ALTER DATABASE tempfile '/u01/app/oracle/oradata/pulse/temp20.dbf' DROP
INCLUDING datafiles;
-- Add temp table file
ALTER TABLESPACE temp ADD tempfile '/u01/app/oracle/oradata/pulse/temp00.dbf'
SIZE 2g REUSE autoextend ON NEXT 2g;
http://www.dba-oracle.com/t_oracle_recycle_bin.htm
To purge all objects from the recycle bin, use:
SQL>
conn / as
sysdba
Connected.
SQL>
purge
dba_recyclebin;
DBA Recyclebin purged.
SQL>
conn / as
sysdba
Connected.
SQL>
purge
dba_recyclebin;
DBA Recyclebin purged.
SQL>