Modify an attribute of a
credential created by CREATE_CREDENTIALS or
CREATE_BEARER_TOKEN_CREDENTIAL.
ASSERT_SHARING_ID Procedure Run basic validation checks against a sharing id and return one in canonical form. An exception is raised if the id is obviously invalid.
CREATE_CREDENTIALS Procedure and Function Create a credential containing the bearer token from a delta sharing profile. The standard type, version 1, specifies an endpoint and a single long term bearer token.
CREATE_SHARE_LINK Procedure Subscribe to share from a registered share provider. The available share names can be found by calling DISCOVER_AVAILABLE_SHARES.
ENABLE_DELTA_ENDPOINT Procedure Create necessary ACLs that allow the specified user to connect to a delta endpoint. Admin privileges are required for this procedure.
FLUSH_SHARE_LINK_CACHE Procedure Flush the cache of shares for a given share link. The list of shares for the remote endpoints is fetched instead of relying on cached values.
FLUSH_SHARE_PROVIDER_CACHE Procedure Flush the cache of shares for a given share provider. The list of shares for the remote endpoints is fetched instead of relying on cached values.
GET_SHARE_PROVIDER_INFO Procedure Get the endpoint string(s) and share type along with any additional JSON metadata for a share provider. For ORACLE share providers, the Oracle provider ID is returned in the endpoint argument.
GET_SHARING_ID Function Return an identifier that can be used as the sharing_id in the CREATE_SHARE_RECIPIENT procedure. This function can be used to share data between two users, the "provider" and the "recipient", in different databases.
REFRESH_BEARER_TOKEN_CREDENTIAL Procedure Update one or more credentials created by CREATE_BEARER_TOKEN_CREDENTIAL or CREATE_CREDENTIALS by calling the registered token endpoints and fetching new bearer tokens. Note this procedure is called automatically by a scheduler job, ADP$BEARER_REFRESH_JOB, that runs every 50 minutes.
Create a credential containing the bearer token from a delta sharing
profile. The standard type, version 1, specifies an endpoint and a single long term bearer
token.
Syntax
PROCEDURE CREATE_CREDENTIALS
(
credential_base_name IN VARCHAR2,
delta_profile IN CLOB,
out_credential_name IN OUT NOCOPY VARCHAR2
);
Below is the functional version of the
create_credentials that returns the name of the new credentials
in JSON form.
FUNCTION CREATE_CREDENTIALS
(
credential_base_name IN VARCHAR2,
delta_profile IN CLOB
)
RETURN CLOB;
Parameters
Parameter
Description
credential_base_name
The base name of
the credential(s) to create.
delta_profile
The delta sharing
profile, in JSON format, obtained from the share
provider.
Subscribe to share from a registered share provider.
Syntax
PROCEDURE CREATE_OR_REPLACE_SHARE_LINK
(
share_link_name IN VARCHAR2,
share_provider IN VARCHAR2,
share_name IN VARCHAR2,
provider_owner IN VARCHAR2 := NULL,
link_owner IN VARCHAR2 := NULL,
use_default_credential IN BOOLEAN := TRUE,
metadata IN SYS.JSON_OBJECT_T := NULL,
auto_commit IN BOOLEAN := TRUE
);
The owner of the
share provider. Defaults to the current schema.
link_owner
The owner of the
share link. Defaults to the current schema.
use_default_credential
If TRUE, use the
same credentials as the share provider.
metadata
Optional metadata
to associate with the share link.
auto_commit
If TRUE (the
default), this procedure call commits changes that are not visible
externally until the commit takes place. If FALSE, the user must
COMMIT after running this call in order to make the change
visible.
PROCEDURE CREATE_OR_REPLACE_CLOUD_STORAGE_LINK
(
storage_link_name IN VARCHAR2,
uri IN VARCHAR2,
owner IN VARCHAR2 := NULL,
metadata IN SYS.JSON_OBJECT_T := NULL,
auto_commit IN BOOLEAN := TRUE
);
Parameters
Parameter
Description
storage_link_name
The name of the
cloud storage link. The name of the link should follow standard
Oracle naming conventions. See Database Object Names and
Qualifiers
uri
The URI of the
storage bucket. The URI should be of the form
https://objectstorage.region.oraclecloud.com/n/namespace-string/b/bucket/o
owner
The owner of the
storage link. Defaults to the current schema.
metadata
An optional JSON
metadata document containing additional information.
auto_commit
If TRUE, the
changes automatically commit after creating the link. The default is
TRUE.
PROCEDURE CREATE_ORACLE_SHARE_PROVIDER
(
oracle_provider_id IN VARCHAR2,
provider_name IN VARCHAR2,
owner IN VARCHAR2 := NULL,
metadata IN SYS.JSON_OBJECT_T := NULL,
auto_commit IN BOOLEAN := TRUE
);
Parameters
Parameter
Description
oracle_provider_id
The provider ID
obtained from the
ALL_AVAILABLE_ORACLE_SHARE_PROVIDERS view.
Subscribe to share from a registered share provider. The available share
names can be found by calling DISCOVER_AVAILABLE_SHARES.
Syntax
PROCEDURE CREATE_SHARE_LINK
(
share_link_name IN VARCHAR2,
share_provider IN VARCHAR2,
share_name IN VARCHAR2,
provider_owner IN VARCHAR2 := NULL,
link_owner IN VARCHAR2 := NULL,
use_default_credential IN BOOLEAN := TRUE,
metadata IN SYS.JSON_OBJECT_T := NULL,
auto_commit IN BOOLEAN := TRUE
);
Parameters
Parameter
Description
share_link_name
The name of the
share link to create. This should follow standard Oracle naming
conventions and does not need to be the same as the
share_name parameter.
share_provider
The name of the
share provider, listed in ALL_SHARE_PROVIDERS, that
shared the data.
share_name
The name of the
share, as defined by the share provider.
provider_owner
The schema that
subscribed the share provider, as listed in
ALL_SHARE_PROVIDER. Leave as null to default to
the current user, which is typical.
link_owner
The owner of the new share link. Leave as null to default to the
current user, which is typical.
use_default_credential
Set to TRUE to use the same credential for both the share link
and the share provider.
metadata
Optional JSON metadata to associated with the share link.
auto_commit
If TRUE, the
changes automatically commit after creating the link. The default is
TRUE.
Create or replace a named view that gives access to a remote shared
table.
Syntax
PROCEDURE CREATE_SHARE_LINK_VIEW
(
view_name IN VARCHAR2,
share_link_name IN VARCHAR2,
share_schema_name IN VARCHAR2,
share_table_name IN VARCHAR2,
view_owner IN VARCHAR2 := NULL,
share_link_owner IN VARCHAR2 := NULL
);
PROCEDURE CREATE_SHARE_PROVIDER
(
provider_name IN VARCHAR2,
endpoint IN VARCHAR2,
token_endpoint IN VARCHAR2 := NULL,
share_type IN VARCHAR2 := 'DELTA',
owner IN VARCHAR2 := NULL,
metadata IN SYS.JSON_OBJECT_T := NULL,
auto_commit IN BOOLEAN := TRUE
);
Parameters
Parameter
Description
provider_name
The local name of
this share provider.
endpoint
The delta
endpoint, from the delta sharing profile.
token_endpoint
This parameter is
ignored.
share_type
The type of share
provider. Leave this as DELTA.
owner
The owner of the
share provider. Defaults to the current schema.
metadata
Optional JSON
metadata to associate with the share provider.
auto_commit
If TRUE (the
default), this procedure call commits changes that are not visible
externally until the commit takes place. If FALSE, the user must
COMMIT after running this call in order to make the change
visible.
Return one SHARE_AVAILABLE_SHARES_ROW for each available
table from the subscribed share providers.
Syntax
FUNCTION DISCOVER_AVAILABLE_SHARES
(
share_provider IN VARCHAR2,
owner IN VARCHAR2 := NULL
) RETURN share_available_shares_tbl PIPELINED;
Parameters
Parameter
Description
share_provider
The name of the
share provider.
owner
The owner of the
share provider. Defaults to the current schema.
Example: Discover a list of shares
available from a given provider
SQL> select available_share_name
2 from dbms_share.discover_available_shares('share_prov')
3 order by available_share_name;
AVAILABLE_SHARE_NAME
--------------------------------------------------------------------------------
BURLINGTON_EXPEDITION_2022
EGYPT_EXPEDITION_2022
Return one SHARE_AVAILABLE_TABLES_ROW for each available
table from the subscribed share providers.
Syntax
FUNCTION DISCOVER_AVAILABLE_TABLES
(
share_provider IN VARCHAR2 := NULL,
share_name IN VARCHAR2 := NULL,
owner IN VARCHAR2 := NULL,
endpoint IN VARCHAR2 := NULL,
credential_name IN VARCHAR2 := NULL
) RETURN share_available_tables_tbl PIPELINED;
Parameters
Parameter
Description
share_provider
An optional share
provider name. If NULL, search all subscribed share
providers.
share_name
An optional share
name. If NULL, search all discovered shares.
owner
The owner of the
share provider. Defaults to the current schema.
endpoint
An optional delta
endpoint.
credential_name
An optional
bearer token credential to access the endpoint.
Example: List shares available
from all subscribed share providers
SQL> select * from dbms_share.discover_available_tables()
2 order by share_name, schema_name, table_name;
PROVIDER_NAME PROVIDER_OWNER SHARE_NAME
------------------------- --------------- ------------------------------
SCHEMA_NAME TABLE_NAME
------------------------- -------------------------
My Test Oracle Provider ADP_SHARE_TEST BURLINGTON_EXPEDITION_2022
SH COUNTRIES
My Test Oracle Provider ADP_SHARE_TEST BURLINGTON_EXPEDITION_2022
SH SH_COUNTRIES
My Test Oracle Provider ADP_SHARE_TEST EGYPT_EXPEDITION_2022
SHARED_SCHEMA SHARED_VIEW_1
My Test Oracle Provider ADP_SHARE_TEST EGYPT_EXPEDITION_2022
SHARED_SCHEMA SHARED_VIEW_2
Example: List tables available from an unsubscribed endpoint
GENERATE_SHARE_LINK_SELECT Procedure and
Function 🔗
Generate a SELECT statement that returns data from a shared
table.
Syntax
Procedure version of GENERATE_SHARE_LINK_SELECT.
PROCEDURE GENERATE_SHARE_LINK_SELECT
(
share_link_name IN VARCHAR2,
share_schema_name IN VARCHAR2,
share_table_name IN VARCHAR2,
stmt IN OUT NOCOPY CLOB,
share_link_owner IN VARCHAR2 := NULL
);
Function version of
GENERATE_SHARE_LINK_SELECT.
FUNCTION GENERATE_SHARE_LINK_SELECT
(
share_link_name IN VARCHAR2,
share_schema_name IN VARCHAR2,
share_table_name IN VARCHAR2,
share_link_owner IN VARCHAR2 := NULL
)
RETURN CLOB;
Retrieve the cloud link name and namespace for an Oracle-to-Oracle
share.
Syntax
FUNCTION GET_ORACLE_SHARE_LINK_INFO
(
oracle_provider_id IN VARCHAR2,
share_name IN VARCHAR2,
share_schema_name IN VARCHAR2,
share_table_name IN VARCHAR2
)
RETURN CLOB;
Parameters
Parameter
Description
oracle_provider_id
The Oracle
Provider ID from
ALL_AVAILABLE_ORACLE_SHARE_PROVIDERS.
share_name
The name of a
share from
ALL_AVAILABLE_ORACLE_SHARE_PROVIDERS.SHARES.
share_schema_name
The name of a
share schema from
ALL_AVAILABLE_ORACLE_SHARE_PROVIDERS.SHARES.
share_table_name
The name of a
table from
ALL_AVAILABLE_ORACLE_SHARE_PROVIDERS.SHARES.
Return
The return value is a JSON object containing three properties: schema, table, and
dblink. The caller can use these three properties to fetch data using a query of the
following form:
Get the endpoint(s), share type and share name along with any additional
JSON metadata for a share link.
Syntax
PROCEDURE GET_SHARE_LINK_INFO
(
link_name IN VARCHAR2,
endpoint IN OUT NOCOPY VARCHAR2,
share_type IN OUT NOCOPY VARCHAR2,
share_name IN OUT NOCOPY VARCHAR2,
token_endpoint IN OUT NOCOPY VARCHAR2,
metadata IN OUT NOCOPY BLOB,
link_owner IN VARCHAR2 := NULL
);
Parameters
Parameter
Description
link_name
The name of a
share link (previously created by
CREATE_SHARE_LINK).
endpoint
OUT: The
endpoint, if any, associated with the share link.
share_type
OUT: The type of
share link (for example, DELTA).
share_name
OUT: The name of
the linked share.
token_endpoint
This parameter is
no longer used.
metadata
OUT: Optional
metadata associated with the share link.
link_owner
The owner of the
share link. Defaults to the current schema.
Get the credential name to be used by the current user when it attempts to
access the given delta share provider.
Syntax
PROCEDURE GET_SHARE_PROVIDER_CREDENTIAL
(
provider_name IN VARCHAR2,
share_credential IN OUT NOCOPY VARCHAR2,
get_token_credential IN OUT NOCOPY VARCHAR2,
owner IN VARCHAR2 := NULL
);
Parameters
Parameter
Description
provider_name
The name of the
share provider.
share_credential
OUT: The name of
the credential associated with the provider. The credential name is
returned without double quotes, as it would appear in the
CREDENTIAL_NAME column of the
USER_CREDENTIALS view.
Get the endpoint string(s) and share type along with any additional JSON
metadata for a share provider. For ORACLE share providers, the Oracle provider ID is
returned in the endpoint argument.
Syntax
PROCEDURE GET_SHARE_PROVIDER_INFO
(
provider_name IN VARCHAR2,
endpoint IN OUT NOCOPY VARCHAR2,
share_type IN OUT NOCOPY VARCHAR2,
token_endpoint IN OUT NOCOPY VARCHAR2,
metadata IN OUT NOCOPY BLOB,
owner IN VARCHAR2 := NULL
);
Parameters
Parameter
Description
provider_name
The name of the
share provider.
endpoint
The delta
endpoint.
share_type
The share type:
DELTA or ORACLE.
token_endpoint
This parameter is
not used.
metadata
The optional
metadata that was associated with the share provider.
owner
The owner of the
share provider. Defaults to the current schema.
Return an identifier that can be used as the sharing_id in
the CREATE_SHARE_RECIPIENT procedure. This function can be used to share
data between two users, the "provider" and the "recipient", in different
databases.
Open a cursor that returns data from a shared table.
Syntax
PROCEDURE OPEN_SHARE_LINK_CURSOR
(
share_link_name IN VARCHAR2,
share_schema_name IN VARCHAR2,
share_table_name IN VARCHAR2,
table_cursor IN OUT NOCOPY SYS_REFCURSOR,
share_link_owner IN VARCHAR2 := NULL
);
Update one or more credentials created by
CREATE_BEARER_TOKEN_CREDENTIAL or CREATE_CREDENTIALS
by calling the registered token endpoints and fetching new bearer tokens. Note this
procedure is called automatically by a scheduler job,
ADP$BEARER_REFRESH_JOB, that runs every 50 minutes.
Set the additional JSON metadata for the share link.
Syntax
PROCEDURE SET_SHARE_LINK_METADATA
(
link_name IN VARCHAR2,
metadata IN SYS.JSON_OBJECT_T,
replace_existing IN BOOLEAN := FALSE,
link_owner IN VARCHAR2 := NULL
);
Parameters
Parameter
Description
link_name
The name of the
share link.
metadata
The new
metadata.
replace_existing
If TRUE, then all
existing metadata is replaced by the new version. If FALSE, then the
new value is merged with any existing metadata.
link_owner
The owner of the
share link. Defaults to the current schema.
Set the credential name to be used by the current user when it attempts to
access the given share provider.
Syntax
PROCEDURE SET_SHARE_PROVIDER_CREDENTIAL
(
provider_name IN VARCHAR2,
share_credential IN VARCHAR2,
get_token_credential IN VARCHAR2 := NULL,
owner IN VARCHAR2 := NULL,
check_if_exists IN BOOLEAN := TRUE
);
Parameters
Parameter
Description
provider_name
The name of the
share provider.
share_credential
The bearer token
credential.
get_token_credential
This argument is
ignored.
owner
The owner of the
share provider. Defaults to the current schema.
check_if_exists
If TRUE
(default), then validate that the credential exists.
Set additional JSON metadata for the share provider.
Syntax
PROCEDURE SET_SHARE_PROVIDER_METADATA
(
provider_name IN VARCHAR2,
metadata IN SYS.JSON_OBJECT_T,
replace_existing IN BOOLEAN := FALSE,
owner IN VARCHAR2 := NULL
);
Parameters
Parameter
Description
provider_name
The name of the
share provider.
metadata
The new
metadata.
replace_existing
If TRUE, then all
existing metadata is replaced by the new version. If FALSE, the new
value is merged with any existing metadata.
owner
The owner of the
share provider. Defaults to the current schema.