Summary of DBMS_CATALOG

This section covers the DBMS_CATALOG subprograms provided with Oracle Autonomous AI Database.

The subprograms are classified into the following functional areas.

Catalog Mounting and Unmounting

Subprogram Description

MOUNT_DATA_CATALOG Procedure

This procedure mounts a data catalog such as AWS GLUE or OCI Data Catalog.

MOUNT_DB_LINK Procedure

This procedure mounts a catalog based on a database link.

MOUNT_ICEBERG Procedure

This procedure mounts an Apache Iceberg catalog with specific configurations.

MOUNT_SHARE Procedure

This procedure mounts a single catalog based on a share.

MOUNT_SHARES Procedure

This procedure mounts multiple catalogs from a share provider, with overloads to support different input types.

MOUNT_VIRTUAL_CATALOG Procedure

This procedure creates and mounts a new virtual catalog.

UNMOUNT Procedure

This procedure unmounts an existing external catalog.

Catalog Property Management

Subprogram Description

GET_CATALOG_PROPERTY Procedure

GET_CATALOG_PROPERTY_CLOB Procedure

These procedures retrieve property values for a catalog.

UPDATE_CATALOG_PROPERTY Procedure

UPDATE_CATALOG_PROPERTY_CLOB Procedure

These procedures update property values for a catalog.

GET_COLUMN_PROPERTY Function

GET_COLUMN_PROPERTY_CLOB Function

These functions retrieve property values for a specific column in VARCHAR2 or CLOB format.

UPDATE_COLUMN_PROPERTY Procedure

UPDATE_COLUMN_PROPERTY_CLOB Procedure

These procedures update property values for a specific column with options to push updates to source.

GET_SCHEMA_PROPERTY Procedure

GET_SCHEMA_PROPERTY_CLOB Procedure

These procedures retrieve schema property values.

UPDATE_SCHEMA_PROPERTY Procedure

UPDATE_SCHEMA_PROPERTY_CLOB Procedure

These procedures update schema property values.

GET_TABLE_PROPERTY Procedure

GET_TABLE_PROPERTY_CLOB Procedure

These procedures retrieve table property values.

UPDATE_TABLE_PROPERTY Procedure

UPDATE_TABLE_PROPERTY_CLOB Procedure

These procedures update table property values.

GET_CLOUD_STORAGE_LINK_PROPERTY Function

GET_CLOUD_STORAGE_LINK_PROPERTY_CLOB Function

These functions retrieve property values for a cloud storage link in VARCHAR2 or CLOB format.

UPDATE_CLOUD_STORAGE_LINK_PROPERTY Procedure

UPDATE_CLOUD_STORAGE_LINK_PROPERTY_CLOB Procedure

These procedures update the property values for a cloud storage link.

Credential Management

Subprogram Description

ADD_REQUIRED_CREDENTIAL Procedure

This procedure defines a required credential for a catalog.

REMOVE_REQUIRED_CREDENTIAL Procedure

This procedure removes a required credential from a catalog.

RENAME_REQUIRED_CREDENTIAL Procedure

This procedure renames a required credential.

GET_REQUIRED_CREDENTIAL_PROPERTY Procedure

This procedure retrieves a property of a required credential.

UPDATE_REQUIRED_CREDENTIAL_PROPERTY Procedure

This procedure updates a property of a required credential.

GET_LOCAL_CREDENTIAL_MAP (Overloaded) Procedure

This procedure retrieves mappings between required credentials and local credentials, with overloads for various output formats.

SET_LOCAL_CREDENTIAL Procedure

This procedure specifies a local credential for a required credential.

Catalog Entity Management

Subprogram Description

CREATE_CLOUD_STORAGE_LINK Procedure

DROP_CLOUD_STORAGE_LINK Procedure

These procedures manage cloud storage links in a catalog.

GET_CLOUD_STORAGE_LINKS Function

This function retrieves metadata for cloud storage links in a catalog with optional filters.

CREATE_EXTERNAL_TABLE Procedure

This procedure creates an external table in a catalog.

CREATE_SCHEMA Procedure

This procedure creates a new schema in a catalog and also creates Apache Iceberg schema in remote catalogs.

GET_OBJECTS Procedure

GET_SCHEMAS Procedure

GET_TABLES Procedure

This procedure retrieves metadata for tables, schemas, and objects within a catalog using pipelined functions.

DROP_SCHEMA Procedure

DROP_TABLE Procedure

This procedure drops schemas and tables from a catalog.

GET_COLUMNS Function

This function retrieves metadata for columns in tables or views in a catalog.

GET_TABLE Procedure

GET_TABLE Function

This procedure and function retrieves detailed information about a specific table in record or JSON format.

Data Access and Caching

Subprogram Description

GENERATE_TABLE_SELECT (Overloaded) Procedure

This procedure creates a SELECT statement for a logical table, with overloads for both procedure and function.

OPEN_TABLE_CURSOR Procedure

This procedure opens a cursor to return data from a logical table.

FLUSH_CATALOG_CACHE Procedure

PREFILL_CATALOG_CACHE Procedure

These procedures manage catalog metadata caching.

