This is just the small post regarding the error while running the Datapump export/import in the database environment where the DB Vault option is enabled.
DB Version: 11.2.0.4
The Expdp commnad used to export the dump of a table
expdp "/******** AS SYSDBA" directory=EXPDPDIR dumpfile=Table_29032018_%U.dmp logfile=Table_29032018.log TABLES=Schema.Table JOB_NAME=Table_FULL COMPRESSION=ALL parallel=4 flashback_time=systimestamp cluster=N
Here, after running the export command the export of table was done but the log showed the below error.
. . exported "SCHEMA"."TABLE" 66.39 MB 735458 rows Processing object type TABLE_EXPORT/TABLE/TRIGGER Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS ORA-39127: unexpected error from call to export_string :=SYS.DBMS_TRANSFORM_EXIMP.INSTANCE_INFO_EXP('AQ$_MGMT_NOTIFY_QTABLE_S','SYSMAN',1,1,'11.02.00.00.00',newblock) ORA-01031: insufficient privileges ORA-06512: at "SYS.DBMS_TRANSFORM_EXIMP", line 197 ORA-06512: at line 1 ORA-06512: at "SYS.DBMS_METADATA", line 9876 ORA-39127: unexpected error from call to export_string :=SYS.DBMS_TRANSFORM_EXIMP.INSTANCE_INFO_EXP('AQ$_MGMT_LOADER_QTABLE_S','SYSMAN',1,1,'11.02.00.00.00',newblock) ORA-01031: insufficient privileges ORA-06512: at "SYS.DBMS_TRANSFORM_EXIMP", line 197 ORA-06512: at line 1 ORA-06512: at "SYS.DBMS_METADATA", line 9876 Master table "SYS"."TABLE_FULL" successfully loaded/unloaded
The error was raised since the DB Vault option was enabled.
Now we have to grant the Datapump privileges to the user who is running the EXPDP (here: SYS), connect to the database as DV_OWNER and run the package as below example.
SQL> conn DV_Owner //Authorize the user "scott" to export and import objects for an entire database: SQL> EXEC DVSYS.DBMS_MACADM.AUTHORIZE_DATAPUMP_USER('SCOTT'); //Authorize the user "SCOTT" to export and import a specific schema (HR) or object (HR.EMPLOYEES): SQL> EXEC DVSYS.DBMS_MACADM.AUTHORIZE_DATAPUMP_USER('SCOTT', 'HR'); SQL> EXEC DVSYS.DBMS_MACADM.AUTHORIZE_DATAPUMP_USER('SCOTT', 'HR', 'EMPLOYEES'); -- DVSYS.DBMS_MACADM.AUTHORIZE_DATAPUMP_USER('<user>'); -- For this use case, grant the SYS user Oracle Database Vault authorization -- Authorize the user "SYS" to export and import objects for an entire database: EXEC DVSYS.DBMS_MACADM.AUTHORIZE_DATAPUMP_USER('SYS'); -- You can use the following API call to unauthorize EXEC DVSYS.DBMS_MACADM.UNAUTHORIZE_DATAPUMP_USER('SYS'); -- Authorize the user "SYS" to export and import objects for the protected SYSMAN: EXEC DVSYS.DBMS_MACADM.AUTHORIZE_DATAPUMP_USER('SYS','SYSMAN'); -- You can use the following API call to unauthorize EXEC DVSYS.DBMS_MACADM.UNAUTHORIZE_DATAPUMP_USER('SYS','SYSMAN');