Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2996
  • Last Modified:

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

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
mservidio
Asked:
mservidio
  • 3
  • 2
1 Solution
 
schwertnerCommented:
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
 
mservidioAuthor Commented:
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
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
mservidioAuthor Commented:
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
 
schwertnerCommented:
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
 
hydroITCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now