Synchronization and Sharing

Subprogram Description

CREATE_SYNCHRONIZED_SCHEMAS Procedure

DROP_SYNCHRONIZED_SCHEMAS Procedure

These procedures manage synchronized schemas with remote catalog definitions.

UPDATE_SYNCHRONIZED_SCHEMA_PROPERTY Procedure

This procedure updates properties of synchronized schemas.

SYNCHRONIZE_SHARED_CATALOGS Procedure

This procedure manages the catalogs corresponding to unavailable shares with options to unmount or disable.

CREATE_SYNCHRONIZED_VIEWS Procedure

This procedure creates views on catalog tables to apply restrictions.

COPY_TABLE_PROPERTIES Procedure

This procedure copies properties from one table to another, including optional column properties.

GRANT_TO_RECIPIENT Procedure

REVOKE_FROM_RECIPIENT Procedure

These procedures manage access permissions for catalog recipients.

Event Logging

Subprogram Description

CLEAR_CATALOG_EVENTS Procedure

This procedure clears the events from the catalog event log within a time range.

Iceberg-Specific Management

Subprogram Description

CREATE_ICEBERG_TABLE Procedure

This procedure creates a new Iceberg table within a specified schema in a catalog.

ADD_ICEBERG_SNAPSHOT Procedure

This procedure adds a snapshot to an Iceberg table to represent data changes with detailed metadata.

MOUNT_DB_LINK Procedure

This procedure mounts an external catalog based on a database link.

Syntax

PROCEDURE mount_db_link
(
  catalog_name 	IN VARCHAR2,
  db_link 		IN VARCHAR2,
  enabled 		IN BOOLEAN := TRUE
);

Parameters

Parameter Description

catalog_name

The name of the new catalog. This will be converted to uppercase.

db_link

The database link to use for mounting the catalog.

enabled

Indicates if the catalog is enabled for search. Defaults to TRUE.

MOUNT_SHARES Procedure

This procedure mounts multiple catalogs based on shares from a share provider.

Syntax

PROCEDURE mount_shares
(
  share_provider 		IN VARCHAR2,
  shares 				IN SYS.JSON_ARRAY_T,
  created_catalogs 		IN OUT NOCOPY SYS.JSON_ARRAY_T,
  share_provider_owner 	IN VARCHAR2 := NULL
);

Parameters

Parameter Description

share_provider:

The name of the share provider.

shares

A JSON array defining the list of shares to mount. Each element specifies properties like shareName, required, shareNameRule, catalogName, skipExisting, placeholder, and enabled.

created_catalogs

A JSON array of newly created catalogs, returned as output with properties like shareName and catalogName.

share_provider_owner

The owner of the share provider. Defaults to the current catalog if NULL.

Syntax of Second Procedure

PROCEDURE mount_shares
(
  share_provider 		IN VARCHAR2,
  shares 				IN SYS.JSON_ARRAY_T,
  share_provider_owner 	IN VARCHAR2 := NULL
);

Syntax of Third Procedure

PROCEDURE mount_shares
(
  share_provider 		IN VARCHAR2,
  shares 				IN CLOB := '[{shareName:"%"}]',
  share_provider_owner 	IN VARCHAR2 := NULL
);

Parameters of the Second Procedure

Parameters are Identical to Procedure 1, except without created_catalogs.

Parameters of the Third Procedure

Parameters are Identical to Signature 1, except shares is a CLOB with a default value that includes all shares.

Example

/****************** Share Catalog ******************/
BEGIN
  -- Create a share provider
  dbms_share.create_or_replace_share_provider(
    provider_name        => 'MY_SHARE_PROVIDER',
    endpoint             => 'https://...');
  dbms_cloud.create_credential(
    credential_name      => 'SHARE_PROVIDER_CREDENTIAL', ...);
  dbms_share.set_share_provider_credential(
    provider_name        => 'MY_SHARE_PROVIDER',
    share_credential     => 'SHARE_PROVIDER_CREDENTIAL');

  -- Mount shares as catalogs
  dbms_catalog.mount_shares(
    share_provider       => 'MY_SHARE_PROVIDER');
END;
/

MOUNT_SHARE Procedure

This procedure mounts a catalog based on a single share.

Syntax

PROCEDURE mount_share
(
  catalog_name 				IN VARCHAR2,
  share_provider 			IN VARCHAR2,
  share_name 				IN VARCHAR2,
  share_provider_owner 		IN VARCHAR2 := NULL,
  enabled 					IN BOOLEAN := TRUE
);

Parameters

Parameter Description

catalog_name

The name of the new catalog. This will be converted to uppercase.

share_provider

The name of the share provider.

share_name

The name of the share to mount.

share_provider_owner

The owner of the share provider. Defaults to the current catalog if NULL.

enabled

Indicates if the catalog is enabled for search. Defaults to TRUE.

Example

