Thursday, June 23, 2011

ORA-01031: insufficient privileges error even after granting select to the view.

Today i had a peculiar issue, An user is not able to access the view from other schema,
Let me explain the scenario.....
Say there are three users
user_A
user_B
user_C
requirement is to grant select privilege to user_C for the View on user_B whose base table is in user_B.
Even though i have given 'Grant select on user_a.table to user_c;' and 'Grant select on user_b.view to user_c;'
when user_c issues,
select * from user_b.view; it throws  ORA-01031: insufficient privileges

SQL> select * from user_b.view;
select * from user_b.view
                  *
ERROR at line 1:
ORA-01031: insufficient privileges
Finally I got it to work. It fails when the view is being executed from a third schema. For that to work you have to add the grant option:
grant select on user_a.table to user_b with grant option;
After this my view worked fine.

Tuesday, June 14, 2011

ORA-00600: internal error code, arguments: [2662], [a], [b], [c], [d], [], [], []


Recently I have faced an ORA-600 error, below is the details.....

ORA-00600: internal error code, arguments: [2662], [a], [b], [c], [d], [], [], []
ORA-00600: internal error code, arguments: [2662], [2728], [3808184538], [2728], [3808343262], [4207314], [], []
ORA-00600: internal error code, arguments: [2662], [2728], [3808384312], [2728], [3808417933], [8388617], [], []
ORA-00600: internal error code, arguments: [2663], [2728], [3808404316], [2728], [3808417933], [], [], []

This is due to mismatch of SCN (Current and one in the UGA)

If you open the database using resetlogs then the SCN in column d will change,so open without resetlogs;

if recovery is needed just do recover database instead of recove database using backup controlfile;


Bounce the database mutliple times if the difference is small.
of set the below event to increment the SCN so that multiple bounce will help you open the database without any errrors.

alter session set events '10015 trace name adjust_scn level 10';