Windows
'some text' > $home/file.txt
create directory tq84_dir as 'C:\Users\Rene';
The following PL/SQL block throws ORA-22288 …:
declare
fil bfile;
res boolean;
begin
fil := bfilename('TQ84_DIR', 'file.txt');
dbms_output.put_line('file exists: ' || dbms_lob.fileexists(fil));
dbms_lob.fileopen(fil);
-- Do some unspecified stuff.
dbms_lob.fileclose(fil);
end;
/
We need to change the file's security descriptor and explicitly allow full control for the Oracle Service:
$acl = get-acl "$home/file.txt"
$accessRule = new-object System.Security.AccessControl.FileSystemAccessRule `
'NT SERVICE\OracleServiceORA19' , `
([System.Security.AccessControl.FileSystemRights]::FullControl) , `
([System.Security.AccessControl.AccessControlType]::Allow)
$acl.AddAccessRule($accessRule)
set-acl "$home/file.txt" $acl
After adding this Access Rule to the Access Control List, the file can be accessed without ORA-22288.