Query to return all Oracle Deadlocks in 12c












2















Is there an object I can query in 12c to return all ORA-60 Deadlock alerts?



I just want to do a weekly report that outputs the number of deadlocks that have occurred and what schema they occurred on.



My Oracle knowledge is not great, and I have drawn a blank when searching for resources on this online.



Thanks










share|improve this question





























    2















    Is there an object I can query in 12c to return all ORA-60 Deadlock alerts?



    I just want to do a weekly report that outputs the number of deadlocks that have occurred and what schema they occurred on.



    My Oracle knowledge is not great, and I have drawn a blank when searching for resources on this online.



    Thanks










    share|improve this question



























      2












      2








      2


      1






      Is there an object I can query in 12c to return all ORA-60 Deadlock alerts?



      I just want to do a weekly report that outputs the number of deadlocks that have occurred and what schema they occurred on.



      My Oracle knowledge is not great, and I have drawn a blank when searching for resources on this online.



      Thanks










      share|improve this question
















      Is there an object I can query in 12c to return all ORA-60 Deadlock alerts?



      I just want to do a weekly report that outputs the number of deadlocks that have occurred and what schema they occurred on.



      My Oracle knowledge is not great, and I have drawn a blank when searching for resources on this online.



      Thanks







      oracle oracle-12c deadlock






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 13 '18 at 9:11









      Balazs Papp

      25.5k2930




      25.5k2930










      asked Dec 13 '18 at 8:49









      MolenpadMolenpad

      1,212425




      1,212425






















          2 Answers
          2






          active

          oldest

          votes


















          2














          Sure:



          select
          ss.value
          from
          v$sysstat ss
          join v$statname sn using (statistic#)
          where
          sn.name = 'enqueue deadlocks'
          ;


          I did not test it extensively though.






          share|improve this answer
























          • This seems to give me a number, but I'm not sure what time period it is for, and I'd like to break it down by schema if possible

            – Molenpad
            Dec 13 '18 at 9:33











          • @Molenpad It is the number of deadlocks since instance startup. I am not aware of any semi-reliable method that gives this information by schemas other than analyzing all the trace files created on deadlock occurences.

            – Balazs Papp
            Dec 13 '18 at 10:00





















          1














          The deadlocks are reported to the alert log with the error ora-00060 if I remember well, and with X$DBGALERTEXT you should be able to "query" the alert log, based on that you should be able to create a query where you can get the deadlocks occurred during some window (days, weeks, etc) as long as you have the info in the alert log.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "182"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f224862%2fquery-to-return-all-oracle-deadlocks-in-12c%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            Sure:



            select
            ss.value
            from
            v$sysstat ss
            join v$statname sn using (statistic#)
            where
            sn.name = 'enqueue deadlocks'
            ;


            I did not test it extensively though.






            share|improve this answer
























            • This seems to give me a number, but I'm not sure what time period it is for, and I'd like to break it down by schema if possible

              – Molenpad
              Dec 13 '18 at 9:33











            • @Molenpad It is the number of deadlocks since instance startup. I am not aware of any semi-reliable method that gives this information by schemas other than analyzing all the trace files created on deadlock occurences.

              – Balazs Papp
              Dec 13 '18 at 10:00


















            2














            Sure:



            select
            ss.value
            from
            v$sysstat ss
            join v$statname sn using (statistic#)
            where
            sn.name = 'enqueue deadlocks'
            ;


            I did not test it extensively though.






            share|improve this answer
























            • This seems to give me a number, but I'm not sure what time period it is for, and I'd like to break it down by schema if possible

              – Molenpad
              Dec 13 '18 at 9:33











            • @Molenpad It is the number of deadlocks since instance startup. I am not aware of any semi-reliable method that gives this information by schemas other than analyzing all the trace files created on deadlock occurences.

              – Balazs Papp
              Dec 13 '18 at 10:00
















            2












            2








            2







            Sure:



            select
            ss.value
            from
            v$sysstat ss
            join v$statname sn using (statistic#)
            where
            sn.name = 'enqueue deadlocks'
            ;


            I did not test it extensively though.






            share|improve this answer













            Sure:



            select
            ss.value
            from
            v$sysstat ss
            join v$statname sn using (statistic#)
            where
            sn.name = 'enqueue deadlocks'
            ;


            I did not test it extensively though.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 13 '18 at 9:10









            Balazs PappBalazs Papp

            25.5k2930




            25.5k2930













            • This seems to give me a number, but I'm not sure what time period it is for, and I'd like to break it down by schema if possible

              – Molenpad
              Dec 13 '18 at 9:33











            • @Molenpad It is the number of deadlocks since instance startup. I am not aware of any semi-reliable method that gives this information by schemas other than analyzing all the trace files created on deadlock occurences.

              – Balazs Papp
              Dec 13 '18 at 10:00





















            • This seems to give me a number, but I'm not sure what time period it is for, and I'd like to break it down by schema if possible

              – Molenpad
              Dec 13 '18 at 9:33











            • @Molenpad It is the number of deadlocks since instance startup. I am not aware of any semi-reliable method that gives this information by schemas other than analyzing all the trace files created on deadlock occurences.

              – Balazs Papp
              Dec 13 '18 at 10:00



















            This seems to give me a number, but I'm not sure what time period it is for, and I'd like to break it down by schema if possible

            – Molenpad
            Dec 13 '18 at 9:33





            This seems to give me a number, but I'm not sure what time period it is for, and I'd like to break it down by schema if possible

            – Molenpad
            Dec 13 '18 at 9:33













            @Molenpad It is the number of deadlocks since instance startup. I am not aware of any semi-reliable method that gives this information by schemas other than analyzing all the trace files created on deadlock occurences.

            – Balazs Papp
            Dec 13 '18 at 10:00







            @Molenpad It is the number of deadlocks since instance startup. I am not aware of any semi-reliable method that gives this information by schemas other than analyzing all the trace files created on deadlock occurences.

            – Balazs Papp
            Dec 13 '18 at 10:00















            1














            The deadlocks are reported to the alert log with the error ora-00060 if I remember well, and with X$DBGALERTEXT you should be able to "query" the alert log, based on that you should be able to create a query where you can get the deadlocks occurred during some window (days, weeks, etc) as long as you have the info in the alert log.






            share|improve this answer




























              1














              The deadlocks are reported to the alert log with the error ora-00060 if I remember well, and with X$DBGALERTEXT you should be able to "query" the alert log, based on that you should be able to create a query where you can get the deadlocks occurred during some window (days, weeks, etc) as long as you have the info in the alert log.






              share|improve this answer


























                1












                1








                1







                The deadlocks are reported to the alert log with the error ora-00060 if I remember well, and with X$DBGALERTEXT you should be able to "query" the alert log, based on that you should be able to create a query where you can get the deadlocks occurred during some window (days, weeks, etc) as long as you have the info in the alert log.






                share|improve this answer













                The deadlocks are reported to the alert log with the error ora-00060 if I remember well, and with X$DBGALERTEXT you should be able to "query" the alert log, based on that you should be able to create a query where you can get the deadlocks occurred during some window (days, weeks, etc) as long as you have the info in the alert log.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 13 '18 at 17:30









                dbamexdbamex

                716




                716






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Database Administrators Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f224862%2fquery-to-return-all-oracle-deadlocks-in-12c%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                    ComboBox Display Member on multiple fields

                    Is it possible to collect Nectar points via Trainline?