/****************** Share Catalog ******************/
BEGIN
  -- Create a share provider
  dbms_share.create_or_replace_share_provider(
    provider_name        => 'MY_SHARE_PROVIDER',
    endpoint             => 'https://...');
  dbms_cloud.create_credential(
    credential_name      => 'SHARE_PROVIDER_CREDENTIAL', ...);
  dbms_share.set_share_provider_credential(
    provider_name        => 'MY_SHARE_PROVIDER',
    share_credential     => 'SHARE_PROVIDER_CREDENTIAL');

  -- Mount a share catalog
  dbms_catalog.mount_share(
    catalog_name         => 'SHARE_CAT',
    share_provider       => 'MY_SHARE_PROVIDER',
    share_name           => 'MY_SHARE_1');
END;
/

MOUNT_VIRTUAL_CATALOG Procedure

This procedure creates and mounts a new virtual catalog.

Syntax

PROCEDURE mount_virtual_catalog
(
  catalog_name 	IN VARCHAR2,
  enabled 		IN BOOLEAN := TRUE
);

Parameters

Parameter Description

catalog_name

The name of the new catalog. This will be converted to uppercase.

enabled

Indicates if the catalog is enabled for search. Defaults to TRUE.

MOUNT_DATA_CATALOG Procedure

This procedure mounts a data catalog (e.g., AWS GLUE or OCI Data Catalog).

Syntax

PROCEDURE mount_data_catalog
(
  catalog_name 				IN VARCHAR2,
  data_catalog_type 		IN VARCHAR2,
  data_catalog_region 		IN VARCHAR2,
  data_catalog_credential 	IN VARCHAR2,
  data_catalog_id 			IN VARCHAR2 := NULL,
  data_storage_credential 	IN VARCHAR2 := NULL,
  enabled 					IN BOOLEAN := TRUE
);

Parameters

Parameter Description

catalog_name

The name of the new catalog. This will be converted to uppercase.

data_catalog_type

Type of data catalog (e.g., OCI_DCAT or AWS_GLUE).

data_catalog_region

The cloud resource region of the data catalog.

data_catalog_credential

The local credential used to access the data catalog.

data_catalog_id

The data catalog name or identifier. Defaults to NULL.

data_storage_credential

It specifies the local credential for data access. Defaults to NULL. This field is optional.

enabled

Indicates if the catalog is enabled for search. Defaults to TRUE.

Example

/****************** Glue Catalog ******************/
BEGIN
  -- Create a credential capable of accessing a glue catalog
  dbms_cloud.create_credential('GLUE_CATALOG_CREDENTIAL', ...); 

  -- Mount a glue catalog
  dbms_catalog.mount_data_catalog(
    catalog_name             => 'GLUE_CAT',
    data_catalog_type        => 'AWS_GLUE',
    data_catalog_region      => 'us-east-1', 
    data_catalog_credential  => 'GLUE_CATALOG_CREDENTIAL');
END;
/

MOUNT_ICEBERG Procedure

This procedure mounts an Iceberg catalog.

Syntax

See Iceberg REST Catalog Spec for more information on Iceberg Catalog.

PROCEDURE mount_iceberg
(
  catalog_name 				IN VARCHAR2,
  endpoint 					IN VARCHAR2,
  catalog_credential 		IN VARCHAR2,
  data_storage_credential 	IN VARCHAR2,
  configuration 			IN SYS.JSON_OBJECT_T := NULL,
  enabled 					IN BOOLEAN := TRUE,
  catalog_type 				IN VARCHAR2 := 'ICEBERG_GENERIC'
);

Parameters

Parameter Description

catalog_name

The name of the new catalog. This will be converted to uppercase.

endpoint

The Iceberg base server URL.

catalog_credential

The credential used to access the Iceberg catalog.

data_storage_credential

The credential used to access the data.

configuration

This describes the catalog configuration as a JSON object.

The following are supported configurations:
  • namespacePath: Defaults to NULL.
  • namespaceSeparator: Defaults to dot (.) for Unity, %1F for other Iceberg catalogs.
  • isCaseSensitive: Defaults to FALSE for Unity, TRUE for other Iceberg catalogs)
  • isPublicCatalog: Defaults to FALSE.
  • bucketRegion: Defaults to NULL. It is relevant only if the catalog uses S3 storage.
enabled

This indicates if the catalog is enabled for search. Defaults to TRUE.

catalog_type

Type of Iceberg catalog (e.g., ICEBERG_GENERIC, ICEBERG_POLARIS, ICEBERG_UNITY). Defaults to ICEBERG_GENERIC.

Example

/****************** Iceberg Catalog - Unity ******************/
DECLARE
  config      JSON_OBJECT_T := JSON_OBJECT_T();
BEGIN
  -- Create a credential capable of accessing an external iceberg REST catalog
  dbms_share.create_bearer_token_credential(
    credential_name => 'ICEBERG_CATALOG_CREDENTIAL',
    token_endpoint => 'https://.../v1/tokens',
    client_id => ...,
    client_secret => ...,
    token_scope => 'all-apis');

  -- Create a credential capable of accessing the bucket where the 
  -- iceberg data files are stored.
  dbms_cloud.create_credential('ICEBERG_STORAGE_CRED', ...); 

  -- Mount a iceberg catalog
  config.put('namespacePath', 'sales_catalog');
  dbms_catalog.mount_iceberg(
    catalog_name             => 'ICEBERG_CAT',
    endpoint                 => 'https://...//api/2.1/unity-catalog/iceberg/v1',
    catalog_credential       => 'ICEBERG_CATALOG_CREDENTIAL',
    data_storage_credential  => 'ICEBERG_STORAGE_CRED',
    configuration            => config,
    catalog_type             => 'ICEBERG_UNITY');
