MERCADOS FINANCIEROS

lunes, 18 de julio de 2016

Metricas x Usuario


METRICAS X USUARIO

 

CACHE HIT RATIO

SELECT   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

 

COMMITS X HORA

select sum(value) sum from v$sysstat where name like 'user commits' or name like 'user rollbacks';

 

CURSORES OPEN CLUSTER

 

select count(*) from gv$open_cursor

where user_name='SYSADM'

and cursor_type='OPEN'

 

ESPACIO USADO AREA DE RECUPERACION

SELECT round(space_used/1024/1024/1024) AS "Space Used (Gb)" FROM v$recovery_file_dest

 

MAXIMO TIEMPO ESPERA CONCURRENCIA

select max(CONCURRENCY_WAIT_TIME) from gv$sql

 

MAXIMO USUARIOS EJECUCION STATEMENT

select max(users_opening) from gv$sql

 


NUMERO DE SESIONES $ PROCESOS ACTIVOS

SELECT count(*)

FROM   gv$session s,

       gv$process p

WHERE  s.paddr  = p.addr

AND    s.status = 'ACTIVE'

ORDER BY s.username, s.osuser

 

NUMERO DE SESIONES $ PROCESOS INACTIVOS

 

SELECT count(*)

FROM   gv$session s,

       gv$process p

WHERE  s.paddr  = p.addr

AND    s.status = 'INACTIVE'

ORDER BY s.username, s.osuser

 

NUMERO DE SESIONES & PROCESOS TOTALES

 

SELECT count(*)

FROM   gv$session s,

       gv$process p

WHERE  s.paddr  = p.addr

ORDER BY s.username, s.osuser

 

NUMERO DE SESIONES CLUSTER

select count(*) from gv$session

 

NUMERO DE SESIONES ESPERA

select count(*) from v$session_wait

 

NUMERO DE DESIONES ESPERA > 60s

select count(*) from v$session_wait

where seconds_in_wait > 60

 

NUMERO DE REGISTROS > TABLA

select max(num_rows) from dba_tables

 

OBJETOS INVALIDOS

 

select count(*) from dba_objects

where status = 'INVALID'

 

TIEMPO SERVICIO PROMEDIO

select ( s.service_seconds + w.wait_seconds) / user_calls service_time

from (

 select

 (sum(value)/100) / ( 3600 * 24 ) service_seconds

 from v$sysstat

 where upper(name) like '%CPU%'

 and class in (1,64) -- User and SQL

) s,

(

 select

 sum(time_waited/100) wait_seconds

 from v$system_event

 where event not like '%timer'

 and event not like '%from client'

) w,

(

 select

 sum(value) user_calls

 from v$sysstat

 where name like 'user%'

) u

 

TOTAL REDO X DIA

select round(sum(blocks*block_size)/1024/1024/1024,2) Gb from v$archived_log

where completion_time between sysdate-1 and sysdate

 

TOTAL REDO X MES

select round(sum(blocks*block_size)/1024/1024/1024,2) Gb from v$archived_log

where completion_time between sysdate-31 and sysdate

 

TRANSACCIONES X SEGUNDO

select round(sum(s.value / (86400 * (SYSDATE - startup_time))),3) "TPS" from v$sysstat s ,v$instance i where s.NAME in ('user commits','transaction rollbacks');

 

TIEMPO CURSORES > 1s

select count(*) from gv$sql

where elapsed_time > 1000000

 

TIEMPO CURSORES > 2s

select count(*) from gv$sql

where elapsed_time > 2000000

 


TIEMPO RESPUESTA > 10s

select count(*) from gv$sql

where cpu_time > 10000000

 

Tiempo Respuesta > 1m

select count(*) from gv$sql

where cpu_time > 60000000

 


Tiempo Respuesta > 1s

 

select count(*) from gv$sql

where cpu_time > 1000000

 

Total Queries Cluster

 

select count(*) from gv$sql;

 


Total Queries Invalid

 

select count(*) from gv$sql where object_status <> 'VALID'

 

 

 

lunes, 11 de julio de 2016

Configuracion de Red Cluster Oracle

# Red publica


172.28.28.10 ct1bosunsipep01

172.28.28.12 ct1bosunsipep02

172.28.28.14 ct1bosunsipep03

172.28.28.16 ct1bosunsipep04


172.28.28.11 ct1bosunsipep01-test1

172.28.28.22 ct1bosunsipep01-test2


#Red Backup


172.28.249.120 ct1bosunsipep01-bk

172.28.249.122 ct1bosunsipep02-bk

172.28.249.121 ct1bosunsipep01-bk-test1



# Red privada Cluster

192.168.250.33 clusternode1-priv

192.168.250.34 clusternode2-priv

192.168.250.35 clusternode3-priv

192.168.250.36 clusternode4-priv


192.168.250.9 ct1bosunsipep01-priv1



# Red VIP oracle

172.28.28.18 ct1bosunsipep01-vip

172.28.28.19 ct1bosunsipep02-vip

172.28.28.20 ct1bosunsipep03-vip

172.28.28.21 ct1bosunsipep04-vip



# Servidor de Backup



# 172.28.250.94 bksrv01







