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.