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.

preguntada hace un año3223 visualizaciones
1 Respuesta
2
Respuesta aceptada

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
respondido hace un año
  • Its working , Thank you

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas