How to profile end to end performance of Oracle stored procedure

前端 未结 3 1538
悲&欢浪女
悲&欢浪女 2021-01-13 11:49

I want to know how long my stored procedure is taking to execute from the time an external process hits the database and says execute this to the time the database returns b

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-13 12:31

    SIMPLEST,CHEAPEST OPTION You could log events to a "debug" table and check the duration between the logs, like for ex. Log event before insert into table a with time stamp a into debug table. Log event after insert into table a with timestamp b into debug table.

    It's a bit time consuming if you're stored procedure is anything more than 5 lines, but it will help you none the less. Also implement a debug flag, so when you need to log time stamps, set the flag at the top of the procedure to true, and then re-compile it. When executing the stored procedure, it will then go and log all your events, when done with debugging, set the flag to false and re-compile.

提交回复
热议问题