Tuesday, June 17, 2008

Tracing a Oracle session

To trace a session
1) For tracing any session we require SID, SERIAL# of that session. Also SPID will help In finding out the session trace file in UDMP folder as trace files are named using SPID of that session.
2) Find out the SID, SERIAL from v$session.
select sid, serial#, machine, terminal from v$session order by logon_date;
Check the machine name for confirming the SID.
3) Login to the DB server as sys as sysdba and give password.
Issue the command
EXEC DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION (, , TRUE);
4) Only after issuing this command should the user perform the transaction. Before issuing the command in 3rd step the user should have only logged in by giving the details like user id etc. He should wait till the command in the 3rd step is issued.
5) Once the command is executed the user can start his/her transaction.
6) For stopping/disabling the trace issue:
EXEC DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(,,FALSE);
7) After stopping the trace you can find the trace file in UDUMP folder.UDUMP will be located in C:\Ora9idb\admin\HDC\udump.The spid will be included in the trace file name hdcorion_8853.trc. 8853 is the spid here.
8) The trace file will not be in readable format. You have to convert that in readable format by issuing the following command for the command prompt
TKPROF explain = sort=(prsela,exeela,fchela).
EXAMPLE:
TKPROF c:\trace01.txt explain=kastle/kastle sort=(prsela,exeela,fchela)

Enable /3G Switch and PAE for Windows

Scope :
To Enable the /3G Switch and PAE for Windows based system.
Restrictions :
It requires a restart of the OS.
How to :
Edit the boot.ini file in the location c:\
Go to run ->type c:\boot.ini
It will open a notepad,
Add the text marked in bold and then restart the server,
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise" /fastdetect /NoExecute=OptIn /3G /PAE
Note:
boot.ini file is a invisible file.