您的位置:首页 > 数据库 > Oracle

How To Tune or Test PLSQL Code Performance in Oracle D2k Forms

2016-12-25 18:16 525 查看
You can test or tune your program unit performance in Oracle forms with Ora_Prof package.

Suppose you have created to procedure to perform a single task with different logic and you want to check exactly which procedure is performing well. See the below example:

declare
i PLS_INTEGER;
BEGIN
--test 1
Ora_Prof.Create_Timer('test1');
Ora_Prof.Start_Timer('test1');

yourprogramunitwithsomelogic;

Ora_Prof.Stop_Timer('test1');
message('Test 1 Time taken '||Ora_Prof.Elapsed_Time('test1'), acknowledge);
Ora_Prof.Destroy_Timer('test1');
-- test 2
Ora_Prof.Create_Timer('test2');
Ora_Prof.Start_Timer('test2');

yourprogramunitwithanotherlogic;

Ora_Prof.Stop_Timer('test2');
message('Test 2 Time taken '||Ora_Prof.Elapsed_Time('test2'),acknowledge);
message('Test 2 Time taken '||Ora_Prof.Elapsed_Time('test2'),acknowledge);
Ora_Prof.Destroy_Timer('test2');
END;

It will give the result in milliseconds and now you can analyze that which program is working good.

See also:

Creating, Stoping, Re-Starting timer in Oracle Forms

Tune Oracle Form's PLSQL Code with the help of timer



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: