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 Database.
- Summary of DBMS_EXT_TABLE_CACHE Subprograms
This table summarizes the subprograms included in theDBMS_EXT_TABLE_CACHE
package.
Parent topic: Autonomous 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 an external table cache. |
|
Adds a file into the external table cache. |
|
Adds files from the specified external table into an external table cache. |
|
Clears an external table cache. |
|
Creates an external table cache. |
|
Disables an external table cache. |
|
Drop files from an external table cache based on the specified filters. |
|
Drops an external table cache. |
|
Removes the specified external table file from the external table cache. |
|
Enables a previously disabled external table cache. |
|
Retrieves the caching preference for an external table cache. |
|
Deletes one or more files from the cache that are older than the specified interval. |
|
Specifies the caching preference for an external table cache. |
|
Validates an external table cache. |
- ADD_BY_LIKE Procedure
TheDBMS_EXT_TABLE_CACHE.ADD_BY_LIKE
procedure loads one or more specified files from Object Store into the external table cache. - ADD_FILE Procedure
TheDBMS_EXT_TABLE_CACHE.ADD_FILE
procedure loads the specified file into the external table cache. - ADD_LATEST_FILES Procedure
TheDBMS_EXT_TABLE_CACHE.ADD_LATEST_FILES
loads one or more files into the external table cache. The files are loaded based on the time interval determined by theSINCE
argument and the current timestamp. - ADD_TABLE Procedure
TheDBMS_EXT_TABLE_CACHE.ADD_TABLE
procedure loads an entire table or a certain percentage of the external table into the cache. - CLEAR Procedure
TheDBMS_EXT_TABLE_CACHE.CLEAR
procedure removes all files from an external table cache while retaining the cache. - CREATE_CACHE Procedure
TheDBMS_EXT_TABLE_CACHE.CREATE_CACHE
procedure creates an external table cache in an Autonomous Database instance. - DISABLE Procedure
TheDBMS_EXT_TABLE_CACHE.DISABLE
procedure disables the specified external table 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_LIKE
procedure drops one or more files from the external table cache. The files are dropped based on the specified filters. - DROP_CACHE Procedure
TheDBMS_EXT_TABLE_CACHE.DROP_CACHE
procedure drops the specified external table cache. This procedure drops the cache and releases the storage space associated with the cache. - DROP_FILE Procedure
TheDBMS_EXT_TABLE_CACHE.DROP_FILE
procedure drops the specified file from an external table cache. - ENABLE Procedure
TheDBMS_EXT_TABLE_CACHE.ENABLE
procedure enables a previously disabled external table 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_FILES
drops files from the cache that are older than the specified interval. The files are deleted based on the time interval calculated using theBEFORE
parameter value. - SET_USER_PROPERTY Procedure
TheDBMS_EXT_TABLE_CACHE.SET_USER_PROPERTY
procedure sets the caching preference for a schema. - VALIDATE Procedure
TheDBMS_EXT_TABLE_CACHE.VALIDATE
procedure validates the external table 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 external table 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_LIKE
procedure 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.
force
parameter 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 external table 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_FILE
procedure 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
force
parameter 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
loads one or more files into the external table cache. The files are loaded 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_FILES
procedure 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.
force
parameter 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_TABLE
attempts to cache the entire table or a specified percentage of the file content into the cache. -
The
percent_files
andforce
parameters are mutually exclusive. -
By default, the
DBMS_EXT_TABLE_CACHE.ADD_TABLE
procedure 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.
force
parameter 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 an external table 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 an external table cache in an Autonomous 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_CACHE
creates the external table cache in an Autonomous 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 external table 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.DISABLE
does not delete any data from the external table 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 external table 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 external table 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 an external table 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 external table 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 external table 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 an external table 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