Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if ordinary users enable AUTOTRACE to report errors under SQLPLUS?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to use AUTOTRACE to report errors for ordinary users under SQLPLUS. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

During the test, after logging in to the HR user of the ORACLE EXAMPLE database in the local test library, I wanted to simply view the execution plan of a certain sql. An error occurred after using the command set autotrace on. The error is as follows:

HR > set autotrace on

SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled

SP2-0611: Error enabling STATISTICS report

After searching on the Internet, it is found that the reason for the error is that the user does not have the permission of the PLSUSTRACE role.

The treatment plan is as follows:

1. Users who log in with the dba role, such as sys, look for the existence of the PLUSTRACE role in the dba_roles data dictionary

SYS > select * from dba_roles where role='PLUSTRACE'

two。 If it exists, you can authorize the HR user directly, and if it does not exist, perform the following steps:

(1) create the role using oracle's own script, and execute SYS > @? / sqlplus/admin/plustrce.sql under the sys user.

(2) authorize HR users to execute SYS > grant plustrace to hr

(3) log in to the HR user again and enable autotrace

SYS > conn hr/hr

Connected.

HR > set autotrace on

This is the end of the article on "what to do when ordinary users use AUTOTRACE to report errors under SQLPLUS". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report