# 172.28.250.205 dboracle



# 172.28.250.207 dboraclenew



# 172.28.255.132 sunmc01







172.28.250.21 mserver01



172.28.250.20 mserver02



172.28.250.97 mserver03







# SERVIDOR TIVOLI MONITORY



10.201.2.130 srvtivcc01



bash-3.00$







LISTENER.ORA







# listener.ora.ct1bosunsipep01 Network Configuration File: /app/oracle/dbs/10.2.0.3/network/admin/listener.ora.ct1bosunsipep01



# Generated by Oracle configuration tools.







LISTENER_CT1BOSUNSIPEP01 =


(DESCRIPTION_LIST =


(DESCRIPTION =


(ADDRESS = (PROTOCOL = TCP)(HOST = ct1bosunsipep01-vip)(PORT = 1521)(IP = FIRST))



(ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.28.10)(PORT = 1521)(IP = FIRST))


)



)







SID_LIST_LISTENER_CT1BOSUNSIPEP01 =



(SID_LIST =



(SID_DESC =



(SID_NAME = PLSExtProc)



(ORACLE_HOME = /app/oracle/dbs/10.2.0.3)



(PROGRAM = extproc)



)



(SID_DESC =



(SID_NAME = sirspe1)



(ORACLE_HOME = /app/oracle/dbs/10.2.0.3)



(GLOBAL_DBNAME = sirspe)



)



)











MAQUINA 2







# listener.ora.ct1bosunsipep02 Network Configuration File: /app/oracle/dbs/10.2.0.3/network/admin/listener.ora.ct1bosunsipep02



# Generated by Oracle configuration tools.







LISTENER_CT1BOSUNSIPEP02 =



(DESCRIPTION_LIST =



(DESCRIPTION =



(ADDRESS = (PROTOCOL = TCP)(HOST = ct1bosunsipep02-vip)(PORT = 1521)(IP = FIRST))



(ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.28.12)(PORT = 1521)(IP = FIRST))



)



)







SID_LIST_LISTENER_CT1BOSUNSIPEP02 =



(SID_LIST =



(SID_DESC =



(SID_NAME = PLSExtProc)



(ORACLE_HOME = /app/oracle/dbs/10.2.0.3)



(PROGRAM = extproc)



)



(SID_DESC =



(SID_NAME = sirspe2)



(ORACLE_HOME = /app/oracle/dbs/10.2.0.3)



(GLOBAL_DBNAME = sirspe)



)



)







TNSNAMES.ORA




LISTENERS_SIRSPE =



(ADDRESS_LIST =



(ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.28.18)(PORT = 1521))



(ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.28.19)(PORT = 1521))


(ADDRESS = (PROTOCOL = TCP)(HOST = ct1bosunsipep03-vip)(PORT = 1521))



(ADDRESS = (PROTOCOL = TCP)(HOST = ct1bosunsipep04-vip)(PORT = 1521))


)




SIRSPE4 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = ct1bosunsipep04-vip)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = sirspe)

(INSTANCE_NAME = sirspe4)

)



)



SIRSPE3 =


(DESCRIPTION =


(ADDRESS = (PROTOCOL = TCP)(HOST = ct1bosunsipep03-vip)(PORT = 1521))


(CONNECT_DATA =


(SERVER = DEDICATED)


(SERVICE_NAME = sirspe)



(INSTANCE_NAME = sirspe3)



)



)







SIRSPE2 =


(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.28.19)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = sirspe)

(INSTANCE_NAME = sirspe2)



)



)







SIRSPE1 =


(DESCRIPTION =


(ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.28.18)(PORT = 1521))


(CONNECT_DATA =


(SERVER = DEDICATED)


(SERVICE_NAME = sirspe)

(INSTANCE_NAME = sirspe1)

)



)



SIRSPE_SRV =


(DESCRIPTION =


(ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.28.18)(PORT = 1521))

(ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.28.19)(PORT = 1521))


(ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.28.20)(PORT = 1521))

(ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.28.21)(PORT = 1521))


(LOAD_BALANCE = yes)


(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = sirspe_srv)

(FAILOVER_MODE =

(TYPE = SELECT)

(METHOD = BASIC)

(RETRIES = 180)

(DELAY = 5)

)



)



)


SIRSPE =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.28.18)(PORT = 1521))

(ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.28.19)(PORT = 1521))

(ADDRESS = (PROTOCOL = TCP)(HOST = ct1bosunsipep03-vip)(PORT = 1521))

(ADDRESS = (PROTOCOL = TCP)(HOST = ct1bosunsipep04-vip)(PORT = 1521))

(LOAD_BALANCE = yes)



(CONNECT_DATA =



(SERVER = DEDICATED)



(SERVICE_NAME = sirspe)



)



)







LISTENERS_CT1BOSUNSIPEP02 =



(ADDRESS_LIST =



(ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.28.19)(PORT = 1521))



)







CAT10G =



(DESCRIPTION =



(ADDRESS = (PROTOCOL = TCP)(HOST = dboraclenew)(PORT = 1528))



(CONNECT_DATA =



(SERVER = DEDICATED)



(SERVICE_NAME = cat10g)



)



)