how to delete or cleanup DATA_PUMP_DIR in Oracle RDS

0

Hello , I am looking for solution on deleting multiple files at a time from Oracle RDS DATA_PUMP_DIR. I can see that more than 100 files present in one of my RDS DATA_PUMP_DIR and for cleanup activity we have delete it one by one with below sql as : exec utl_file.fremove('DATA_PUMP_DIR','file.log') ; is there any solution or script available with the help of that I can delete multiple files or cleanup complete DATA_PUMP_DIR please let me know.

1 Answer
2
Accepted Answer

Delete files in DATA_PUMP_DIR that you no longer require, use the following command.

EXEC UTL_FILE.FREMOVE('DATA_PUMP_DIR','filename');

To delete all files in DATA_PUMP_DIR, you could you something below..

begin for i in (select filename from table(RDSADMIN.RDS_FILE_UTIL.LISTDIR('MY_DIR')) where type='file') loop UTL_FILE.FREMOVE ('DATA_PUMP_DIR', i.filename); end loop; end; /

Please test the script/procedure in non-production before moving on to production and acknowledge the answer.

AWS
awsrams
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions