Showing posts from November, 2011

Oracle Statistics Tables.

Hi ,

I am going to talk about Some Oracle Statistics Table that will be useful for tuning your database , and gathering information about your database , these table are very useful

For example Dynamic Performance View  :
**The below query will gives you the most sql statement taking more time in the CPU .
1-Select Sql_text , executions from v$sqlstats where cpu_time > 1000 ;
**Below Query Gives you some Details about Specific Machine 
2-Select * from v$session where machine = 'OSAMA_PC' and where
    logon_time > sysdate -1 ;
**finally , Lock in your database 
3- select sid,ctime from v$lock where block > 0 ;

Statistics Tables are :
**Display System Wide Statistics :

**Display System Wide Statistics :

 **Display Session-Related Statistics
V$Session _Event

**Display Service-Related Statistics

**Display Inf…

TKPROF And Oracle Trace Analysis

What is the TKPROF ??!!
The TKPROF program : converts Oracle trace files into a more readable form. If you have a problem query you can user TKPROF to get more information. 
But first you need to enable this tools since its unactivated in oracle  to start using it follow the below steps :
2-we need table called PLAN_TABLE if its dosen't found create it by following steps :
@ORACLE_HOME\rdbms\admin\utlxplan.sql CREATE PUBLIC SYNONYM PLAN_TABLE FOR SYS.PLAN_TABLE; GRANT SELECT, INSERT, UPDATE, DELETE ON SYS.PLAN_TABLE TO PUBLIC; 3-after doing the Previous steps , now you can use the amazing tools for example :
ALTER SESSION SET SQL_TRACE = TRUE; SELECT COUNT(*) FROM dual; ALTER SESSION SET SQL_TRACE = FALSE;OR Another Way to trace file :TKPROF explain=user/password@service table=sys.plan_tableOutput will be like :******************************************************************************** count = number of times OCI procedure was…

Create Enterprise manager for RAC (Real Application Cluster)

Hi All ,

Sometimes we need to create enterprise manager for Rac Environment , its the same way for One instance with different Command . 

We are here talk about 10g , 11g database .
you follow the below steps to create or recreate enterprise manager LET'S START :

if you already have RAC - enterprise manager and you need to recreate then start from here

**Stop Dbconsole for the both nodes :
Commands :

On Node-1
emctl stop dbconsole .
On Node 2 :
emctl stop dbconsole .

**Drop dbconsole with re posterity from node 1 :
Command :
$emca -deconfig dbcontrol db -repos drop -cluster

"you will wait for while until repos been dropped".

**recreate dbconsole with re posterity from node 1 "if you don't have EM for your Rac start from here"
Command :
$emca -config dbcontrol db -repos create -cluster 

"follow the instsruction and fill the information such as DB SID,Listener Port , Crs Name"

To know your CRS NAME : $CRS_HOME/bin/cemutlo -n
the output will be your crs na…