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

Permission setting method of oracle set autot

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

Share

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

This article mainly explains the "oracle set autot permission setting method", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "oracle set autot permission setting method" bar!

Build plustrace permissions. Ordinary users cannot perform autot without this permission

2010-01-17 16:55

SQL > conn scott/tiger

Set Connected.

SQL >

SQL >

SQL > set autot on

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

SP2-0611: Error enabling STATISTICS report

SQL > conn / as sysdba

Connected.

SQL > grant plustrace to scott

Grant plustrace to scott

*

ERROR at line 1:

ORA-01919: role 'PLUSTRACE' does not exist

SQL > select * from v$version

BANNER

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Prod

PL/SQL Release 10.2.0.1.0-Production

CORE 10.2.0.1.0 Production

TNS for Linux: Version 10.2.0.1.0-Production

NLSRTL Version 10.2.0.1.0-Production

SQL > @? / sqlplus/admin/plustrce.sql

SQL >

SQL > drop role plustrace

Drop role plustrace

*

ERROR at line 1:

ORA-01919: role 'PLUSTRACE' does not exist

SQL > create role plustrace

Role created.

SQL >

SQL > grant select on v_$sesstat to plustrace

Grant succeeded.

SQL > grant select on v_$statname to plustrace

Grant succeeded.

SQL > grant select on v_$mystat to plustrace

Grant succeeded.

SQL > grant plustrace to dba with admin option

Grant succeeded.

SQL >

SQL > set echo off

SQL > show user

USER is "SYS"

SQL > grant plustrace to scott

Grant succeeded.

SQL > conn scott/tiger

Connected.

SQL > set autot on

SQL > set autot

Usage: SET AUTOT [RACE] {OFF | ON | TRACE [ONLY]} [explain] [stats]]

SQL > set autot off

SQL >

[oracle@localhost ~] $ls / opt/oracle/product/10g/sqlplus/admin/plustrce.sql

/ opt/oracle/product/10g/sqlplus/admin/plustrce.sql

[oracle@localhost ~] $cat / opt/oracle/product/10g/sqlplus/admin/plustrce.sql

--

Copyright (c) Oracle Corporation 1995, 2002. All Rights Reserved.

--

-- NAME

-- plustrce.sql

--

-- DESCRIPTION

-- Creates a role with access to Dynamic Performance Tables

-for the SQL*Plus SET AUTOTRACE... STATISTICS command.

-- After this script has been run, each user requiring access to

-- the AUTOTRACE feature should be granted the PLUSTRACE role by

-- the DBA.

--

-- USAGE

-- sqlplus "/ as sysdba" @ plustrce

--

-- Catalog.sql must have been run before this file is run.

-- This file must be run while connected to a DBA schema.

Set echo on

Drop role plustrace

Create role plustrace

Grant select on v_$sesstat to plustrace

Grant select on v_$statname to plustrace

Grant select on v_$mystat to plustrace

Grant plustrace to dba with admin option

Set echo off

[oracle@localhost ~] $

Thank you for your reading, the above is the content of "oracle set autot permission setting method", after the study of this article, I believe you have a deeper understanding of the oracle set autot authority setting method, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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: 296

*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