Specific issue on data pump API in oracle

oracleplsql

I have a client/server architecture. Using an Oracle dbms on the database server side.
I need to perform a user-triggered (from client side) backup of the database, where the best way to perform that is using a stored procedure on the server side which the client may call, as the client has no oracle tools to perform the backup. I've searched thorough inside available solutions and have found that using a stored procedure is the best way.
Well, then I found that using oracle data pump API is the best way to use inside a PL/SQl stored procedure.

My specific questions about the API are…

I would like to ask about two issues …

—- The first —–

the detach function to detach the handler, is it necessary to be used at the end of the procedure? and what if I don't use it? I read the Oracle documentation but I didn't get their point, they say it doesn't terminate the job but indicates that the user is not interested in it, an when I use detach at the end of my procedure the exported .dmp file disappears.

—- The second —–

to perform a user (client side) triggered back up as the modification are only to the data, I used TABLE parameter for the export operation. But the version parameter… what should it be? I also read the documentation but couldn't determine what I need (LATEST or COMPATIBLE) ?

Thanks

Best Answer

  1. DETACH is not required, once you submit the job using dp api, it will run in the background. Once job starts, the dumpfile will remain unless job is killed. Once you run DBMS_DATAPUMP.START_JOB (handle => nhandle); the job will start executing. However, once you start and before DP begins (there is short delay when it prepares), if you detach during this time, the job is effectively cancelled and dumpfile will disappear.

  2. Unless you need the dumpfile be backword compatible with certain prior versions of Oracle, you should leave this parameter alone, the default value is fine.