我在新创建的用户下执行以下语句可以通过并得到结果 select a.tablespace_name,a.bytes/1024/1024 "Sum MB",(a.bytes-b.bytes)/1024/1024 "used MB",b.bytes/1024/1024 "free MB",round(((a.bytes-b.bytes)/a.bytes)*100,2) "percent_used"
from
(select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a,
(select tablespace_name,sum(bytes) bytes,max(bytes) largest from dba_free_space group by tablespace_name) b
where a.tablespace_name=b.tablespace_name
order by ((a.bytes-b.bytes)/a.bytes) desc 但我执行创建视图语句却提示 ORA-01031:权限不足
创建视图语句如下:
create or replace view v_tssum as
select a.tablespace_name,a.bytes/1024/1024 "Sum MB",(a.bytes-b.bytes)/1024/1024 "used MB",b.bytes/1024/1024 "free MB",round(((a.bytes-b.bytes)/a.bytes)*100,2) "percent_used"
from
(select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a,
(select tablespace_name,sum(bytes) bytes,max(bytes) largest from dba_free_space group by tablespace_name) b
where a.tablespace_name=b.tablespace_name
order by ((a.bytes-b.bytes)/a.bytes) desc SQL
from
(select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a,
(select tablespace_name,sum(bytes) bytes,max(bytes) largest from dba_free_space group by tablespace_name) b
where a.tablespace_name=b.tablespace_name
order by ((a.bytes-b.bytes)/a.bytes) desc 但我执行创建视图语句却提示 ORA-01031:权限不足
创建视图语句如下:
create or replace view v_tssum as
select a.tablespace_name,a.bytes/1024/1024 "Sum MB",(a.bytes-b.bytes)/1024/1024 "used MB",b.bytes/1024/1024 "free MB",round(((a.bytes-b.bytes)/a.bytes)*100,2) "percent_used"
from
(select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a,
(select tablespace_name,sum(bytes) bytes,max(bytes) largest from dba_free_space group by tablespace_name) b
where a.tablespace_name=b.tablespace_name
order by ((a.bytes-b.bytes)/a.bytes) desc SQL
解决方案 »
- 如何查询这样的数据?
- oracle PL/SQL 开发
- 大家帮忙啊!!! 急死了!!! 谢谢大家!!!!!!!!
- 有没有想到花旗的啊?与我联系嘛。
- ORA-12514:TNS:监听程序不能解析在连接描述符给出的SERVICE_NAME
- 请教大家关于rman的问题(键入rman后没有反应)
- 虚心求教,望指点一二
- 如何只导出Oracle的表结构以及索引等建表脚本而不导出数据 急!!!
- 如何恢复数据库
- 帮助帮助我啊~~~~~~~~~~~~~~!其他论坛的人都回答不了啊~!?我该怎么做啊~?谢谢了啊
- oracle 8i 数据库联机文件丢失。怎么办?大家来帮忙。。急啊
- ORACLE如何立即关闭与DB的会话
2个USER_NAME改成对面的用户名,看下啥结果select privilege from dba_sys_privs where grantee='USER_NAME'
union
select privilege from dba_sys_privs where grantee in (select granted_role from dba_role_privs where grantee='USER_NAME');
在system、和我创建的用户下,执行结果都是 0 行
union
select privilege from dba_sys_privs where grantee in (select granted_role from dba_role_privs where grantee='SYSTEM');
这个sql 会是0行?????
这个有好多行。我是说我执行这个语句(monitor是我创建的用户),用system和monitor登录后,执行该脚本结果为0行。select privilege from dba_sys_privs where grantee='monitor'
union
select privilege from dba_sys_privs where grantee in (select granted_role from dba_role_privs where grantee='monitor');
这个有好多行。我是说我执行这个语句(monitor是我创建的用户),用system和monitor登录后,执行该脚本结果为0行。select privilege from dba_sys_privs where grantee='monitor'
union
select privilege from dba_sys_privs where grantee in (select granted_role from dba_role_privs where grantee='monitor');monitor大写啊
用大写来查,果然有好多行,其中有“CREATE ANY VIEW”这一个结果