Monday, January 5, 2009

Script:Sql's for Temporary tablespace mining


Sql to monitoring the temporary tablespace :
select segtype, extents, blocks
from v$tempseg_usage
where tablespace = 'TEMP';

To see the default temporary tablespace for a database, execute the following query:

SELECT * FROM DATABASE_PROPERTIES where PROPERTY_NAME='DEFAULT_TEMP_TABLESPACE';



Command To resize TEMPFILE:


ALTER DATABASE TEMPFILE 'temp01.dbf' RESIZE 100M;

Command to adding another sparse file:


ALTER TABLESPACE TEMP ADD TEMPFILE 'temp02.dbf' SIZE 100M;

TEMP tablespace resize Command:


ALTER DATABASE TEMPFILE '/u02/oracle/data/oradata/temp02.dbf' RESIZE 100M;

To see the default temporary tablespace for a database, execute the following query:

SQL> SELECT * FROM DATABASE_PROPERTIES where PROPERTY_NAME='DEFAULT_TEMP_TABLESPACE'

Query To Create Temporary tablespace:

CREATE TEMPORARY TABLESPACE temp01
TEMPFILE ‘/u02/xxx/xxx/temp01.dbs’ SIZE 500M;

No comments: