一般用户不能这么做吗?要怎样的权限才行?还说要做什么设置?
解决方案 »
- PLSQL Developer登录后总是显示程序无响应
- ORACLE 中创建视图
- 关于oracle
- 哪位知道在Oracle的存储过程中如何加锁解锁?
- 很着急,在线等,求救了! ORA-02049 超时分布式事务处理等待锁定
- 初学oracle 备份出了这样的问题......
- 新人SQL语句问题,急,急,急,大家来帮帮新人呀
- job执行时间过长导致下次执行时间推迟
- 根据字段查寻表
- 一个SQL SERVER或ORACLE数据库,其数据是以文件的形式存于硬盘吗
- ORACLE数据库添加数据记录时如何生成自动编号?
- 请问:在sql下编译的存储过程系统存储到那里了,我想使用wrap加密,但不知到我的过程在那个文件里。
我用的是pl/sql。在EXPLAIN中是可以的。
不知道在COMMAND 中还要做些怎么样的操作?比如:建立怎么样的表?做怎么设置?
(
runid number primary key, -- unique run identifier,
-- from plsql_trace_runnumber
run_date date, -- start time of run
run_owner varchar2(31), -- account under which run was made
run_comment varchar2(2047), -- user provided comment for this run
run_comment1 varchar2(2047), -- additional user-supplied comment
run_end date, -- termination time for this run
run_flags varchar2(2047), -- flags for this run
related_run number, -- for correlating client/server
run_system_info varchar2(2047), -- currently unused
spare1 varchar2(256) -- unused
)ORA-01031: 权限不足
Cannot SET AUTOTRACE?????
还是这样?
Rem This script must be run under SYS
Rem
Rem The following tables are required to collect data
Rem plsql_trace_runs - information on trace runs
Rem plsql_trace_event - detailed trace data
Rem
Rem For security reasons, these tables are created under SYS, and are
Rem unique system-wide. The DBA should explicitly grant access to these
Rem tables to those users who require it.
Rem
Rem The plsql_trace_runnumber sequence is used for generating unique
Rem run numbers.
没别的办法?
没有sys权限.
oracle是这么说的:
Rem NOTES
Rem This script must be run under SYS
不用SYS,一般用户,有没有办法?
@ ORACLE_HOME\rdbms\admin\utlxplan.sql
在sqlplus中执行!
那两个sql可能不在目录下,可以搜一下!
运行同样要SYS权限.
drop role plustrace;drop role plustraceORA-01919: 角色'PLUSTRACE'不存在
create role plustrace;create role plustraceORA-01031: 权限不足
grant select on v_$sesstat to plustrace;grant select on v_$sesstat to plustraceORA-00942: 表或视图不存在
grant select on v_$statname to plustrace;grant select on v_$statname to plustraceORA-00942: 表或视图不存在
grant select on v_$session to plustrace;grant select on v_$session to plustraceORA-00942: 表或视图不存在
grant plustrace to dba with admin option;grant plustrace to dba with admin optionORA-01919: 角色'PLUSTRACE'不存在
set echo off
先在sys用户下运行@/ORACLE_HOME/sqlplus/admin/plustrce.sql内容:
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_$session to plustrace;
grant plustrace to dba with admin option;
set echo off产生plustrace角色,然后在sys用户下把此角色赋予一般用户SQL> grant plustrace to &username;然后找到/ORACLE_HOME/rdbms/admin/utlxplan.sql,然后在当前用户SQL>下运行,它创建一个plan_table,用来存储分析SQL语句的结果。create table PLAN_TABLE (
statement_id varchar2(30),
timestamp date,
res varchar2(80),
operation varchar2(30),
options varchar2(30),
object_node varchar2(128),
object_owner varchar2(30),
object_name varchar2(30),
object_instance numeric,
object_type varchar2(30),
optimizer varchar2(255),
search_columns number,
id numeric,
parent_id numeric,
position numeric,
cost numeric,
cardinality numeric,
bytes numeric,
other_tag varchar2(255),
partition_start varchar2(255),
partition_stop varchar2(255),
partition_id numeric,
other long,
distribution varchar2(30));在SQL/PLUS的窗口运行以下命令
set time on; (说明:打开时间显示)
set autotrace on; (说明:打开自动分析统计,并显示SQL语句的运行结果)
set autotrace traceonly; (说明:打开自动分析统计,不显示SQL语句的运行结果)接下来你就运行测试SQL语句,看到其分析统计结果了。一般来讲,我们的SQL语句应该避免对大表的全表扫描。关闭以上功能,在SQL/PLUS的窗口运行以下命令set time off; (说明:关闭时间显示)
set autotrace off; (说明:关闭自动分析统计)
留个QQ来着,有时间交流交流。