Wednesday, November 24, 2021

ODI - Sql query to monitor TEMP size and resize

Query to monitor the temp total, used and free space in mb:

Select A.tablespace_name tablespace , D.mb_total, SUM(A.used_blocks * D.block_size) / 1024 / 1024 mb_used, D.mb_total - SUM(A.used_blocks * D.block_size) / 1024 / 1024 mb_free

From v$sort_segment A, ( select B.name, C.block_size, SUM(C.bytes) / 1024 / 1024 mb_total from v$tablespace B, v$tempfile C where B.ts#= C.ts#

Group by B.name, C.block_size) D

Where A.tablespace_name = D.name

Group by A.tablespace_name, D.mb_total


Query to Resize the temp file space:

Alter Database TEMPFILE 'tempfile' RESIZE 300G



No comments:

Post a Comment

Featured Post

OIC - How to Retrieve Email Attachments Using Microsoft Graph API: Automating Payment File Processing

Retrieving Email Attachments Using Microsoft Graph API: Automating Payment File Storage in Object Storage Use Case: A finance team needs t...