Summary of DBMS_CLOUD_ADMIN Subprograms
This section covers the DBMS_CLOUD_ADMIN
subprograms provided with Autonomous Database.
Subprogram | Description |
---|---|
This procedure creates a database link to a target database in the
schema calling the API. You first need to upload the wallet
(cwallet.sso ) containing the certificates for the target
database using DBMS_CLOUD.GET_OBJECT and
then create the database link using the wallet.
|
|
This procedure disables database application continuity for the session associated with the specified service name in Autonomous Database. | |
This procedure drops a database link. | |
This procedure enables database application continuity for the session associated with the specified service name in Autonomous Database. | |
This procedure grants a storage quota to a
specified database user. When a tablespace quota
is granted to a user, Autonomous Database limits the storage space used by
that user to the specified quota. Using the value
UNLIMITED specifies unlimited
tablespace privilege.
|
CREATE_DATABASE_LINK Procedure
This procedure creates a database link to a target database in the
schema calling the API. You first need to upload the wallet
(cwallet.sso
) containing the certificates for the target database
using DBMS_CLOUD.GET_OBJECT
and then create the
database link using the wallet.
Syntax
DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK
(
db_link_name IN VARCHAR2,
hostname IN VARCHAR2,
port IN NUMBER,
service_name IN VARCHAR2,
ssl_server_cert_dn IN VARCHAR2,
credential_name IN VARCHAR2,
directory_name IN VARCHAR2 DEFAULT,
gateway_link IN BOOLEAN DEFAULT);
Parameters
Parameter | Description |
---|---|
|
The name of the database link to create. |
|
The hostname for the target database. |
port |
The port for the target database. To ensure security, ports are restricted
to: |
|
The
You can find the service names in the |
ssl_server_cert_dn |
The DN value found in the server certificate. |
credential_name |
The name of a stored credential created with |
directory_name |
The directory for the stored |
gateway_link |
Indicates if the database link is created to another Oracle Database or to an Oracle Database Gateway. If If The default value for this parameter is
|
Usage Notes
- Autonomous Database supports creating database links only if the target database is accessible through a public IP or public hostname, or using an Oracle Database Gateway.
-
To run
DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK
with a user other than ADMIN you need to grantEXECUTE
andCREATE DATABASE LINK
privileges to that user. For example, run the following command as ADMIN to grant privileges toadb_user
:GRANT EXECUTE ON DBMS_CLOUD_ADMIN TO adb_user; GRANT CREATE DATABASE LINK TO adb_user;
-
Only one wallet file is valid per directory specified with the
directory_name
parameter. You can only upload onecwallet.sso
at a time to the directory you choose for wallet files. This means with acwallet.sso
in a directory, you can only create database links to the databases for which the wallet in that directory is valid. To use multiplecwallet.sso
files with database links you need to create additional directories and put eachcwallet.sso
in a different directory.See Create Directory in Autonomous Database for information on creating directories.
-
To create a database link to an Autonomous Database, set
GLOBAL_NAMES
toFALSE
on the source database (non-Autonomous Database).SQL> ALTER SYSTEM SET GLOBAL_NAMES = FALSE; System altered. SQL> SHOW PARAMETER GLOBAL_NAMES NAME TYPE VALUE ---------------------- ----------- ----------- global_names boolean FALSE
Example
BEGIN
DBMS_CLOUD.CREATE_CREDENTIAL
(
credential_name => 'DB_LINK_CRED',
username => 'adb_user',
password => 'password');
DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK
(
db_link_name => 'SALESLINK',
hostname => 'adb.eu-frankfurt-1.oraclecloud.com',
port => '1522',
service_name => 'example_medium.adb.example.oraclecloud.com',
ssl_server_cert_dn => 'CN=adb.example.oraclecloud.com,OU=Oracle BMCS FRANKFURT,O=Oracle Corporation,L=Redwood City,ST=California,C=US',
credential_name => 'DB_LINK_CRED');
END;
/
DISABLE_APP_CONT Procedure
This procedure disables database application continuity for the session associated with the specified service name in Autonomous Database.
Syntax
DBMS_CLOUD_ADMIN.DISABLE_APP_CONT
(
service_name IN VARCHAR2);
Parameters
Parameter | Description |
---|---|
|
The
You can find the service names in the |
Usage Notes
See Overview of Application Continuity for more information on Application Continuity.
Example
BEGIN
DBMS_CLOUD_ADMIN.DISABLE_APP_CONT
(
service_name => 'nv123abc1_adb1_high.adb.oraclecloud.com' );
END;
/
Verify the value as follows:
SELECT name, failover_restore, drain_timeout FROM v$services;
NAME FAILOVER_RESTORE DRAIN_TIMEOUT
------------------------------------------------------- ----------------- -------------
nv123abc1_adb1_high.adb.oraclecloud.com NONE 0
DROP_DATABASE_LINK Procedure
This procedure drops a database link.
Syntax
DBMS_CLOUD_ADMIN.DROP_DATABASE_LINK
(
db_link_name IN VARCHAR2);
Parameters
Parameter | Description |
---|---|
|
The name of the database link to drop. |
Example
BEGIN
DBMS_CLOUD_ADMIN.DROP_DATABASE_LINK
(
db_link_name => 'SALESLINK' );
END;
/
Usage Notes
After you are done using a database link and you run DBMS_CLOUD_ADMIN.DROP_DATABASE_LINK
, to ensure security
of your Oracle database remove any stored wallet files. For example:
-
Remove the wallet file in Object Store.
-
Use
DBMS_CLOUD.DELETE_FILE
to remove the wallet file from thedata_pump_dir
directory or from the user defined directory where the wallet file was uploaded.
ENABLE_APP_CONT Procedure
This procedure enables database application continuity for the session associated with the specified service name in Autonomous Database.
Syntax
DBMS_CLOUD_ADMIN.ENABLE_APP_CONT
(
service_name IN VARCHAR2);
Parameters
Parameter | Description |
---|---|
|
The
You can find the service names in the |
Usage Notes
See Overview of Application Continuity for more information on Application Continuity.
Example
BEGIN
DBMS_CLOUD_ADMIN.ENABLE_APP_CONT
(
service_name => 'nvthp2ht_adb1_high.adb.oraclecloud.com'
);
END;
/
Verify the value as follows:
SELECT name, failover_restore, drain_timeout FROM v$services;
NAME FAILOVER_RESTORE DRAIN_TIMEOUT
------------------------------------------------------- ----------------- -------------
nvthp2ht_adb1_high.adb.oraclecloud.com LEVEL1 300
GRANT_TABLESPACE_QUOTA Procedure
This procedure grants a storage quota to a specified database user.
When a tablespace quota is granted to a user, Autonomous Database limits the storage space used by that user to the specified
quota. Using the value UNLIMITED
specifies unlimited tablespace
privilege.
Syntax
DBMS_CLOUD_ADMIN.GRANT_TABLESPACE_QUOTA
(
username IN VARCHAR2,
tablespace_quota IN VARCHAR2);
Parameters
Parameter | Description |
---|---|
|
The database username to grant the tablespace quota to. |
|
The quota to assign to the specified user in bytes. For kilobytes, megabytes,
gigabytes, and terabytes you can specify Alternatively you can specify |
Usage Notes
See System Privileges (Organized by the Database Object Operated Upon - TABLESPACE) for more information.
See Manage User Privileges on Autonomous Database - Connecting with a Client Tool for information on privileges granted with the role
DWROLE
.
Examples
BEGIN
DBMS_CLOUD_ADMIN.GRANT_TABLESPACE_QUOTA
(
username => 'ADBUSER',
tablespace_quota => '10G'
);
END;
/
BEGIN
DBMS_CLOUD_ADMIN.GRANT_TABLESPACE_QUOTA
(
username => 'ADBUSER',
tablespace_quota => 'UNLIMITED'
);
END;
/