Insufficient priv error when executing DBMS_ERRLOG through PLSQL

Hi,
I shall be grateful if any one of you give me the solution at the earliest.
I have 2 schemas like A & B those are running on Oracle 10g rel2.
As per my buz req' I need to create DML Error log table for 'A.T1' table in B schema using DBMS_ERRORLOG package.
I have granted direct SELECT on A.T1 to B (...not through ROLE as it doesn't work in plsql)
The problem is when i'm running the procedure,
DBMS_ERRLOG.CREATE_ERROR_LOG('A.T1', 'err_T1', 'B');
in SQL*Plus of B schema, it's creating the error log table successfully.
But the same will get failed when i run this error log procedure with in a procedure owned by B schema.
It throws 'ORA-01031: insufficient privileges'...
I hope this is related to privilege issue which is working fine in SQL*Plus but NOT in PLSQL stored procedure.
Awaiting your earliest reply.
Thanks.
- Ela

>I dont think it's an issue with direct privilege. Actually the
package is working when i execute it with in a ananymous block,
but the same get fails when execute it through procedures...
Role privs work with anonymous PL/SQL blocks. Does not work with stored PL/SQL code.
SQL> create user user1 identified by user1 default tablespace users quota 2M on users;
User created.
SQL> grant create session to user1;
Grant succeeded.
SQL> create role user1_role;
Role created.
SQL> grant create table, create procedure to user1_role;
Grant succeeded.
SQL> grant user1_role to user1;
Grant succeeded.
SQL> connect user1/user1
Connected.
PL/SQL procedure successfully completed.
SQL> create table x( n number );
Table created.
SQL> begin
2 execute immediate 'create table y( n number )';
3* end;
SQL> /
PL/SQL procedure successfully completed.
SQL> create or replace procedure CreateTable is
2 begin
3 execute immediate 'create table z( n number )';
4* end;
SQL> /
Procedure created.
SQL> exec CreateTable
BEGIN CreateTable; END;
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "USER1.CREATETABLE", line 3
ORA-06512: at line 1
SQL>

Similar Messages

  • Insufficient privilege error when executing DBMS_ERRLOG through PLSQL

    Hi,
    I shall be grateful if any one of you give me the solution at the earliest.
    I have 2 schemas like A & B those are running on Oracle 10g rel2.
    As per my buz req' I need to create DML Error log table for 'A.T1' table in B schema using DBMS_ERRORLOG package.
    I have granted direct SELECT on A.T1 to B (...not through ROLE as it doesn't work in plsql)
    The problem is when i'm running the procedure,
    DBMS_ERRLOG.CREATE_ERROR_LOG('A.T1', 'err_T1', 'B');
    in SQL*Plus of B schema, it's creating the error log table successfully.
    But the same will get failed when i run this error log procedure with in a procedure owned by B schema.
    It throws 'ORA-01031: insufficient privileges'...
    I hope this is related to privilege issue which is working fine in SQL*Plus but NOT in PLSQL stored procedure.
    Awaiting your earliest reply.
    Thanks.
    - Ela

    Hi,
    It's not an issue with direct privilege. Actually the package is working when i execute it with in a ananymous block, but the same get fails when execute it through procedures...
    Even we have given COMMENT ANY TABLE priv to the schema and that too didn't work out.
    awaiting your reply.
    -Saravanan

  • Error when executing DBMS_ERRLOG through Stored Procedures...

    Hi,
    We have TWO schemas like IDWH_ODS and IDWH_ERR running on Oracle 10g Rel.2.
    The schema IDWH_ERR has direct SELECT privilege on all the base tables in IDWH_ODS schema. (As Pl/sql doesn't support ROLE, we have granted direct SELECT on each of the tables)
    IDWH_ODS schema has tables like ACCOUNT & CUSTOMER, for which I need to create DML Error logging tables in IDWH_ERR schema.
    I have one procedure 'Cr_Errlog_Tabs' in IDWH_ERR schema which gets all tables in IDWH_ODS and creates Error logging table in IDWH_ERR schema using DBMS_ERRLOG package. My problem starts here,
    When I execute the DBMS_ERRLOG package in IDWH_ERR through SQL*Plus LIKE,
    > exec DBMS_ERRLOG.CREATE_ERROR_LOG('idwh_ods.ACCOUNT','ERR$_ACCOUNT','idwh_err');
    it's creating the error log table 'ERR$_ACCOUNT' in IDWH_ERR schema.
    (...the same will be working when execute through Anonymous plsql block)
    BUT, when i execute the DBMS_ERRLOG package with same parameters through the stored Procedure 'Cr_Errlog_Tabs', it throws the following error...
    ORA-01031: insufficient privileges
    Please let me know how the solution at the earliest.

    WHY DO YOU FEEL YOU HAVE TO START A NEW THREAD FOR YOUR PROBLEM!?
    Insufficient priv error when executing DBMS_ERRLOG through PLSQL

  • Error when executing DBMS_ERRLOG pkg through Stored Procedures...

    Hi,
    We have TWO schemas like IDWH_ODS and IDWH_ERR running on Oracle 10g Rel.2.
    The schema IDWH_ERR has direct SELECT privilege on all the base tables in IDWH_ODS schema. (As Pl/sql doesn't support ROLE, we have granted direct SELECT on each of the tables)
    IDWH_ODS schema has tables like ACCOUNT & CUSTOMER, for which I need to create DML Error logging tables in IDWH_ERR schema.
    I have one procedure 'Cr_Errlog_Tabs' in IDWH_ERR schema which gets all tables in IDWH_ODS and creates Error logging table in IDWH_ERR schema using DBMS_ERRLOG package. My problem starts here,
    When I execute the DBMS_ERRLOG package in IDWH_ERR through SQL*Plus LIKE,
    > exec DBMS_ERRLOG.CREATE_ERROR_LOG('idwh_ods.ACCOUNT','ERR$_ACCOUNT','idwh_err');
    it's creating the error log table 'ERR$_ACCOUNT' in IDWH_ERR schema.
    (...the same will be working when execute through Anonymous plsql block)
    BUT, when i execute the DBMS_ERRLOG package with same parameters through the stored Procedure 'Cr_Errlog_Tabs',
    it throws the following error...
    ORA-01031: insufficient privileges
    Please let me know the solution at the earliest.
    Thanks.
    -Saravanan

    duplicate post
    Insufficient privilege error when executing DBMS_ERRLOG through PLSQL

  • APEX Insufficient Privs errors when trying to use dbms_sql.parse

    Hello,
    I have a simple database procedure that changes are user pswd:
    create or replace
    PROCEDURE chg_pswd_test(p_userid in varchar2,
    p_pswd in varchar2)
    -- Invoker rights allow a user with execute privileges to call a subprogram.
    -- Definer Rights allow programs to execute under the privileges of their
    -- definer / schema owner.
    AUTHID CURRENT_USER as x varchar2(20);
    v_cursor INTEGER;
    v_execute INTEGER;
    begin
    v_cursor := sys.DBMS_SQL.OPEN_CURSOR;
    sys.DBMS_SQL.PARSE(v_cursor, 'ALTER USER '||p_userid||' identified by '||p_pswd, sys.DBMS_SQL.NATIVE);
    v_execute := sys.DBMS_SQL.EXECUTE(v_cursor);
    sys.DBMS_SQL.CLOSE_CURSOR(v_cursor);
    commit;
    end chg_pswd_test;
    I can run this procedure in sqlplus as user x and also as my apex_public_user. I have granted both execute on dbms_sql and alter user privs. It runs for both without problems.
    I then create a validation process in APEX can call this database procedure. I then receive insufficient privs errors.
    If I grant all privs to public, the apex app will then run, if I remove all privs I receive the errors again.
    Does anyone know which database priv I am missing, I cannot grant all privs to public on my production database?
    Thanks

    Odd, as I would think that should work, being the DBA role and all...
    If it works as user X from SQL*Plus, could you try to change the parsing schema to User X and try again?
    Thanks,
    - Scott -
    http://spendolini.blogspot.com
    http://sumnertechnologies.com

  • Insufficient priv error when creating a materialised view using DB link!!!!

    Hi,
    I have a two databases db1 and db2.
    I have created a database link from db2 to access user1 schema in db1.
    When i try to create a materialised view by accessing user1 table using user 'user2' in db2 database, i get error "ORA-1031: Insufficient Privilege".
    The user2 has the priviliges "create view", "create any view", "create materialised view" etc.
    I am able to select data, of the table using the database link, but creating materialised view gives this error.
    I want to know if the user "user1" should be granting any privilige to user2, if so how is it possible as user2 dosent exist in db1!
    i.e should i give command something like "grant select on user1.table to user2@db2"(this dosent work as it says user2@db2 dosent exist, obviously as its taking user2@db2 as a username in db1 schema)
    or is this a problem with user2 priviliges in db2 database, if so what are all the priviliges that have to be given to user2 in db2 schema.
    regards,

    Hi,
    User from db1 can not assign any privs to user on db2 database. If user from db1 want to access any object from db2 database, then on local level user2 on db2 should have all the acess to required object. Then you can use user2 on db2 using dblink from db1 user to access those objects residing on remote database.
    If user1 from db1 can grant privs to user2 on db2 database on any objects on db2 database then it is highly security issue. This is not permitted.
    Regards
    e.g.
    conn userx@db2
    grant select on userx.table1 to user2;
    conn user2@db2
    select count(*) from userx.table1;
    conn user1@db1
    select count(*) from userx.table1@db2_dblink;
    Edited by: skvaish1 on Apr 29, 2010 3:57 PM

  • Getting HeapDump on out of memory error when executing method through JNI

    I have a C++ code that executes a method inside the jvm through the JNI.
    I have a memory leak in my java code that results an out of memory error, this exception is caught in my C++ code and as a result the heap dump is not created on the disk.
    I am running the jvm with
    -XX:+HeapDumpOnOutOfMemoryError
    -XX:HeapDumpPath=C:\x.hprof
    Any suggestions?
    Thanks

    I'll rephrase it then.
    I have a java class named PbsExecuter and one static method in it ExecuteCommand.
    I am calling this method through JNI (using CallStaticObjectMethod). sometimes this method causes the jvm to throw OutOfMemoryError and I would like to get a heap dump on the disk when this happens in order to locate my memory leak.
    I've started the jvm with JNI_CreateJavaVM and I've put two options inside the JavaVMInitArgs that is used to create the Jvm. -XX:+HeapDumpOnOutOfMemoryError and -XX:HeapDumpPath=C:\x.hprof
    which supposed to create a heap dump on the disk when OutOfMemoryError occurs.
    Normally if I would execute normal java code, when this exception would occur and I wouldn't catch it the Jvm would crash and the heap dump would be created on the disk.
    Since I need to handle errors in my C++ code I am use ExceptionOccured() and extracts the exception message from the exception it self and write it.
    For some reason when I execute this method through JNI it doesn't create the dump.

  • Memory error when executing package through SQL Server Agent.

    Hi!!
    I have a problem with a package (SSIS) when run on SQL Server Agent.
    The job is configured
    with the proxy and the account has the
    required privileges. Runs perfectly
    if the job runs manually, but if I let it
    run on schedule I get a memory error.
    Also if I run the
    package through DTExec.exe or VS2008,
    everything runs smoothly.
    I am using SQL2008R2.
    If someone has something similar happened
    and have found how to fix it please i need
    to know how.
    Thank you.

    This is most likely your issue:
    http://support.microsoft.com/kb/824422

  • OWB10gR2: Insufficient privileges error when executing OMBREGISTER USER

    Hello,
    In the OMB Plus window I try to register a user as a OWB user:
    OMB+> OMBCONNECT OWB_SCHEMA_OWNER/PASSWORD@NODE:1521:DBSERVICENAME
    Connected.
    OMB+> OMBREGISTER USER 'target_user' SET PROPERTIES (DESCRIPTION,ISTARGETSCHEMA,TARGETSCHEMAPWD) VALUES ('DWH user','TRUE','password')
    ORA-01031: insufficient privileges
    First time I see this error, registered many more users on different OWB instances with this command. Anyone who has an idea what's wrong?
    Best regards, Erik

    Solved the problem by recreating the target schema; we first narrowed the problem down to this specific user, but could not find any deviations from other target users.
    Decided to recreate the target schema because we were running out of time. No real solution to the problem, but at least we can go on...

  • Error when executing function in MSS launchpad report ???

    In MSS lanchpad report, we have the following problem:
    Error in Manager Sef-Service
    When calling the report, the following error occurred:
    System: HRP
    Error when executing function
    Basically in MSS report, I select employees in the first iView which calls another ABAP query in back-end to display back-end t-code inside iView of portal through ITS service. What could be the reason for it? please advice.
    Thanks,
    Anthony

    Please try converting the standadrd-delivered scenario RPT0, then check
    out the things.
    Also problem may be that your function code names contain
    the character '&'. This causes a problem when the selected function
    code is passed to the ITS-WebGUI as a URL parameter. Please use only
    standard characters (A..Z and _) when you define a function code.
    Then it should work.
    Please go through the following link also
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/3a/
    3198408d953154e10000000a1550b0/frameset.htm
    Please test in backend using Se38 > PWPC_RPT_START_REPORT_TEST
    The Reporting Iview in the portal has the Report category type, by
    the report category type is set to "RPT0". Therefore, when the
    application is launched, the reporting category type is also sent as URL
    parameter to the backend system. As of ECC 6.0 only the reporting
    category type "RPT0" is supported. ensure this is set for your custom reports if you are using own scenarion
    then set in the Iview property of reports as well
    ie example
    1)Change the Iview property "Scenario" of the Reporting iview from
    "RPT0" to your own "ZRPT", than this set of reports will work. however,
    the standard reports will not work.
    pwpc_convert_mdt_to_lpa >>
    The following list of reports have been converted.

  • Error when executing query without passing variable selection

    Hi Gurus
    I am getting an error while executing a query with out passing values for variables
    When executing the query by passing the filter values report returns the data
    When executing the query with out passing variable selections the error message is
    Unknown error in SQL interface
    Error reading the data of Info Provider ZCRM_O08
    Error while reading data; navigation possible
    System error in program SSAPLRS_EXCEPTION and form
    RS_EXCEPTION_TO_MESSAGE
    No Data Available
    can any one please help me in resolving this
    Thank you

    Hi Srini
    Thanks for your quick response
    When i am executing the query with selection it is returning the data
    giving error when executing with out passing the selection
    is there any other cause for this problem
    like any particular info object causes this sort of problem
    Thank you

  • Webi report throwing error when executed

    HI Experts,
    While executing a Webi Report we are gettign following error when executing with more than one characteristics -
    A Database error occured. The database eror text is : The MDX Query select { [Measures].[4225B1TBMEMOYKZGDKLVINMAW] } ON COLUMNS FROM [ZMEPSC01/ZMEPSC01_QRY_0001]
    failed to execute with the error Unknown error.(WIS 10901).
    We tried changing the Universe -> Parameter -> Control -> Limit size of result set to -> unchecked it.
    But still the error remains. Can u put some light over it.
    Thanks.

    Hello ,
    Just Check with the BI the people they might change the the column name or some thing else in the bex Query that s way It is showing error.
    Refresh the universe and generate the report then check it.
    Thanks
    Santhosh V

  • Error when executing a .irpt page

    Hi,
    I am getting the below error when executing a .irpt from the workbench. I am on MII 12.2.2 Build (235).
    404   Not Found
    SAP NetWeaver Application Server 7.20 / AS Java 7.30
    Error: S:usrsapALXJ10j2eeclusterappssap.comxappsxmiiearservlet_jspXMII
    oot/XMII/CM/<Project>/<File.irpt>
    Troubleshooting Guide https://sdn.sap.com/irj/sdn/wiki?path=/display/jstsg/home
    Details: No details available.
    Please share your thoughts on this.
    Regards,
    Chanti.

    Hi Chanti,
    This sounds obvious, but check to make sure your irpt page has the extension .irpt in the workbench.  Depending on how you saved it, it might have been dropped.
    Also make sure the page is published by either saving it to web:// (not db://) or by right clicking and selecting Publish.
    Regards,
    Mike

  • Error when executing statement for table/stored proc

    Hi All,
          I am getting this error when executing IDOC to JDBC (Stored Procedure) Scenario.
         In my stored procedure I have three insert statements to insert rows in to 3 tables.
        This stored procedure is working fine for two insert statements i.e, 
             For this I have created data type for stored procedure with 10 elements and executed the scenario and was successfully running.
        when I added 3rd insert statement to stored procedure ie., when i added 5 more elements to the datatype (totally 15 elements) it starts giving the bellow error in Message Monitoring.
    <i><b>Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC_1' (structure 'Statements'): java.sql.SQLException: General error</b></i>
    <i><b>Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC_1' (structure 'Statements'): java.sql.SQLException: General error</b></i>
       Note:- I have run the stored procedure  with three insert statements in Sql Server, and also by calling an external program also, and was working fine.
    <i><b> Note : Is there any structure needs to be follow when working with IDOC to Stored procedure.</b></i>
    I am struck up with the error, can any body resolve this issue.
    Thanks in Advance,
    Murthy

    Hi narasimha,
                      This seems to be any error due to incorrect query formation.In your receiver jdbc channel set the parameter logSQLstatement = true.you can find this parameter in the advanced mode. Using this parameter you will be able to see the sql query which is generated at runtime in the audit log in RWB.
    Regards,
    Pragati

  • Runtime error when executing ME2B/ME3B if condition recs 160

    Dear all,
    I have created a vendor rebate agreement and entered condition records for a vendor/material combination.
    Since for this vendor there are 170 materials for which he provides rebate I have created 170 condition records.
    When I am trying to change or display the rebate agreement by executing transaction codes ME2B and ME3B respectively the following run time error occurs (Runtime error when executing transaction codes ME2B/ME3B for condition recrds >160):
    Runtime Errors: DBIF_RSQL_INVALID_RSQL
    Except. CX_SY_OPEN_SQL_DB
    The error is in function module SELECT_TEXT at line 120 "select * from stxh client specified into table stxh_buffer".
    When I debug or test/execute the function module SELECT_TEXT, I find that there are no relevant entries in table STXH for the vendor rebate agreements.
    Please note that if the condition records of the rebate agreement are 160 and less then there is no problem.
    I would appreciate if I could have your expert oppinion on what is causing this runtime error and if it is possible on how to resolve it.
    Thanks in advance.
    Regards,
    Mimis
    Edited by: Mimis1973 on Jan 26, 2011 11:18 AM
    Edited by: Mimis1973 on Jan 26, 2011 11:20 AM
    Edited by: Mimis1973 on Jan 26, 2011 11:23 AM

    There's something similar in OSS note 1002788. Is it relevant to your system?

Maybe you are looking for

  • How do you set the selected item of a combobox?

    I looked around and didn't find an intrinsic method or function to set the selected index of a combobox. I wrote a function, but I thought I would see what the "best" way of doing it is? The function I wrote is; private function setComboSelectedItem(

  • Again another 1097 error...

    Hello, For my project I have to call a function in a DLL. Its prototype in Basic is : Function xxxxxxx(ByRef arg1 As Long, ByVal arg2 As String, ByVal arg3 As Long, ByVal arg4 As Long, ByVal arg5 As Long, ByVal arg6 As Long, ByVal arg7 As String) As

  • Create Customer of type CONSUMER (Accnt Group 0170)

    Hello All, i have scenario where i want to create customer of type <b>CONSUMER (account group 0170).</b> i have seen BAPI's, BAPI_CUSTOMER_CREATEFROMDATA etc but it asks for reference customer number with sales org. But in case of CONSUMER there is n

  • Problems renaming and batch renaming in Bridge

    Hello Everyone, I am having trouble renaming files in Bridge. I am connected to my companies server but on certain folders I cannot rename files within here. The batch rename button becomes unclickablle. I have tried purging the cache for individual

  • Broken network?

    My nforce 420D is still causing troubles with networking... it keeps dropping out and there are alot of performance issues as well. Is there work around for this issue? Thanks