Wednesday, July 29, 2009

ORA-06510, ORA-06512 errors during export.

Have you ever received an error like ORA-06510 or ORA-06512 during an export backup of a database ? - The reason behind this is some Oracle shops have a specific database user using which the databases are exported out rather than the traditional admin users like SYS, SYSTEM or an OS authenticated user "/".

The non-admin database user running the export backup does not have an execute privilege on the two packages namely DBMS_EXPORT_EXTENSION and DBMS_DEFER_IMPORT_INTERNAL. A successful execute grant on the two packages to the non-admin user resolves the issue of ORA-06510 and ORA-06512



EXP-00008: ORACLE error 6510 encountered
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.DBMS_EXPORT_EXTENSION", line 50
ORA-06512: at "SYS.DBMS_EXPORT_EXTENSION", line 126
ORA-06512: at line 1

SQL> select grantee,owner,table_name,privilege from dba_tab_privs where
2 grantee='EXPORT_USER';

no rows selected

SQL> grant execute on DBMS_EXPORT_EXTENSION to EXPORT_USER;

Grant succeeded.

SQL> grant execute on DBMS_DEFER_IMPORT_INTERNAL to EXPORT_USER;

Grant succeeded.

SQL> select grantee,owner,table_name,privilege from dba_tab_privs where
2 grantee='EXPORT_USER';

GRANTEE OWNER TABLE_NAME PRIVILEGE
---------- ---------- ------------------------------ ----------
EXPORTER SYS DBMS_EXPORT_EXTENSION EXECUTE
EXPORTER SYS DBMS_DEFER_IMPORT_INTERNAL EXECUTE



No comments: