Skip to Main Content
  • Questions
  • What rights are to be granted to a normal user for accessing Tablespace monitoring

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Gautam.

Asked: December 19, 2005 - 2:00 pm UTC

Last updated: December 20, 2005 - 12:41 pm UTC

Version: 9.1.8

Viewed 1000+ times

You Asked

My company wants to get an alert message when tablespace is increased upto certain limit like 2GB.But this thing should be done by a normal user as SYS account client doesnot give.So my doubt what rights must be granted to a user to access these TABLE SPACE MONITORING TABLES.


Thanks
GautamKumar

and Tom said...

grant select on dba_* - whatever DBA_ view you want that person to have access to.

dba_data_files being the most likely one in this case.



sys@ORA9IR2> create user a identified by a;

User created.

sys@ORA9IR2> grant create session to a;

Grant succeeded.

sys@ORA9IR2> grant select on dba_data_files to a;

Grant succeeded.

sys@ORA9IR2>
sys@ORA9IR2> @connect a/a
sys@ORA9IR2> set termout off
a@ORA9IR2>
a@ORA9IR2> set termout on
a@ORA9IR2> select tablespace_name, sum(bytes/1024/1024) mbytes
2 from dba_data_files
3 group by tablespace_name;

TABLESPACE_NAME MBYTES
------------------------------ ----------
BIG_TABLE 140
CWMLITE 20
DRSYS 20
EXAMPLE 148.75
INDX 25
ODM 20
SYSTEM 480
TEST 104
TOOLS 10
UNDOTBS1 405
USERS 1213.75
XDB 45

12 rows selected.


Rating

  (3 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Fast and accurate response

CGK, December 19, 2005 - 11:14 pm UTC

I am very glad to thomas.kyte@oracle.com to answer my question as soon as possible.

ThankYou very much


How to send a mail when tablespace increases

CGK, December 19, 2005 - 11:23 pm UTC

How to send a mail when tablespace increases automatically like alert messages to prompt that tablespace is increasing after a limit.

Tom Kyte
December 20, 2005 - 8:41 am UTC

Well, system management tools that you have like Enterprise Manager - do that.

Else you would have to write a job that runs every now and then, looks for whatever condition you want, and then uses utl_smtp (or utl_mail, depends on version) to send email.

will maxbytes-bytes from dba_data_files table give free space for that tablespace

CGK, December 20, 2005 - 11:13 am UTC

will maxbytes-bytes from dba_data_files table give free space for that tablespace.
why maxbytes-bytes from dba_data_files is not same as freebytes from dba_free_Space for same tablespace.

wat is difference between them. plz suggest

Tom Kyte
December 20, 2005 - 12:41 pm UTC

you sum up the bytes in dba_data_files
you subtract from that allocated bytes

dba_data_files by itself cannot do this.