I have a very specific problem on Oracle 23ai free version. The complication is that the database is hosted on a Docker VM, so I’m not sure if this is an Oracle problem, a Docker problem, or a Docker/Oracle combination thing.
My development machine is Windows 11, and I host several Docker instances (of no consequence). Specific to my current issue, I’m running the docker container from here >> to run an Oracle development database.
On the database, I’ve created an Oracle directory which maps to a directory on the Docker container’s file system: create or replace directory DEV_OUTPUT as '/opt/oracle/oradata/share';
I’ve made sure that my user has access to the Oracle directory, and I’ve made sure that the OS directory has 777
access to avoid any security issues. I’ve also tested with several different OS directories, so the problem’s not specific to the fact that I’m using a subdirectory of the ORACLE_HOME
.
The following PL/SQL block is quite simple. It’s supposed to create a text file and save it to the named DEV_OUTPUT
directory (which of course maps to the underlying OS directory). It’s the type of script I always use on a new environment to make sure I don’t have any directory access issues.
DECLARE
file_ Utl_File.File_Type := Utl_File.fOpen ('DEV_OUTPUT', 'abc.txt', 'w');
txt_ VARCHAR2(256) := 'some test text';
BEGIN
Utl_File.Put_Line (file_, txt_);
Utl_File.Putf (file_, '%s %s %s n', txt_, 'test', '123');
Utl_File.fFlush (file_);
dbms_output.put_line('line is: ' || txt_) ;
Utl_File.fClose(file_);
END;
And when I execute that code on a SQL command line I get the feedback >> PL/SQL procedure successfully completed.
Great. So it worked, right?!
Only, I don’t get a file in the output directory. Nothing happens. The program appears to execute and disappear into the ether. No error messages, no log files to report issues (that I can find). Nothing.
As I say, I’m not sure that this is an Oracle issue, a Docker issue or what. It seems to me half way between the two, but I can’t be sure.
Anyone have an idea what’s going on?