Creating a monitoring account in Oracle improves work efficiency

Source: Internet
Author: User

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;

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.