END;
/

/****************** Iceberg Catalog - Polaris ******************/
DECLARE
  config      JSON_OBJECT_T := JSON_OBJECT_T();
BEGIN
  -- Create a credential capable of accessing an external iceberg REST catalog
  dbms_share.create_bearer_token_credential(
    credential_name => 'ICEBERG_CATALOG_CREDENTIAL',
    token_endpoint => 'https://.../v1/oauth/tokens',
    client_id => ...,
    client_secret => ...,
    token_scope => 'PRINCIPAL_ROLE:ALL');

  -- Create a credential capable of accessing the bucket where the 
  -- iceberg data files are stored.
  dbms_cloud.create_credential('ICEBERG_STORAGE_CRED', ...); 

  -- Mount a iceberg catalog
  config.put('namespacePath', 'sales_catalog');
  dbms_catalog.mount_iceberg(
    catalog_name             => 'ICEBERG_CAT',
    endpoint                 => 'https://.../polaris/api/catalog/v1',
    catalog_credential       => 'ICEBERG_CATALOG_CREDENTIAL',
    data_storage_credential  => 'ICEBERG_STORAGE_CRED',
    configuration            => config,
    catalog_type             => 'ICEBERG_POLARIS');
END;
/

UNMOUNT Procedure

This procedure unmounts an external catalog.

Syntax

PROCEDURE unmount
(
  catalog_name IN VARCHAR2
);

Parameters

Parameter Description

catalog_name

The name of an existing catalog to unmount. This will be converted to uppercase.

GET_CATALOG_PROPERTY Procedure

This procedure returns the value of a property for a catalog.

Syntax

FUNCTION get_catalog_property
(
  catalog_name 		IN VARCHAR2,
  catalog_property 	IN VARCHAR2
)
RETURN VARCHAR2;

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

catalog_property

This describes the the property to be retrieved.(for example, PROP_CACHE_DURATION, PROP_IS_ENABLED).

The value can be any of the following constants:
  • PROP_CACHE_ASYNC
  • PROP_CACHE_DURATION
  • PROP_CACHE_ENABLED
  • PROP_CONFIGURATION
  • PROP_CUSTOM
  • PROP_DCAT_TYPE
  • PROP_DEFAULT_SCHEMA
  • PROP_IS_ENABLED
  • PROP_METADATA

See Catalog Types and Constants for more information.

GET_CATALOG_PROPERTY_CLOB Procedure

This procedure returns the value of a property for a catalog in CLOB format.

Syntax

FUNCTION get_catalog_property_clob
(
  catalog_name 		IN VARCHAR2,
  catalog_property 	IN VARCHAR2
)
RETURN CLOB;

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

catalog_property

This describes the the property to be retrieved (for example, PROP_CACHE_DURATION, PROP_IS_ENABLED).

The value can be any of the following constants:
  • PROP_CACHE_ASYNC
  • PROP_CACHE_DURATION
  • PROP_CACHE_ENABLED
  • PROP_CONFIGURATION
  • PROP_CUSTOM
  • PROP_DCAT_TYPE
  • PROP_DEFAULT_SCHEMA
  • PROP_IS_ENABLED
  • PROP_METADATA

See Catalog Types and Constants for more information.

UPDATE_CATALOG_PROPERTY Procedure

This procedure updates the value of a property for a catalog.

Syntax

