Database Blog

How To Add A Tempfile In Primary Database In Dataguard

How To Add A Tempfile In Primary Database In Dataguard Adding tempfiles to TEMP tablespaces in primary database, will not automatically create on standby database. Because no redo is generated,…

Read More

Flashback Primary Database In Dataguard Environment

Flashback Primary Database In Dataguard Environment 1. Make sure both primary and standby databases have flashback enabled. – PRIMARY DB SQL> select name,database_role,flashback_on from v$database; NAME DATABASE_ROLE FLASHBACK_ON ——— —————-…

Read More

Flash Recovery Area USED & FREE SPACE

select name, floor(space_limit/1024/1024) “Size MB”,ceil(space_used/1024/1024) “Used MB”             from v$recovery_file_dest order by name;

Read More

Find Sessions on RAC

select inst_id,count(*) from gv$session where username is not null group by inst_id;

Read More

Find Schema Details in Oracle

select owner, count(1), object_type from dba_objects group by owner, object_type having owner in (select username from dba_users where default_tablespace = ‘USERS’) and object_type = ‘TABLE’;

Read More

Query to check all the schemas and their sizes

    select OWNER,sum(bytes)/1024/1024/1000 “SIZE_IN_GB” from dba_segments group by owner order by owner;

Read More

Query to Display Archive Log Generation by Day in Oracle

SET PAGESIZE 70 SET LINESIZE 400 COL “Generation Date” FORMAT a30 SELECT TRUNC(completion_time)  “Generation Date” , round(SUM(blocks*block_size)/1048576,0) “Total for the Day in MB” FROM gv$archived_log GROUP BY TRUNC(completion_time) ORDER BY…

Read More

Adding a Datafile to Temp Tablespace

Query to see Current Temp Datafiles State   select d.TABLESPACE_NAME, d.FILE_NAME, d.BYTES/1024/1024 SIZE_MB, d.AUTOEXTENSIBLE, d.MAXBYTES/1024/1024 MAXSIZE_MB, d.INCREMENT_BY*(v.BLOCK_SIZE/1024)/1024 INCREMENT_BY_MB from dba_temp_files d, v$tempfile v where d.FILE_ID = v.FILE# order by d.TABLESPACE_NAME,…

Read More

Adding a Datafile to Tablespace

Query to see Current Datafiles State   select d.TABLESPACE_NAME, d.FILE_NAME, d.BYTES/1024/1024 SIZE_MB, d.AUTOEXTENSIBLE, d.MAXBYTES/1024/1024 MAXSIZE_MB, d.INCREMENT_BY*(v.BLOCK_SIZE/1024)/1024 INCREMENT_BY_MB from dba_data_files d, v$datafile v where d.FILE_ID = v.FILE# order by d.TABLESPACE_NAME, d.FILE_NAME;…

Read More

Query To Check Tablespace Allocated Size and Free Size in GB

Select b.tablespace_name, tbs_size SizeGB, a.free_space FreeGB from (select tablespace_name, round(sum(bytes)/1024/1024/1024,1) as free_space from dba_free_space group by tablespace_name UNION select tablespace_name, round((free_space)/1024/1024/1024,1) as free_space from            …

Read More