Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
Insufficiente privileges querying my own views...

Insufficiente privileges querying my own views...

2005-08-25       - By Sunil Bhola

Reply:     1     2     3  

Hi Luis,

Please check this exercies :-

Moral -

SQL> create role emp_select;
Role created.

SQL> grant select on emp to emp_select;
Grant succeeded.

SQL> connect text/text
Connected.

SQL> ed
Wrote file afiedt.buf
 1  create view text_emp_select
 2* as select *from scott.emp
SQL> /
as select *from scott.emp
                     *
ERROR at line 2:
ORA-01031 (See ORA-01031.ora-code.com): insufficient privileges
**********************************
But when we directly grant the object role ie without role, the view will be
created without any error :-

SQL> connect scott/tiger
Connected.

SQL> drop role emp_select;
Role dropped.

SQL> grant select on emp to text;
Grant succeeded.

SQL> connect text/text
Connected.

SQL> create view emp_select as select *from scott.emp;
View created.

But when we grant the ALTER ANY ROLE to TEXT user he/she can create a view:-
SQL> ed
Wrote file afiedt.buf
 1* grant alter any role to text
SQL> /
Grant succeeded.

SQL> connect text/text
Connected.

SQL> create view emp_select as select *from scott.emp;
View created.
SQL>

Hope I cleared your doubt :-)


QUERIES in Oracle, Feel free to Join:



http://groups.yahoo.com/group/oracle_expert/



Regards,

Sunil Bhola

Oracle_Expert, Moderator





Jose Luis Delgado <joseluis_delgado@(protected)> wrote:
DBAs...

Sorry if this is a silly question, my brain is not
thinking clearly today...

1.- UserA gives SELECT privileges on his tables to
UserB trough a role RoleA.

2.- UserB creates ViewA, querying the UserA tables.

3.- UserB creates viewB, which query ViewA, in his own
schema.

He gets:
ORA-01031 (See ORA-01031.ora-code.com) Insufficient privileges

Of course, this is because of he cannot query the
tables (through the role, right?) that the ViewA is
pointing to...

the point here is:
What could be the best solution to give UserB enough
privileges to query the view, without having a mess
with privileges??

Thanks in advance!
JL




__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs

--
http://www.freelists.org/webpage/oracle-l



QUERIES in Oracle, Feel free to Join:

http://groups.yahoo.com/group/oracle_expert/


