Oracle CREATE VIEW error ORA-01031: Insufficient permissions

Source: Internet
Author: User
Tags dba

Today, when you create a view of a table, users are prompted to ORA-01031 user rights, insufficient privileges. You still cannot create a view by using the system user to assign permissions such as DBA.

Create a View

The code is as follows Copy Code

Create or replace view stats
As select ' STAT ... ' | | A.name name, B.value
From V$statname A, V$mystat b
where a.statistic# = b.statistic#
UNION ALL
Select ' LATCH. ' | | Name, gets
From V$latch
UNION ALL
Select ' STAT ... Elapsed time ', hsecs from V$timer;

-Create View permissions, general online search is to say this sentence, but the light has this sentence still cannot create

Later verified that the following operations

Workaround:

1, login with system user, connect as DBA

2, give SCOTT user permission to create a view: GRANT create view to SCOTT

3, give SCOTT the ability to query any table: GRANT SELECT any teble to SCOTT

4, give SCOTT permission to query any dictionary: GRANT SELECT any DICTIONARY to SCOTT


The following test

The code is as follows Copy Code

Grant CREATE view to B;

– Grant Query Permissions

The code is as follows Copy Code

Grant Select any table to B;

– Grant Permissions

The code is as follows Copy Code

Grant Select any dictionary to B;

The above 3 items will be able to create a normal view.


The user is again granted permission to select any dictionary to create success.

It seems that when you create a view, you still have to display the authorization.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.