To simplify the process, I have created a unified database check account on multiple ORACLE data, and my account can only access several specific views (the SQL statements to be queried have generated views ), the procedure is as follows:
Root> sqlplus/As sysdba
You must create an account to access the database with DBA permissions.
Http://www.jb51.net/article/20367.htm
SQL> create user dbmonitor identified by "ty_sd_s ";
Authorize an account
SQL> grant connect, resource to dbmonitor;
The script executed by this account is converted to a viewCopyCodeThe Code is as follows: SQL> drop view vstablespace;
SQL> Create view vstablespace
(
Select
A. tablespace_name "tablespace ",
Sum (A. bytes) sum,
Sum (B. bytes) free,
Sum (B. bytes)/sum (A. bytes) * 100 precentfree
From
Dba_data_files
A, dba_free_space B
Where
A. file_id = B. file_id
Group by A. tablespace_name
)
Grant the user the select permission
SQL> grant select on vstablespace to dbmonitor;
In this case, the user can only view the number chart, and can ensure database security without modifying others.
Log out and use the new Oracle account to log on.
Root> sqlplus dbmonitor/"ty_sd_s" as sysdba;
View the permissions granted by the user
SQL> select * From user_tab_privs;
Here we can see that only the permission for creating a view is used.
SQL> select * From SYS. vstablespace;