Regards,
Sunil Bhola
Oracle_Expert, Moderator











   
-- ---- ---- ---- ---- ---- -----
Start your day with Yahoo! - make it your home page
<DIV>
<DIV>Hi Luis,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Please check this exercies :-</DIV>
<DIV>&nbsp;</DIV>
<DIV>Moral - </DIV>
<DIV>&nbsp;</DIV>
<DIV>SQL&gt; create role emp_select;</DIV>
<DIV>Role created.</DIV>
<DIV>&nbsp;</DIV>
<DIV>SQL&gt; grant select on emp to emp_select;</DIV>
<DIV>Grant succeeded.</DIV>
<DIV>&nbsp;</DIV>
<DIV>SQL&gt; connect text/text<BR>Connected.</DIV>
<DIV>&nbsp;</DIV>
<DIV>SQL&gt; ed<BR>Wrote file afiedt.buf</DIV>
<DIV>&nbsp; 1&nbsp; create view text_emp_select<BR>&nbsp; 2* as select *from
scott.emp<BR>SQL&gt; /<BR>as select *from scott.emp<BR>&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; *<BR>ERROR at line 2:<BR>ORA-01031 (See ORA-01031.ora-code.com): insufficient
privileges</DIV>
<DIV><STRONG>**********************************</STRONG><BR><STRONG>But when we
directly grant the object role ie without role, the view will be created
without any error :-</STRONG></DIV>
<DIV>&nbsp;</DIV>
<DIV>SQL&gt; connect scott/tiger<BR>Connected.</DIV>
<DIV><BR>SQL&gt; drop role emp_select;</DIV>
<DIV>Role dropped.</DIV>
<DIV>&nbsp;</DIV>
<DIV>SQL&gt; grant select on emp to text;</DIV>
<DIV>Grant succeeded.</DIV>
<DIV>&nbsp;</DIV>
<DIV>SQL&gt; connect text/text<BR>Connected.<BR></DIV>
<DIV>SQL&gt; create view emp_select as select *from scott.emp;</DIV>
<DIV>View created.</DIV>
<DIV><BR>But when&nbsp;we grant the ALTER ANY ROLE to TEXT user he/she can
create a view:-</DIV>
<DIV>SQL&gt; ed<BR>Wrote file afiedt.buf</DIV>
<DIV>&nbsp; 1* grant alter any role to text<BR>SQL&gt; /</DIV>
<DIV>Grant succeeded.</DIV>
<DIV>&nbsp;</DIV>
<DIV>SQL&gt; connect text/text<BR>Connected.<BR></DIV>
<DIV>SQL&gt; create view emp_select as select *from scott.emp;</DIV>
<DIV>View created.</DIV>
<DIV>SQL&gt; </DIV>
<DIV>&nbsp;</DIV>
<DIV>Hope I cleared your doubt :-)</DIV>
<DIV>&nbsp;</DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><STRONG><B><FONT face=Verdana
color=#434343 size=3><SPAN style="FONT-SIZE: 12pt; COLOR: #434343; FONT-FAMILY:
Verdana">QUERIES in Oracle, Feel free to Join:</SPAN></FONT></B></STRONG><?xml
:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o
:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><STRONG><B><FONT face=Verdana
size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: Verdana"><A href="http:/
/groups.yahoo.com/group/oracle_expert/"><FONT color=#434343><SPAN style="COLOR:
#434343">http://groups.yahoo.com/group/oracle_expert/</SPAN></FONT></A><FONT
color=yellow><SPAN style="COLOR: yellow"> </SPAN></FONT></SPAN></FONT></B><
/STRONG><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman"
size=3><SPAN style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><STRONG><B><FONT face=Verdana
size=3><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: Verdana">Regards,</SPAN><
/FONT></B></STRONG><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><STRONG><B><FONT face=Verdana
color=red><SPAN style="FONT-SIZE: 12pt; COLOR: red; FONT-FAMILY: Verdana">S<
/SPAN></FONT></B></STRONG><STRONG><B><FONT face=Verdana size=3><SPAN style="FONT
-FAMILY: Verdana">unil <FONT color=red><SPAN style="COLOR: red">B</SPAN></FONT
>hola</SPAN></FONT></B></STRONG><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><STRONG><B><FONT face=Verdana>
<SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: Verdana">Oracle_Expert, Moderator<
/SPAN></FONT></B></STRONG><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face=Arial color=navy size
=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o
:p></SPAN></FONT></P>
<DIV>&nbsp;</DIV>
<DIV><BR><BR><B><I>Jose Luis Delgado &lt;joseluis_delgado@(protected)&gt;</I></B>
wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER
-LEFT: #1010ff 2px solid">DBAs...<BR><BR>Sorry if this is a silly question, my
brain is not<BR>thinking clearly today...<BR><BR>1.- UserA gives SELECT
privileges on his tables to<BR>UserB trough a role RoleA.<BR><BR>2.- UserB
creates ViewA, querying the UserA tables.<BR><BR>3.- UserB creates viewB, which
query ViewA, in his own<BR>schema.<BR><BR>He gets:<BR>ORA-01031 (See ORA-01031.ora-code.com) Insufficient
privileges<BR><BR>Of course, this is because of he cannot query the<BR>tables
(through the role, right?) that the ViewA is<BR>pointing to...<BR><BR>the point
here is:<BR>What could be the best solution to give UserB enough<BR>privileges
to query the view, without having a mess<BR>with privileges??<BR><BR>Thanks in
advance!<BR>JL<BR><BR><BR><BR><BR>__ ____ ____ ____ ____ ____ ____ ____ ____ __
__ ____<BR>Start your day with Yahoo! - make it your home page <BR>http://www
.yahoo.com/r/hs
<BR><BR>--<BR>http://www.freelists.org/webpage/oracle-l<BR></BLOCKQUOTE></DIV>
<BR><BR><DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV><FONT size=2><FONT size=3><FONT face=verdana color=#434343><STRONG>QUERIES
in Oracle, Feel free to Join:</STRONG></FONT></FONT></FONT></DIV>
<DIV><STRONG><FONT face=Verdana color=#434343 size=3></FONT></STRONG>&nbsp;<
/DIV>
<DIV><FONT size=2><FONT size=3><FONT size=+0><FONT face=verdana><STRONG><A href
="http://groups.yahoo.com/group/oracle_expert/"><FONT color=#434343>http:/
/groups.yahoo.com/group/oracle_expert/</FONT></A><FONT color=#ffff00> <BR></FONT
></STRONG></FONT></FONT></FONT></FONT></DIV>
<DIV><STRONG><FONT face=verdana></FONT></STRONG>&nbsp;</DIV>
<DIV><STRONG><FONT face=verdana>Regards,</FONT></STRONG></DIV>
<DIV><FONT face=verdana><FONT size=3><STRONG><FONT color=#ff0000>S</FONT>unil
<FONT color=#ff0000>B</FONT>hola</STRONG></FONT></FONT></DIV>
<DIV>
<DIV><FONT face=verdana size=3><STRONG>Oracle_Expert, Moderator<BR></STRONG><
/FONT></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV><p>
    <hr size=1> <a href="http://us.rd.yahoo.com/evt=34442/*http://www.yahoo.com/r
/hs">Start your day with Yahoo! - make it your home page </a>