Presentation is loading. Please wait.

Presentation is loading. Please wait.

Errorstack –Shortstack

Similar presentations


Presentation on theme: "Errorstack –Shortstack"— Presentation transcript:

1 Errorstack –Shortstack
6/7/2018 By Rishi Raj Srivastava (Oracle Certified Master) Download this from geopdata.com Rishi Raj Srivastava (Oracle Certified Master)

2 About Me My name is Rishi , I have 11 years of DBA experience.
6/7/2018 About Me My name is Rishi , I have 11 years of DBA experience. An Oracle Certified Master My key skill sets are AWS, Dataguard, Golden Gate, Performance Tuning , RAC I have worked as Country SME in IBM for Oracle technology. Worked for Metalink Support in performance and core database team. Current Employer HPE – SME database Technology Rishi Raj Srivastava (Oracle Certified Master) Geopdata.com

3 After this session you should be able to understand.
6/7/2018 After this session you should be able to understand. Define Errorstack and short_stack. When to use Errorstack and short_stack. How to enable the Errorstack and short_stack. How to disable the Errorstack. How to read the Errorstack trace file (Only Relevant) Geopdata.com Rishi Raj Srivastava (Oracle Certified Master)

4 Errorstack – What and Why
6/7/2018 Errorstack – What and Why A triggering event/ Debugging Tool To generate the trace file To know the failing SQL To extract the information about database user To get the call stack or failing functions. To know the bind values. To know if Oracle is looping in its code. is Oracle debugging/triggering event generates a trace file in case of any error. Let’s assume you are getting any error for which you wish to know more, then you can setup the error stack for that particular trace file and you will get a trace file in your user dump destination whenever database encounters that error, so Errorstack is a triggering event. Why Do I need any trace for error? To extract Failing SQL statement. To know who is running it. It also contains execution plan in some cases. To get Oracle call stack or failing functions. To know the bind values. To know if it’s looping geopdata.com Rishi Raj Srivastava (Oracle Certified Master)

5 Errorstack – What and Why ………….Continue
6/7/2018 Errorstack – What and Why ………….Continue Any Error where you need more information about session... Like 942, etc. Any Session which is hanging e.g. Drop user, drop table etc. Any single process taking huge amount of CPU, to confirm if its spinning geopdata.com Rishi Raj Srivastava (Oracle Certified Master)

6 How to Set The Errorstack
6/7/2018 How to Set The Errorstack Alter system set events ‘XXX trace name errorstack, level 3’; In Parameter file.. event=’XXX trace name errorstack, level 3′ Alter session set events ‘XXX trace name errorstack level 3’; Geopdata.com Rishi Raj Srivastava (Oracle Certified Master)

7 6/7/2018 Continue .. If You need errorstack for any existing session with the help of oradebug. connect / as sysdba oradebug setospid <<OS ID>> Oradebug errorstack level 3; Geopdata.com Rishi Raj Srivastava (Oracle Certified Master)

8 Trace File Analysis & Important Sections..
6/7/2018 Trace File Analysis & Important Sections.. Header of Trace file Dump file /ora/admin/ABCDEFGH/udump/YYYY_ora_2851.trc Oracle Database 11g Enterprise Edition Release – 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options ORACLE_HOME = /ora/product/v102 <<Oracle Home>> System name: SunOS <<OS Detail >> Node name: XXXXXX <<Machine Name>> Release: 5.10 <<OS VERSION>> Version: Generic_ Machine: sun4u Instance name: YYYYY geopdata.com Rishi Raj Srivastava (Oracle Certified Master)

9 6/7/2018 Continue … To find the current sql , you need to search with below keyword in trace file “Current SQL statement for this session” Another important Section to check is “Call Stack Trace”. geopdata.com Rishi Raj Srivastava (Oracle Certified Master)

10 6/7/2018 Continue … Session/Process Information: To know who the running is the failing statement, search the trace file with “(session” keyword. It takes you to the piece of trace where we get the session detail. Process Group: DEFAULT, pseudo proc: 3bc7fbd80 O/S info: user: oracle, term: pts/1, ospid: OSD pid info: Unix process pid: 2851, image: V1-V3) —————————————- SO: 3bb33b428, type: 4, owner: 3bc523d90, flag: INIT/-/-/0x00 (session) sid: 1984 trans: 0, creator: 3bc523d90, flag: (41) USR/- BSY/-/-/-/-/- DID: E-00005D31, short-term DID: txn branch: 0 oct: 3, prv: 0, sql: 3ab153708, psql: 3bd6647c8, user: 0/SYS service name: SYS$USERS O/S info: user: oracle, term: pts/1, ospid: 2802, machine: XXXXXX program: (TNS V1-V3) application name: (TNS V1-V3), hash value= OTHER SECTIONS Geopdata.com Rishi Raj Srivastava (Oracle Certified Master)

11 Continue … Bind Values – To find the bind values below keywords are useful Search the “Current Cursor” and find the cursor# Take the cursor number and search “Cursor#Num” Search the “Bind Info” in same cursor Plan Table Search with the keyword “Current Cursor” or “Plan Table” Geopdata.com Rishi Raj Srivastava (Oracle Certified Master)

12 Shortstack Is quick way to get the ‘call stack tree’
6/7/2018 Shortstack Is quick way to get the ‘call stack tree’ SQL>Connect / as sysdba SQL> oradebug setospid XXXX SQL> oradebug short_stack Wait for 1 minute and run again SQL> oradebug short_stack Suppose there is a session (user session/background process) which is hanging, sometime it might take 100% CPU as well. Mostly seen in case of background process, you have doubt its spinning then you can go for short stack option which would be quicker to get the stack, we can extract this from Errorstack also but this is quicker. Geopdata.com Rishi Raj Srivastava (Oracle Certified Master)

13 Shortstack Continue … Do you see same call stack in all run ?
6/7/2018 Shortstack Continue … Do you see same call stack in all run ? Oracle Support will give you direct hit SQL>Connect / as sysdba SQL> oradebug setospid SQL> oradebug short_stack ksdxfstk()+36<-ksdxcb()+2472<-sspuser()+176<-__sighndlr()+12<-call_user_handler()+992<-sigacthandler()+104<-_read()+12<-read()+96<-sntpread()+16<-ntprd()+116<-nsprecv()+352<-nsrdr()+124<-nsdo()+1540<-nsbrecv()+32<-nioqrc()+372<-opikndf2()+740<-opitsk()+836<-opiino()+1128<-opiodr()+1536<-opidrv()+828<-sou2o()+80<-opimai_real()+124<-main()+152<-_start()+380 Wait for 1 minute and run again. SQL> oradebug short_stack Wait for 1 minute Geopdata.com Rishi Raj Srivastava (Oracle Certified Master)

14 FAQ – A Quick Recap Do I need to pay extra for this tracing ?
6/7/2018 FAQ – A Quick Recap Do I need to pay extra for this tracing ? How to find out SPID from trace file. How to know the detail of end users who is generating error ? How to know failing query ? Will it impact database performance if I enable Errorstack ? Trace file is text or binary ? Why Shortstack ? Geopdata.com Rishi Raj Srivastava (Oracle Certified Master)

15 6/7/2018 Any Questions ?? geopdata.com Rishi Raj Srivastava (Oracle Certified Master)

16 6/7/2018 Thank You !!! Have more questions ?? GEOPDATA.COM Geopdata.com Rishi Raj Srivastava (Oracle Certified Master)


Download ppt "Errorstack –Shortstack"

Similar presentations


Ads by Google