Skip to main content

Posts

How to see all spfile parameters

SET LINESIZE 300 COLUMN name  FORMAT A30 COLUMN value FORMAT A60 COLUMN displayvalue FORMAT A60 SELECT sp.sid,        sp.name,        sp.value,        sp.display_value FROM   v$spparameter sp ORDER BY sp.name, sp.sid;

How to avoid Virtual Network Failures After a Live Migration 'extended-mapin-space' is set to 'on' BUG:17694771

HOW TO AVOID EXTENDED-MAPIN-SPACE ISSUE This issue applies to: Oracle VM Sun Software - Generic Solaris SPARC Operating System SPARC Guest domains  Solaris 10 or Solaris 11 on Oracle VM Server for SPARC (LDOMs 2.1 to 3.1) may experience virtual network failures after a live migration operation if 'extended-mapin-space' is set to 'on'. You can check if you have set to 'on' the value extended-mapin-space as below   # ldm list -l | grep extended-mapin-space=on In the /var/adm/messages when the issue is happening you can see the following vnet1: exceeded number of permitted handshake attempts (5) on channel 22 To avoid this issue, set 'extended-mapin-space' to 'off' before executing a live migration. If the described  issue has already occurred, the system can be restored by executing the following commands to re-establish the virtual network connectivity: ldm stop <affected guest domain> ldm unbind <affe

How to see database property values

SELECT property_name,        property_value FROM   database_properties ORDER BY property_name;

How to see the database buffer cache advisory.

COLUMN size_for_estimate          FORMAT 999,999,999,999 heading 'Cache Size (MB)' COLUMN buffers_for_estimate       FORMAT 999,999,999 heading 'Buffers' COLUMN estd_physical_read_factor  FORMAT 999.90 heading 'Estd Phys|Read Factor' COLUMN estd_physical_reads        FORMAT 999,999,999,999 heading 'Estd Phys| Reads' SELECT size_for_estimate,         buffers_for_estimate,        estd_physical_read_factor,        estd_physical_reads FROM   v$db_cache_advice WHERE  name          = 'DEFAULT' AND    block_size    = (SELECT value                         FROM   v$parameter                         WHERE  name = 'db_block_size') AND    advice_status = 'ON';                                 Estd Phys        Estd Phys  Cache Size (MB)      Buffers Read Factor            Reads ---------------- ------------ ----------- ----------------               48        5,913        2.23    2,321,820,977               96       11,

How to see information for each datafiles

SET LINESIZE 200 COLUMN file_name FORMAT A70 SELECT file_id,        file_name,        ROUND(bytes/1024/1024/1024) AS size_gb,        ROUND(maxbytes/1024/1024/1024) AS max_size_gb,        autoextensible,        increment_by,        status FROM   dba_data_files ORDER BY file_name;

How to display oracle database hit ratio.

The hit ratio should be above 92% SELECT Sum(Decode(a.name, 'consistent gets', a.value, 0)) "Consistent Gets",        Sum(Decode(a.name, 'db block gets', a.value, 0)) "DB Block Gets",        Sum(Decode(a.name, 'physical reads', a.value, 0)) "Physical Reads",        Round(((Sum(Decode(a.name, 'consistent gets', a.value, 0)) +          Sum(Decode(a.name, 'db block gets', a.value, 0)) -          Sum(Decode(a.name, 'physical reads', a.value, 0))  )/            (Sum(Decode(a.name, 'consistent gets', a.value, 0)) +              Sum(Decode(a.name, 'db block gets', a.value, 0))))              *100,2) "Hit Ratio %" FROM   v$sysstat a; Consistent Gets DB Block Gets Physical Reads Hit Ratio % --------------- ------------- -------------- ----------- 219290056242 935535251 84827353092 61,48

How to display information for active database session

SET LINESIZE 800 SET PAGESIZE 100 COLUMN username FORMAT A15 COLUMN machine FORMAT A25 COLUMN logon_time FORMAT A20 SELECT NVL(s.username, '(oracle)') AS username,        s.osuser,        s.sid,        s.serial#,        p.spid,        s.lockwait,        s.status,        s.module,        s.machine,        s.program,        TO_CHAR(s.logon_Time,'DD-MON-YYYY HH24:MI:SS') AS logon_time,        s.last_call_et AS last_call_et_secs FROM   v$session s,        v$process p WHERE  s.paddr  = p.addr AND    s.status = 'ACTIVE' ORDER BY s.username, s.osuser;