Find out how much space is left in each tablespace. Select tablespace_name, sum(bytes) bytes From dba_free_space Group by tablespace_name;
How to find the location of the online redo log files
Get online Redo Log files. SELECT GROUP#, MEMBER FROM sys.v$logfile;
How to find the library cache hit ratio
Library Cache Hit Ratio. select sum(pins) Executions, sum(pinhits) “Execution Hits”, ((sum(pinhits) / sum(pins)) * 100) phitrat, sum(reloads) Misses, ((sum(pins) / (sum(pins) + sum(reloads))) * 100) hitrat from v$librarycache;
How to list init.ora settings
V$ script to get INIT.ORA settings. select name, value, isdefault, isses_modifiable, issys_modifiable from v$parameter order by name
How to find the hit ratio percentage
Hit ratios below 90-95% are usually a sign of poor indexing, BUT Distortion of the hit ratio numbers is possible select (1-(sum(decode(name, ‘physical reads’, value,0))/ (sum(decode(name, ‘db block gets’, value,0)) + (sum(decode(name, ‘consistent gets’, value,0)))))) * 100 “Read Hit Ratio”
How big is your database?
/* How big is the DB ? */ compute sum of bytes on report break on report Select tablespace_name, sum(bytes) bytes From dba_data_files Group by tablespace_name;
How to check your tablespace setup
select tablespace_name, initial_extent, next_extent, pct_increase, min_extlen from dba_tablespaces where (initial_extent not in (160*1024, 5120*1024, 160*1024*1024) or next_extent != initial_extent or pct_increase != 0 or min_extlen != initial_extent) and contents = ‘PERMANENT’ and tablespace_name!=’SYSTEM’ and tablespace_name not in (select tablespace_name from
How to get the data dictionary cache miss ratio
/* Data dictionary cache miss ratio. Looking for a good percentage hit rate. */ select sum(gets) “Gets”, sum(getmisses) “Misses”, (1 – (sum(getmisses) / (sum(gets) + sum(getmisses))))*100 “HitRate” from v$rowcache;
How to use an Oracle function to query a LONG datatype
Have you ever tried to use LONG columns in the WHERE clause of your SQL statement? Something like ‘WHERE long_column like ‘%SEARCH%’? If so, you know this does not work! (You get ‘ORA-00932: inconsistent datatypes’) This tip shows how you
Numeric For Loops in Oracle
Numeric for loops are one of the workhorses of the PL/SQL programming language. They allow you to iterate through a piece of code an arbitrary number of times. For example, to loop through all the years of this decade: For
