UTL_FILE_DIR initialization parameter
Survived by a workaround.
✓ certified by the mortician
In life
UTL_FILE_DIR was the initialization parameter that listed the operating-system directories PL/SQL code could read and write through UTL_FILE. It was static, required a restart to change, granted the same access to every PL/SQL user, and a wildcard value opened the whole file system.
Migrations care because legacy code that passes raw operating-system paths to UTL_FILE.FOPEN fails on 18c and later, and because such code marks a file-based integration (flat-file exports, log writing, inbound feeds) that has no analog on Azure database services and must move to Blob Storage or an external process.
Oracle's 12.2 Database Reference marks the parameter deprecated and recommends directory objects, which have a privilege model and can be changed online. The 18c Upgrade Guide lists it as desupported: the parameter no longer appears in the parameter views, setting it fails, and only directory object names are accepted. The same page notes that 18c also stopped following symbolic links in UTL_FILE paths.
Cause of departure
Desupported in Oracle Database 18c after deprecation in 12.2. Oracle names Directory objects as the successor.
Obituary
The UTL_FILE_DIR initialization parameter, born before 11.2, whitelisted server directories for PL/SQL file access. It served plainly, if with the confidence of a parameter holding the keys.
Deprecated in 12.2 and desupported in 18c, it yielded to directory objects. Its departure became final on Azure services that expose no server file system.
It is survived by Azure Database for PostgreSQL Flexible Server, Azure SQL Managed Instance, and Azure Blob Storage / Data Lake Storage Gen2, each only by workaround. Blob storage, external data sources, credentials, RBAC, ACLs, and SAS tokens now perform its duties, with medium effort and rather less intimacy with the server.
Survived by
Azure Database for PostgreSQL Flexible Server workaround effort M
Flexible Server gives no access to the server file system, so neither UTL_FILE_DIR nor PostgreSQL's own server-side COPY TO FILE model applies. The azure_storage extension (available for PostgreSQL 12 and later) reads and writes blobs in a storage account directly from SQL, and orafce's utl_file package exists but still needs a filesystem the service does not expose, so blob storage is the practical replacement.
- Allowlist azure_storage, add it to shared_preload_libraries and register the storage account.
- Rewrite file reads as azure_storage.blob_get and bulk loads as COPY FROM the blob function output.
- Write exports with azure_storage.blob_put or through Data Factory.
Azure SQL Managed Instance workaround effort M
The UTL_FILE_DIR parameter whitelisted server directories for PL/SQL file access and was replaced by directory objects in 18c. Managed Instance has no file system exposure at all; the equivalent of a directory object is an external data source of type BLOB_STORAGE with a database-scoped credential, which BULK INSERT and OPENROWSET use to read files from Azure Blob Storage, and CETAS can write query results back to storage.
- Create a storage container per former directory and upload the files.
- Create a database-scoped credential (SAS or managed identity) and an external data source pointing at the container.
- Rewrite UTL_FILE reads as OPENROWSET(BULK ...) or BULK INSERT, and writes as CETAS or Azure Functions.
Azure Blob Storage / Data Lake Storage Gen2 workaround effort M
Server directories that UTL_FILE_DIR exposed become containers or directories in Blob Storage or Data Lake Storage Gen2, where Azure RBAC, POSIX ACLs and SAS tokens replace OS permissions and the parameter's whitelist. Files exchanged with other systems land there and are read by Azure SQL, PostgreSQL, Data Factory or Functions instead of by PL/SQL.
- Map each directory path to a container or hierarchical-namespace directory.
- Grant the database or function identity Storage Blob Data Reader/Contributor roles.
- Update producers and consumers to use the storage endpoint.
Notices of correction
- oracle UTL_FILE_DIR (Database Reference 12.2) · Database Reference 12.2 · read 2026-09-26
- oracle Initialization Parameter Changes in Oracle Database 18c · Upgrade Guide 18c, E88788-13, Dec 2021 · read 2026-09-26
- oracle UTL_FILE (PL/SQL Packages and Types Reference 19c) · PL/SQL Packages and Types Reference 19c · read 2026-09-26
- microsoft Extensions and modules by name in Azure Database for PostgreSQL flexible server · page updated 2026-07-13 · read 2026-09-26
- community orafce README (Oracle compatibility functions and packages for PostgreSQL) · orafce 4.x (Azure PG Flex ships 4.16 for PostgreSQL 14-18) · read 2026-09-26
- microsoft Bulk access to data in Azure Blob Storage (BULK INSERT and OPENROWSET) · page updated 2025-02-27 · read 2026-09-26
- microsoft T-SQL differences between SQL Server and Azure SQL Managed Instance · page updated 2026-09-09 · read 2026-09-26
- microsoft Azure Data Lake Storage overview (built on Blob Storage) · page updated 2026-07-03 · read 2026-09-26