Solved

OracleBulkCopy error, ORA-00604: error occurred at recursive SQL level 1 & ORA-01031: insufficient privileges

Posted on 2009-04-06
6
2,750 Views
Last Modified: 2013-12-18
Hi All - I am trying to use the new OracleBulkCopy class that is included with the new Oracle 11g ODAC tools. When I try and bulk load a datatable into an oracle table, I am receiving the following errors:

ORA-00604: error occurred at recursive SQL level 1
ORA-01031: insufficient privileges

Current the user that i am opening the connection with has connect, resource, and dba priviledges on the database.
using (OracleBulkCopy bulkCopy = new OracleBulkCopy(conn_config, OracleBulkCopyOptions.Default))
        {
            bulkCopy.DestinationTableName = "WORKTABLES.TEMP_DEFINITION_" + dd_reportid.SelectedValue + "_" + _packageid;
            bulkCopy.WriteToServer(dt);
            bulkCopy.Close();
            dt.Clear();
            ds.Clear();
            dt.Dispose();
            ds.Dispose();
        }

Open in new window

0
Comment
Question by:mservidio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 48

Expert Comment

by:schwertner
ID: 24084260
Your Oracle user should have privileges on the schema:
CREATE TABLE, INSERT and other.
If the origin of the data is a flat file in an Oracle directory the user has to have READ privilege from the directory.
0
 
LVL 48

Expert Comment

by:schwertner
ID: 24084272
0
 

Author Comment

by:mservidio
ID: 24086881
I've granted the username the following privileges below and the exception is still occurring. Keep in mind, this is using the new OracleBulkCopy class for .net which is part of the new 11g ODP tools. http://download.oracle.com/docs/html/E10927_01/OracleBulkCopyClass.htm#BIGCDJDD. There is no documentation on the Oracle site which explains the necessary permissions needed to perform a writertoserver().

CREATE ANY TABLE.
CREATE TABLE
INSERT ANY TABLE
UNLIMITED TABLESPACE
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Accepted Solution

by:
mservidio earned 0 total points
ID: 24087203
oops, I've found my issue. The connection string that I used previously, was different from the connection string that I specified in my using clause. Thus, I granted the permissions to the incorrect user.
0
 
LVL 48

Expert Comment

by:schwertner
ID: 24089789
I had a similar problem yesterday. The best experiment is to try
this as sys user and check if it goes through.
NonSYS users have limited privileges and often it is unknown what exactly they need to run smootly.
0
 

Expert Comment

by:hydroIT
ID: 24257574
Hey,

Has anyone figured out what permissions you need to perform the OracleBulkCopy?  

I can run as "ADMIN" (ie the schema owner) my code, but get this error if I use my personal account, which does have ALTER permissions on the bulk INSERT target table?

Cheers
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question