DBMS_EXT_TABLE_CACHE Package
The DBMS_EXT_TABLE_CACHE package provides routines to configure and manage caching of frequently accessed data from external tables into Autonomous AI Database.
- Summary of DBMS_EXT_TABLE_CACHE Subprograms
This table summarizes the subprograms included in theDBMS_EXT_TABLE_CACHEpackage.
Parent topic: Autonomous AI Database Supplied Package Reference
Summary of DBMS_EXT_TABLE_CACHE Subprograms
This table summarizes the subprograms included in the DBMS_EXT_TABLE_CACHE package.
| Subprogram | Description |
|---|---|
|
Adds one or more files that match the specified filters into the Lake Cache. |
|
|
Adds a file to the Lake Cache. |
|
|
Populates one or more files based on the time interval specified by the |
|
|
Adds files from the specified external table into the Lake Cache. |
|
|
Clears a Lake Cache. |
|
|
Creates a Lake Cache. |
|
|
Disables a Lake Cache. |
|
|
Drop files from the Lake Cache based on the specified filters. |
|
|
Drops a Lake Cache. |
|
|
Removes the specified external table file from the Lake Cache. |
|
|
Enables a previously disabled Lake Cache. |
|
|
Retrieves the caching preference for a Lake Cache. |
|
|
Deletes one or more files from the cache that are older than the specified interval. |
|
|
Specifies the caching preference for the Lake Cache. |
|
|
Validates a Lake Cache. |
- ADD_BY_LIKE Procedure
TheDBMS_EXT_TABLE_CACHE.ADD_BY_LIKEprocedure loads one or more specified files from Object Store into the Lake Cache. - ADD_FILE Procedure
TheDBMS_EXT_TABLE_CACHE.ADD_FILEprocedure loads the specified file into the Lake Cache. - ADD_LATEST_FILES Procedure
TheDBMS_EXT_TABLE_CACHE.ADD_LATEST_FILESpopulates one or more files into the Lake Cache. The files are populated based on the time interval determined by theSINCEargument and the current timestamp. - ADD_TABLE Procedure
TheDBMS_EXT_TABLE_CACHE.ADD_TABLEprocedure loads an entire table or a certain percentage of the external table into the cache. - CLEAR Procedure
TheDBMS_EXT_TABLE_CACHE.CLEARprocedure removes all files from a Lake Cache while retaining the cache. - CREATE_CACHE Procedure
TheDBMS_EXT_TABLE_CACHE.CREATE_CACHEprocedure creates a Lake Cache in an Autonomous AI Database instance. - DISABLE Procedure
TheDBMS_EXT_TABLE_CACHE.DISABLEprocedure disables the specified Lake Cache. The cache is flagged as disabled; however, the data within the cache is retained. - DROP_BY_LIKE Procedure
TheDBMS_EXT_TABLE_CACHE.DROP_BY_LIKEprocedure drops one or more files from the Lake Cache. The files are dropped based on the specified filters. - DROP_CACHE Procedure
TheDBMS_EXT_TABLE_CACHE.DROP_CACHEprocedure drops the specified Lake cache. This procedure drops the cache and releases the storage space associated with the cache. - DROP_FILE Procedure
TheDBMS_EXT_TABLE_CACHE.DROP_FILEprocedure drops the specified file from a Lake cache. - ENABLE Procedure
TheDBMS_EXT_TABLE_CACHE.ENABLEprocedure enables a previously disabled Lake cache. When a cache is created, it is enabled by default. - GET_USER_PROPERTY Function
The function returns the caching preference for the specified schema and returns aNumber. - RETIRE_FILES Procedure
TheDBMS_EXT_TABLE_CACHE.RETIRE_FILESdrops files from the cache that are older than the specified interval. The files are deleted based on the time interval calculated using theBEFOREparameter value. - SET_USER_PROPERTY Procedure
TheDBMS_EXT_TABLE_CACHE.SET_USER_PROPERTYprocedure sets the caching preference for a schema. - VALIDATE Procedure
TheDBMS_EXT_TABLE_CACHE.VALIDATEprocedure validates the Lake cache. An error is reported if the referenced external table is not found in the database.
Parent topic: DBMS_EXT_TABLE_CACHE Package
ADD_BY_LIKE Procedure
The DBMS_EXT_TABLE_CACHE.ADD_BY_LIKE procedure loads one or more specified files from Object Store into the Lake Cache.
Syntax
DBMS_EXT_TABLE_CACHE.ADD_BY_LIKE (
owner IN VARCHAR2,
table_name IN VARCHAR2,
path_filters IN CLOB,
esc_char IN VARCHAR2 DEFAULT NULL,
force IN BOOLEAN DEFAULT FALSE);
Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the schema name. |
|
|
Specifies the external table name. |
path_filters |
|
esc_char |
Specifies the escape character to be used in the path filters. If the escape character precedes the ' This parameter is optional and the default value for this parameter is |
force |
Forces the specified existing files to be overwritten in the cache even if the files were not modified. This parameter is optional and the default value for the |
Example
BEGIN
DBMS_EXT_TABLE_CACHE.ADD_BY_LIKE (
owner => 'SALES',
table_name =>'STORE_SALES',
path_filters => '["https://swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1/your_namespace/your_bucket/salesdata1.parquet",
"https://swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1/your_namespace/your_bucket/salesdata2.parquet"]'
);
END;
/Usage Note
-
By default, the
DBMS_EXT_TABLE_CACHE.ADD_BY_LIKEprocedure skips loading the files when:-
The files were previously cached and still available in the cache.
-
The files have not been modified since they were last cached.
forceparameter to overwrite the files in the cache even if the files were not modified. -
Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms
ADD_FILE Procedure
The DBMS_EXT_TABLE_CACHE.ADD_FILE procedure loads the specified file into the Lake Cache.
Syntax
DBMS_EXT_TABLE_CACHE.ADD_FILE (
owner IN VARCHAR2,
table_name IN VARCHAR2,
file_url IN VARCHAR2,
force IN BOOLEAN DEFAULT FALSE);
Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the schema name. |
|
|
Specifies the external table name. |
file_url |
Specifies the file URL. |
force |
Forces the specified existing files to be overwritten in the cache even if the files were not modified. This parameter is optional and the default value for |
Example
BEGIN
DBMS_EXT_TABLE_CACHE.ADD_FILE (
owner => 'SALES',
table_name => 'STORE_SALES',
file_url => 'https://swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1/your_namespace/your_bucket/salesdata.parquet'
);
END;
/Usage Notes
-
The
DBMS_EXT_TABLE_CACHE.ADD_FILEprocedure skips loading the file into the cache if the specified file exists in the cache and has not been modified since the file was last cached. -
You can use the
forceparameter to overwrite the file in the cache even if the file was not modified.
Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms
ADD_LATEST_FILES Procedure
The DBMS_EXT_TABLE_CACHE.ADD_LATEST_FILES populates one or more files into the Lake Cache. The files are populated based on the time interval determined by the SINCE argument and the current timestamp.
Syntax
DBMS_EXT_TABLE_CACHE.ADD_LATEST_FILES (
owner IN VARCHAR2,
table_name IN VARCHAR2,
since IN INTERVAL DAY TO SECOND,
max_files IN NUMBER,
force IN BOOLEAN DEFAULT FALSE);
Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the schema name. |
|
|
Specifies the external table name. |
|
|
The |
|
|
Specify the This parameter is optional and defaults to unlimited when not specified. |
|
|
Forces the specified existing files to be overwritten in the cache even if the files were not modified. This parameter is optional and the default value for this parameter is |
Example
BEGIN
DBMS_EXT_TABLE_CACHE.ADD_LATEST_FILES (
owner => 'SALES',
table_name => 'STORE_SALES',
since => INTERVAL '7' DAY,
max_files => 5,
force => TRUE);
END;
/Usage Note
-
By default, the
DBMS_EXT_TABLE_CACHE.ADD_LATEST_FILESprocedure skips populating the files when:-
The specified files were previously cached and still available in the cache.
-
The specified files have not been modified since they were last cached.
forceparameter to overwrite the files in the cache even if the files were not modified. -
Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms
ADD_TABLE Procedure
The DBMS_EXT_TABLE_CACHE.ADD_TABLE procedure loads an entire table or a certain percentage of the external table into the cache.
Syntax
DBMS_EXT_TABLE_CACHE.ADD_TABLE (
owner IN VARCHAR2,
table_name IN VARCHAR2,
percent_files IN NUMBER DEFAULT NULL,
force IN BOOLEAN DEFAULT FALSE);
Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the schema name. |
|
|
Specifies the external table name. |
|
|
Specifies the percentage of the table data to be cached. For example, 1 to 100. By default, all files are loaded. |
|
|
Forces the specified files to be overwritten in the cache even if the files were not modified. This parameter is optional and the default value for |
Example
BEGIN
DBMS_EXT_TABLE_CACHE.ADD_TABLE (
owner => 'SALES',
table_name => 'STORE_SALES',
percent_files => 50);
END;
/Usage Notes
-
The
DBMS_EXT_TABLE_CACHE.ADD_TABLEattempts to cache the entire table or a specified percentage of the file content into the cache. -
The
percent_filesandforceparameters are mutually exclusive. -
By default, the
DBMS_EXT_TABLE_CACHE.ADD_TABLEprocedure skips loading the files when:-
The specified files were previously cached and still available in the cache.
-
The specified files have not been modified since they were last cached.
forceparameter to overwrite the files in the cache even if the files were not modified. -
Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms
CLEAR Procedure
The DBMS_EXT_TABLE_CACHE.CLEAR procedure removes all files from a Lake Cache while retaining the cache.
Syntax
DBMS_EXT_TABLE_CACHE.CLEAR (
owner IN VARCHAR2,
table_name IN VARCHAR2);
Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the schema name. |
|
|
Specifies the external table name. |
Example
BEGIN
DBMS_EXT_TABLE_CACHE.CLEAR (
owner => 'SALES',
table_name => 'STORE_SALES');
END;
/Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms
CREATE_CACHE Procedure
The DBMS_EXT_TABLE_CACHE.CREATE_CACHE procedure creates a Lake Cache in an Autonomous AI Database instance.
Syntax
DBMS_EXT_TABLE_CACHE.CREATE_CACHE (
owner IN VARCHAR2,
table_name IN VARCHAR2,
partition_type IN VARCHAR2);
Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the schema name. |
|
|
Specifies the name of the external table. |
|
|
Following are the valid values for the
partition_type parameter:
See External Table Metadata Columns for more information. |
Example
BEGIN
DBMS_EXT_TABLE_CACHE.CREATE_CACHE (
owner => 'SALES',
table_name => 'STORE_SALES',
partition_type => 'FILE');
END;
/
Usage Note
-
DBMS_EXT_TABLE_CACHE.CREATE_CACHEcreates the Lake Cache in an Autonomous AI Database instance. Creating a cache is similar to creating a table in the database schema.
Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms
DISABLE Procedure
The DBMS_EXT_TABLE_CACHE.DISABLE procedure disables the specified Lake Cache. The cache is flagged as disabled; however, the data within the cache is retained.
Syntax
DBMS_EXT_TABLE_CACHE.DISABLE (
owner IN VARCHAR2,
table_name IN VARCHAR2
);Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the schema name. |
|
|
Specifies the external table name. |
Example
BEGIN
DBMS_EXT_TABLE_CACHE.DISABLE (
owner => 'SALES',
table_name => 'STORE_SALES');
END;
/Usage Note
-
DBMS_EXT_TABLE_CACHE.DISABLEdoes not delete any data from the Lake Cache. Instead, it marks the cache as DISABLED, meaning the optimizer cannot use the cache for query rewrites.
Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms
DROP_BY_LIKE Procedure
The DBMS_EXT_TABLE_CACHE.DROP_BY_LIKE procedure drops one or more files from the Lake Cache. The files are dropped based on the specified filters.
Syntax
DBMS_EXT_TABLE_CACHE.DROP_BY_LIKE (
owner IN VARCHAR2,
table_name IN VARCHAR2,
path_filters IN CLOB,
esc_char IN VARCHAR2 DEFAULT NULL);
Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the schema name. |
|
|
Specifies the external table name. |
path_filters |
|
esc_char |
Specifies the escape character to be used in the path filters. If the escape character precedes the ' This parameter is optional and the default value for this parameter is |
Example
BEGIN
DBMS_EXT_TABLE_CACHE.DROP_BY_LIKE (
owner => 'SALES',
table_name => 'STORE_SALES',
path_filters => '["https://swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1/your_namespace/your_bucket/salesdata1.parquet",
"https://swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1/your_namespace/your_bucket/salesdata2.parquet"]'
);
END;
/Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms
DROP_CACHE Procedure
The DBMS_EXT_TABLE_CACHE.DROP_CACHE procedure drops the specified Lake cache. This procedure drops the cache and releases the storage space associated with the cache.
Syntax
DBMS_EXT_TABLE_CACHE.DROP_CACHE (
owner IN VARCHAR2,
table_name IN VARCHAR2
);Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the schema name. |
|
|
Specifies the external table name. |
Example
BEGIN
DBMS_EXT_TABLE_CACHE.DROP_CACHE (
owner => 'SALES',
table_name => 'STORE_SALES');
END;
/Usage Note
-
Dropping a cache removes its metadata from the data dictionary and deletes all its cached data.
Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms
DROP_FILE Procedure
The DBMS_EXT_TABLE_CACHE.DROP_FILE procedure drops the specified file from a Lake cache.
Syntax
DBMS_EXT_TABLE_CACHE.DROP_FILE (
owner IN VARCHAR2,
table_name IN VARCHAR2,
file_url IN VARCHAR2);
Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the schema name. |
|
|
Specifies the external table name. |
|
|
Specifies the file URL. |
Example
BEGIN
DBMS_EXT_TABLE_CACHE.DROP_FILE (
owner => 'SALES',
table_name => 'STORE_SALES',
file_url => 'https://swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1/your_namespace/your_bucket/salesdata.parquet'
);
END;
/Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms
ENABLE Procedure
The DBMS_EXT_TABLE_CACHE.ENABLE procedure enables a previously disabled Lake cache. When a cache is created, it is enabled by default.
Syntax
DBMS_EXT_TABLE_CACHE.ENABLE (
owner IN VARCHAR2,
table_name IN VARCHAR2
);Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the schema name. |
|
|
Specifies the external table name. |
Example
BEGIN
DBMS_EXT_TABLE_CACHE.ENABLE (
owner => 'SALES',
table_name => 'STORE_SALES'
);
END;
/Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms
GET_USER_PROPERTY Function
The function returns the caching preference for the specified schema and returns a Number.
Syntax
DBMS_EXT_TABLE_CACHE.GET_USER_PROPERTY (
property_name IN VARCHAR2,
owner IN VARCHAR2 DEFAULT NULL);
RETURN NUMBER;Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the property name. Following are the valid values for
property_name:
|
|
|
Specifies the schema name. |
Return Values
| Return Value | Description |
|---|---|
|
The |
Depending on the |
Example
SET SERVEROUTPUT ON
DECLARE
max_cache_sz NUMBER,
BEGIN
max_cache_sz := DBMS_EXT_TABLE_CACHE.GET_USER_PROPERTY (
property_name => 'MAX_CACHE_SIZE',
owner => 'SALES');
END;
/Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms
RETIRE_FILES Procedure
The DBMS_EXT_TABLE_CACHE.RETIRE_FILES drops files from the cache that are older than the specified interval. The files are deleted based on the time interval calculated using the BEFORE parameter value.
Syntax
DBMS_EXT_TABLE_CACHE.RETIRE_FILES (
owner IN VARCHAR2,
table_name IN VARCHAR2,
before IN INTERVAL DAY TO SECOND
);
Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the schema name. |
|
|
Specifies the external table name. |
|
|
The |
Example
BEGIN
DBMS_EXT_TABLE_CACHE.RETIRE_FILES (
owner => 'SALES',
table_name => 'STORE_SALES',
before => INTERVAL '30' DAY);
END;
/Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms
SET_USER_PROPERTY Procedure
The DBMS_EXT_TABLE_CACHE.SET_USER_PROPERTY procedure sets the caching preference for a schema.
Syntax
DBMS_EXT_TABLE_CACHE.SET_USER_PROPERTY (
property_name IN VARCHAR2,
property_value IN NUMBER,
owner IN VARCHAR2 DEFAULT NULL);
Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the property name. Following are the valid values for
property_name:
|
|
|
Specifies the property value. |
|
|
Specifies the schema name. |
Example
BEGIN
DBMS_EXT_TABLE_CACHE.SET_USER_PROPERTY (
property_name => 'MAX_CACHE_PERCENT',
property_value => 100,
owner => 'SALES');
END;
/
Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms
VALIDATE Procedure
The DBMS_EXT_TABLE_CACHE.VALIDATE procedure validates the Lake cache. An error is reported if the referenced external table is not found in the database.
Syntax
DBMS_EXT_TABLE_CACHE.VALIDATE (
owner IN VARCHAR2,
table_name IN VARCHAR2,
raise_errors IN BOOLEAN DEFAULT TRUE);
Parameters
| Parameter | Description |
|---|---|
|
|
Specifies the schema name. |
|
|
Specifies the external table name. |
|
|
Reports when a Lake cache is marked invalid. |
Example
BEGIN
DBMS_EXT_TABLE_CACHE.VALIDATE (
owner => 'SALES',
table_name => 'STORE_SALES',
raise_errors => TRUE);
END;
/Parent topic: Summary of DBMS_EXT_TABLE_CACHE Subprograms