SELECT 'The Required undo tablespace size using Statistics In Memory is ' || dbms_undo_adv.required_undo_size(900) || ' MB' required_undo_size FROM dual;
Monday, October 23, 2023
Query to get 10 Large Object in Oracle Database
SELECT * FROM (select SEGMENT_NAME,SEGMENT_TYPE,BYTES/1024/1024/1024 GB,TABLESPACE_NAME from dba_segments order by 3 desc) WHERE ROWNUM <= 10;
Saturday, October 21, 2023
Recovery file usage
col name format a32
col size_mb format 999,999,999
col used_mb format 999,999,999
col pct_used format 999
select
name,
ceil( space_limit / 1024 / 1024) size_mb,
ceil( space_used / 1024 / 1024) used_mb,
decode( nvl( space_used, 0),0, 0,
ceil ( ( space_used / space_limit) * 100) ) pct_used
from
v$recovery_file_dest
order by
name desc;
col size_mb format 999,999,999
col used_mb format 999,999,999
col pct_used format 999
select
name,
ceil( space_limit / 1024 / 1024) size_mb,
ceil( space_used / 1024 / 1024) used_mb,
decode( nvl( space_used, 0),0, 0,
ceil ( ( space_used / space_limit) * 100) ) pct_used
from
v$recovery_file_dest
order by
name desc;
Meta data tablespace
set lines 190 set pages 5000 set long 50000 set head off echo off select 'select dbms_metadata.get_ddl(''TABLESPACE'',''' || tablespace_name || ''') from dual;' from dba_tablespaces where tablespace_name='TSTDOCMGMT01';
Wednesday, October 11, 2023
killing inactive session from Oracle database
SELECT 'ALTER SYSTEM KILL SESSION '''
|| s.sid
|| ','
|| s.serial#
|| ''' IMMEDIATE;'
AS ddl
FROM v$session s
WHERE s.status='INACTIVE';
|| s.sid
|| ','
|| s.serial#
|| ''' IMMEDIATE;'
AS ddl
FROM v$session s
WHERE s.status='INACTIVE';
Subscribe to:
Posts (Atom)