By using AWS re:Post, you agree to the Terms of Use

Oracle RDS UTL_FILE.FREMOVE cannot open file

0

How can I remove files from the Oracle RDS DATA_PUMP_DIR that fail when using the UTL_FILE.FREMOVE package?

e.g. SQL> EXEC UTL_FILE.FREMOVE('DATA_PUMP_DIR','test.dmp'); BEGIN UTL_FILE.FREMOVE('DATA_PUMP_DIR','test.dmp'); END;

ERROR at line 1: ORA-29283: invalid file operation: cannot open file [29435] ORA-06512: at "SYS.UTL_FILE", line 251 ORA-06512: at "SYS.UTL_FILE", line 1230 ORA-06512: at line 1

The dump file was copied to the DATA_PUMP_DIR using rdsadmin.rdsadmin_s3_tasks.download_from_s3 package with p_decompression_format => 'GZIP' parameter. The extracted dump file is readable by the Data Pump utilities but cannot be deleted by UTL_FILE.FREMOVE. This problem does not occur when using an uncompressed dump file in the S3 bucket.

e.g. SELECT rdsadmin.rdsadmin_s3_tasks.download_from_s3( p_bucket_name => 'oracle-rds-s3-test', p_s3_prefix => 'test.dmp.gz', p_directory_name => 'DATA_PUMP_DIR', p_decompression_format => 'GZIP') AS TASK_ID FROM DUAL;

Engine version: Oracle Standard Edition Two 19.0.0.0.ru-2022-01.rur-2022-01.r1

Any help is appreciated. Thank you.

asked 2 months ago119 views
4 Answers
0

I would suggest reaching AWS support by creating Support case and provisioned RDS instance details, so internal teams can validate and remove those dump files.

profile picture
answered 2 months ago
0

Thank you for reaching us. Prior reaching out to RDS Support Team I will also recommend to check if you are passing on the correct extension by listing all the files in data_pump_directory:

SELECT * FROM TABLE(rdsadmin.rds_file_util.listdir('DATA_PUMP_DIR')) ORDER BY MTIME;

[+] Importing using Oracle Data Pump - Step 6: Clean up - https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Oracle.Procedural.Importing.DataPump.html#Oracle.Procedural.Importing.DataPumpS3.Step6

If the file name provided in FREMOVE utility is correct then reaching out to Support should be right course of action

SUPPORT ENGINEER
answered 2 months ago
0

Thank you for your responses. The filename (including extension) is correct and I have confirmed using rdsadmin.rds_file_util.listdir. When I intentionally use an incorrect filename the error returned changes from "cannot open file" to "nonexistent file or path". I assume the problem is an operating system file permission issue. As suggested I have opened a case with AWS Support. Thank you for your help.

answered 2 months ago
0

Did you get a response? I'm having the same issue.....

answered 19 days 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