PROCEDURE update_catalog_property
(
  catalog_name 		IN VARCHAR2,
  catalog_property 	IN VARCHAR2,
  new_value 		IN VARCHAR2
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

catalog_property

This describes the property to be updated (for example, PROP_CACHE_DURATION, PROP_IS_ENABLED).

The value can be any of the following constants:
  • PROP_CACHE_ASYNC
  • PROP_CACHE_DURATION
  • PROP_CACHE_ENABLED
  • PROP_CONFIGURATION
  • PROP_CUSTOM
  • PROP_DEFAULT_SCHEMA
  • PROP_IS_ENABLED
  • PROP_METADATA

See Catalog Types and Constants for more information.

new_value

The new property value.

UPDATE_CATALOG_PROPERTY_CLOB Procedure

This procedure updates the value of a property for a catalog in CLOB.

Syntax

PROCEDURE update_catalog_property_clob
(
  catalog_name 		IN VARCHAR2,
  catalog_property 	IN VARCHAR2,
  new_value 		IN CLOB
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

catalog_property

This describes the the property to be retrieved (for example, PROP_CACHE_DURATION, PROP_IS_ENABLED).

new_value

The new property value in CLOB.

UPDATE_TABLE_PROPERTY_CLOB Procedure

Updates the value of a table property using a Character Large Object (CLOB) data type.

Syntax

PROCEDURE UPDATE_TABLE_PROPERTY_CLOB
(
  catalog_name                   IN VARCHAR2,
  schema_name                    IN VARCHAR2,
  table_name                     IN VARCHAR2,
  table_property                 IN VARCHAR2,
  new_value                      IN CLOB,
  push_to_source                 IN BOOLEAN := FALSE
);

Parameters

Parameter Description

catalog_name

Name of the source catalog. The value is in uppercase.

schema_name

Name of the source catalog schema.

table_name

Name of the source catalog table.

table_property

The table property to update.

new_value

Assigns a new value in CLOB format.

push_to_source

Indicates whether to push the property update to source object annotations.

The default is FALSE.

GET_SCHEMA_PROPERTY Procedure

This procedure returns the value of a property for a schema.

Syntax

FUNCTION get_schema_property
(
  catalog_name 		IN VARCHAR2,
  schema_name 		IN VARCHAR2,
  schema_property 	IN VARCHAR2
)

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

The name of the schema.

schema_property

This describes the property to be retrieved (for example, PROP_CUSTOM, PROP_METADATA).

GET_SCHEMA_PROPERTY_CLOB Procedure

This procedure returns the value of a property for a schema in CLOB format.

Syntax

FUNCTION get_schema_property_clob
(
  catalog_name 		IN VARCHAR2,
  schema_name 		IN VARCHAR2,
  schema_property 	IN VARCHAR2
)
RETURN CLOB;

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

The name of the schema.

schema_property

This describes the property to be retrieved (for example, PROP_CUSTOM, PROP_METADATA).

UPDATE_SCHEMA_PROPERTY Procedure

This procedure returns the value of a property for a schema.

Syntax

PROCEDURE update_schema_property
(
  catalog_name 		IN VARCHAR2,
  schema_name 		IN VARCHAR2,
  schema_property 	IN VARCHAR2,
  new_value 		IN VARCHAR2
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

The name of the schema.

schema_property

This describes the property to be retrieved (for example, PROP_CUSTOM, PROP_METADATA).

new_value

The new property value.

GET_TABLE_PROPERTY Procedure

Returns the value of a property for a table.

Syntax

FUNCTION GET_TABLE_PROPERTY
(
  catalog_name                   IN VARCHAR2,
  schema_name                    IN VARCHAR2,
  table_name                     IN VARCHAR2,
  table_property                 IN VARCHAR2
)
RETURN VARCHAR2;

Parameters

Parameter Description

catalog_name

Name of the source catalog. The value is in uppercase.

schema_name

Name of the source catalog schema.

table_name

Name of the source catalog table.

table_property

The property to retrieve.

GET_TABLE_PROPERTY_CLOB Procedure

This procedure returns the value of a property for a table in CLOB format.

Syntax

FUNCTION get_table_property_clob
(
  catalog_name 		IN VARCHAR2,
  schema_name 		IN VARCHAR2,
  table_name 		IN VARCHAR2,
  table_property 	IN VARCHAR2
)
RETURN CLOB;

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

The name of the schema.

table_name

The name of the table.

table_property

The property to update (e.g., PROP_CUSTOM).

UPDATE_TABLE_PROPERTY Procedure

This procedure updates the value of a property for a table.

Syntax

PROCEDURE update_table_property
(
  catalog_name 		IN VARCHAR2,
  schema_name 		IN VARCHAR2,
  table_name 		IN VARCHAR2,
  table_property 	IN VARCHAR2,
  new_value 		IN VARCHAR2
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

The name of the schema.

table_name

The name of the table.

table_property

The property to update.

new_value

The new property value.

UPDATE_TABLE_PROPERTY_CLOB Procedure

Updates the value of a table property using a Character Large Object (CLOB) data type.

Syntax

PROCEDURE UPDATE_TABLE_PROPERTY_CLOB
(
  catalog_name                   IN VARCHAR2,
  schema_name                    IN VARCHAR2,
  table_name                     IN VARCHAR2,
  table_property                 IN VARCHAR2,
  new_value                      IN CLOB,
  push_to_source                 IN BOOLEAN := FALSE
);

Parameters

Parameter Description

catalog_name

Name of the source catalog. The value is in uppercase.

schema_name

Name of the source catalog schema.

table_name

Name of the source catalog table.

table_property

The table property to update.

new_value

Assigns a new value in CLOB format.

push_to_source

Indicates whether to push the property update to source object annotations.

The default is FALSE.

ADD_REQUIRED_CREDENTIAL Procedure

Defines a credential required for using the catalog.

Syntax

PROCEDURE ADD_REQUIRED_CREDENTIAL
(
  catalog_name                   IN VARCHAR2,
  required_credential            IN VARCHAR2,
  local_credential               IN VARCHAR2 := NULL,
  credential_type                IN VARCHAR2 := NULL
);

Parameters

Parameter Description

catalog_name

Name of the source catalog. The value is in uppercase.

required_credential

The name of the required credential.

local_credential

It is an optional local credential to use.

The default is NULL.

credential_type

Optional

This parameter specifies the type of authentication mechanism being used to access external services, such as object storage or other databases. For example, oci, aws, azure or a slack_credential.

See Catalog Types and Constants for more information.

REMOVE_REQUIRED_CREDENTIAL Procedure

This procedure removes a required credential from a catalog.

Syntax

PROCEDURE remove_required_credential
(
  catalog_name 			IN VARCHAR2,
  required_credential 	IN VARCHAR2
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

required_credential

The name of the required credential to remove.

RENAME_REQUIRED_CREDENTIAL Procedure

This procedure renames a required credential from a catalog.

Syntax

PROCEDURE rename_required_credential
(
  catalog_name 			IN VARCHAR2,
  old_credential_name 	IN VARCHAR2,
  new_credential_name 	IN VARCHAR2
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

old_credential_name

The old name of the required credential.

new_credential_name

The new name of the required credential.

UPDATE_REQUIRED_CREDENTIAL_PROPERTY Procedure

This procedure updates a property of a named required credential.

Syntax

PROCEDURE update_required_credential_property
(
  catalog_name 			IN VARCHAR2,
  required_credential 	IN VARCHAR2,
  credential_property 	IN VARCHAR2,
  new_value 			IN VARCHAR2
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

required_credential

The name of the required credential.

credential_property

The property name (e.g., PROP_REQUIRED_CREDENTIAL_DESCRIPTION, PROP_REQUIRED_CREDENTIAL_VAULT_SECRET).

new_value

The new value for the property.

GET_REQUIRED_CREDENTIAL_PROPERTY Procedure

This procedure retrieves a property of a named required credential.

Syntax

FUNCTION get_required_credential_property
(
  catalog_name 			IN VARCHAR2,
  required_credential 	IN VARCHAR2,
  credential_property 	IN VARCHAR2
)
RETURN VARCHAR2;

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

required_credential

The name of the required credential.

credential_property

The property name (e.g., PROP_REQUIRED_CREDENTIAL_DESCRIPTION, PROP_REQUIRED_CREDENTIAL_VAULT_SECRET).

SET_LOCAL_CREDENTIAL Procedure

This procedure specifies a local credential to use when consuming a catalog.

Syntax

PROCEDURE set_local_credential
(
  catalog_name 			IN VARCHAR2,
  required_credential 	IN VARCHAR2,
  local_credential 		IN VARCHAR2
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

required_credential

The name of the required credential.

local_credential

The credential to use.

GET_LOCAL_CREDENTIAL_MAP (Overloaded) Procedure

This procedure retrieves a map of required credentials to local credentials.

Syntax 1

PROCEDURE get_local_credential_map
(
  catalog_name 		IN VARCHAR2,
  credential_map 	OUT NOCOPY credential_info_map
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

credential_map

The populated map of credentials.

Syntax 2

FUNCTION get_local_credential_map
(
  catalog_name 	IN VARCHAR2,
  show_errors 	IN NUMBER := 0,
  pretty_json 	IN NUMBER := 0
)
RETURN CLOB;

Parameters

Parameter Description

catalog_name

The name of the existing catalog.

show_errors

This displays error messages for invalid local credentials. Defaults to 0.

pretty_json

Format the JSON with the PRETTY option. Defaults to 0.

Syntax 3

PROCEDURE get_local_credential_map
(
  catalog_id 		IN NUMBER,
  credential_map 	OUT NOCOPY SYS.JSON_OBJECT_T
);

Parameters

Parameter Description

catalog_id

The ID of an existing catalog from the CATALOG_ID column in ALL_MOUNTED_CATALOGS.

credential_map

The populated map as a JSON object.

CREATE_CLOUD_STORAGE_LINK Procedure

This procedure creates a cloud storage link in a catalog.

Syntax

PROCEDURE create_cloud_storage_link
(
  catalog_name 			IN VARCHAR2,
  schema_name 			IN VARCHAR2,
  storage_link_name 	IN VARCHAR2,
  uri 					IN VARCHAR2,
  required_credential 	IN VARCHAR2 := NULL,
  enabled 				IN BOOLEAN := TRUE,
  replace_if_exists 	IN BOOLEAN := FALSE
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name:

The schema name.

storage_link_name

The storage link name.

uri

The bucket URI.

required_credential

The required credential (or NULL for public buckets).

Defaults to NULL.

enabled

Indicates if the storage link is enabled for search. Defaults to TRUE.

replace_if_exists

Replace the link if it already exists. Defaults to FALSE.

DROP_CLOUD_STORAGE_LINK Procedure

This procedure drops a cloud storage link from a catalog.

Syntax

PROCEDURE drop_cloud_storage_link
(
  catalog_name 		IN VARCHAR2,
  schema_name 		IN VARCHAR2,
  storage_link_name IN VARCHAR2
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name:

The schema name.

storage_link_name

The storage link name.

CREATE_EXTERNAL_TABLE Procedure

Creates an external table in a catalog.

Syntax

PROCEDURE CREATE_EXTERNAL_TABLE
(
  catalog_name                   IN VARCHAR2,
  schema_name                    IN VARCHAR2,
  table_name                     IN VARCHAR2,
  storage_link_name              IN VARCHAR2 := NULL,
  file_uri_list                  IN CLOB,
  column_list                    IN CLOB := NULL,
  field_list                     IN CLOB := NULL,
  table_format                   IN CLOB := NULL,
  credential_name                IN VARCHAR2 := NULL,
  replace_if_exists              IN BOOLEAN := FALSE
);

Parameters

Parameter Description

catalog_name

Name of the source catalog. The value is in uppercase.

schema_name

Name of the source catalog schema.

table_name

Name of the source catalog table.

storage_link_name

(Optional)

Name of the cloud storage link.

The default is NULL.

file_uri_list

The relative file list as a CLOB.

column_list

(Optional)

Column list.

The default is NULL.

field_list

(Optional)

Field list.

The default is NULL.

table_format

(Optional)

The format or options for reading external files, for example, CSV, Parquet or Avro, delimiters, headers, schema derivation settings, and so on). It is expressed as JSON key-value pairs.

The default is NULL.

credential_name

Name of the credential.

The default is NULL.

replace_if_exists

Indicates whether to replace an object if it already exists.

The default is FALSE.

DROP_SCHEMA Procedure

This procedure drops a schema from a catalog along with all its contents.

Syntax

PROCEDURE drop_schema
(
  catalog_name 	IN VARCHAR2,
  schema_name 	IN VARCHAR2
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name:

The schema name to drop.

DROP_TABLE Procedure

This procedure drops a table from a catalog.

Syntax

PROCEDURE drop_table
(
  catalog_name 	IN VARCHAR2,
  schema_name 	IN VARCHAR2,
  table_name 	IN VARCHAR2
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

The schema name.

table_name

The table name.

CREATE_SCHEMA Procedure

Creates a new schema in a catalog. You can also create Apache Iceberg schema in remote catalogs.

Syntax

PROCEDURE CREATE_SCHEMA
(
  catalog_name          IN VARCHAR2,
  schema_name           IN VARCHAR2,
  schema_definition     IN CLOB := NULL
);

Parameters

Parameter Description

catalog_name

Name of the source catalog. The value is in uppercase.

schema_name

Name of the source catalog schema.

schema_definition

(Optional)

Schema definition payload.

The default is NULL.

GET_TABLES Procedure

This procedure fetches all tables for a catalog.

Syntax

FUNCTION get_tables
(
  catalog_name 		IN VARCHAR2,
  schema_name 		IN VARCHAR2 := NULL,
  table_name 		IN VARCHAR2 := NULL,
  conditions 		IN VARCHAR2 := NULL,
  flags 			IN NUMBER := 0,
  result_limit 		IN NUMBER := NULL,
  column_flags 		IN NUMBER := 0
)
RETURN catalog_tables PIPELINED;

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

Optional schema name. Defaults to NULL.

table_name

Optional table name. Defaults to NULL.

conditions

Optional additional conditions using lineage syntax. Defaults to NULL.

result_limit

Optional result limit. Defaults to NULL.

column_flags

Optional column flags (e.g., FETCH_PROPERTIES, FETCH_METADATA). Defaults to 0.

Note:

  • RECORD types describe structured data with named fields in databases.

  • You have to query the database's information schema, system catalogs, or use database introspection tools to see the structure of RECORD types.

GET_SCHEMAS Procedure

This procedure fetches all schemas for a catalog.

Syntax

FUNCTION get_schemas
(
  catalog_name 	IN VARCHAR2,
  schema_name 	IN VARCHAR2 := NULL,
  conditions 	IN VARCHAR2 := NULL,
  flags 		IN NUMBER := 0,
  result_limit 	IN NUMBER := NULL,
  column_flags 	IN NUMBER := 0
)
RETURN catalog_schemas PIPELINED;

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

Optional schema name. Defaults to NULL.

conditions

Optional additional conditions using lineage syntax. Defaults to NULL.

result_limit

Optional result limit. Defaults to NULL.

column_flags

Optional column flags (e.g., FETCH_PROPERTIES, FETCH_METADATA). Defaults to 0.

GET_OBJECTS Procedure

This procedure fetches all objects for a catalog.

Syntax

FUNCTION get_objects
(
  catalog_name 	IN VARCHAR2,
  schema_name 	IN VARCHAR2 := NULL,
  object_name 	IN VARCHAR2 := NULL,
  conditions 	IN VARCHAR2 := NULL,
  flags 		IN NUMBER := 0,
  result_limit 	IN NUMBER := NULL
)
RETURN catalog_objects PIPELINED;

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

Optional schema name. Defaults to NULL.

object_name

Optional object name. Defaults to NULL.

conditions

Optional additional conditions using lineage syntax. Defaults to NULL.

result_limit

Optional result limit. Defaults to NULL.

GENERATE_TABLE_SELECT (Overloaded) Procedure

This procedure generates a SELECT statement for a logical table.

Syntax

PROCEDURE generate_table_select
(
  catalog_name 		IN VARCHAR2,
  schema_name 		IN VARCHAR2,
  table_name 		IN VARCHAR2,
  stmt 				IN OUT NOCOPY CLOB,
  options 			IN CLOB := NULL,
  prev_gen_sql 		IN CLOB := NULL,
  prev_ts 			IN TIMESTAMP WITH TIME ZONE := NULL
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

The schema name.

table_name

The table name.

stmt

The generated SELECT statement as output.

options

Generation options as a JSON object (e.g., distinct, rowLimit, select, orderBy). Defaults to NULL.

prev_gen_sql

The previously generated SELECT statement, if known. Defaults to NULL.

prev_ts

The previous generation timestamp, if known. Defaults to NULL.

Syntax

FUNCTION generate_table_select
(
  catalog_name 	IN VARCHAR2,
  schema_name 	IN VARCHAR2,
  table_name 	IN VARCHAR2,
  options 		IN CLOB := NULL,
  prev_gen_sql 	IN CLOB := NULL,
  prev_ts 		IN TIMESTAMP WITH TIME ZONE := NULL
)
RETURN CLOB;

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

The schema name.

table_name

The table name.

stmt

The generated SELECT statement as output.

options

Generation options as a JSON object (e.g., distinct, rowLimit, select, orderBy). Defaults to NULL.

prev_gen_sql

The previously generated SELECT statement, if known. Defaults to NULL.

prev_ts

The previous generation timestamp, if known. Defaults to NULL.

OPEN_TABLE_CURSOR Procedure

This procedure opens a cursor that returns data from a logical table.

Syntax

PROCEDURE open_table_cursor
(
  catalog_name 	IN VARCHAR2,
  schema_name 	IN VARCHAR2,
  table_name 	IN VARCHAR2,
  table_cursor 	IN OUT NOCOPY SYS_REFCURSOR,
  options 		IN CLOB := NULL
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

Optional schema name. Defaults to NULL.

table_name

Optional table name. Defaults to NULL.

table_cursor

The cursor to return data.

options

Generates options as a JSON object (e.g., rowLimit, select, orderBy). Defaults to NULL.

FLUSH_CATALOG_CACHE Procedure

This procedure flushes the catalog metadata cache,

Syntax

PROCEDURE flush_catalog_cache
(
  catalog_name 	IN VARCHAR2,
  auto_commit	IN BOOLEAN := TRUE
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

auto_commit

Indicates if changes should be committed automatically. Defaults to TRUE.

PREFILL_CATALOG_CACHE Procedure

This procedure fills the cache for the specified catalog with current data.

Syntax

PROCEDURE prefill_catalog_cache
(
  catalog_name 	IN VARCHAR2,
  schema_name 	IN VARCHAR2 := NULL,
  auto_commit 	IN BOOLEAN := TRUE
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

The name of the schema.

auto_commit

Indicates if changes should be committed automatically. Defaults to TRUE.

CREATE_SYNCHRONIZED_SCHEMAS Procedure

This procedure creates local database schemas synchronized with remote catalog definitions.

Syntax

PROCEDURE create_synchronized_schemas
(
  catalog_name IN VARCHAR2,
  schema_names IN VARCHAR2 := NULL,
  restrictions IN CLOB := NULL
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

A comma-delimited list of schema names (quoted or unquoted). Defaults to NULL to synchronize all schemas.

restrictions

JSON document specifying the scope of catalog entities. Defaults to NULL.

DROP_SYNCHRONIZED_SCHEMAS Procedure

This procedure drops one or more synchronized schemas.

Syntax

PROCEDURE drop_synchronized_schemas
(
  catalog_name IN VARCHAR2,
  schema_names IN VARCHAR2 := NULL,
  restrictions IN CLOB := NULL
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

schema_name

A comma-delimited list of schema names (quoted or unquoted). Defaults to NULL to synchronize all schemas.

restrictions

JSON document specifying the scope of catalog entities. Defaults to NULL.

UPDATE_SYNCHRONIZED_SCHEMA_PROPERTY Procedure

This procedure updates a property of synchronized schemas.

Syntax

PROCEDURE update_synchronized_schema_property
(
  catalog_name 	IN VARCHAR2,
  property_name IN VARCHAR2,
  new_value 	IN CLOB
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

property_name

The property name to update.

new_value

The new value as a CLOB.

GRANT_TO_RECIPIENT Procedure

This procedure grants access on a catalog to a specific share recipient.

Syntax

PROCEDURE grant_to_recipient
(
  catalog_name 		IN VARCHAR2,
  recipient_name 	IN VARCHAR2
);

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

recipient_name

The name of the share recipient (created by DBMS_SHARE.CREATE_SHARE_RECIPIENT).

REVOKE_FROM_RECIPIENT Procedure

This procedure revokes access on a catalog from a specific recipient.

Syntax

PROCEDURE revoke_from_recipient
(
  catalog_name 		IN VARCHAR2,
  recipient_name 	IN VARCHAR2,
  owner 			IN VARCHAR2 := NULL
);	

Parameters

Parameter Description

catalog_name

The name of the existing catalog. This will be converted to uppercase.

recipient_name

The name of the share recipient (created by DBMS_SHARE.CREATE_SHARE_RECIPIENT).

owner

The owner of both catalog and recipient. Defaults to NULL.