...
Follow these steps to implement the ephemeral database configuration for your workflow.
1. Create ORCLCDB SYSOPER User
You must create a new user on oracle CDB with the following privileges to create an ephemeral copy.
Code Block |
---|
# Should be created on ORCLCDB
CREATE USER c##liquibase_ephemeral_user IDENTIFIED BY password;
GRANT CREATE SESSION TO c##liquibase_ephemeral_user CONTAINER=all;
GRANT CREATE PLUGGABLE DATABASE TO c##liquibase_ephemeral_user CONTAINER=all;
GRANT SYSOPER TO c##liquibase_ephemeral_user CONTAINER=all; |
...
Create an Ephemeral dbDef
An ephemeral dbDef must be created in the datical.project file to instruct Liquibase which database should be cloned for the ephemeral copy and to set the connection string information. Because this database is transient by definition and only exists during the Deploy Packager operation, it is not eligible on a Liquibase pipeline to have Status run against it.
...
BackupRestoreOracleEphemeralInternalPdb
Create ORCLCDB SYSOPER User
You must create a new user on oracle CDB with the following privileges to create an ephemeral copy.
Code Block |
---|
# Should be created on ORCLCDB
CREATE USER c##liquibase_ephemeral_user IDENTIFIED BY password;
GRANT CREATE SESSION TO c##liquibase_ephemeral_user CONTAINER=all;
GRANT CREATE PLUGGABLE DATABASE TO c##liquibase_ephemeral_user CONTAINER=all;
GRANT SYSOPER TO c##liquibase_ephemeral_user CONTAINER=all; |
Info |
---|
The user name must start with
|
BackupRestoreOracleEphemeralExternalPdb
Create ORCLCDB SYSOPER User
On the database A we will to create a new user on oracle CDB with the following privileges to be able to create an ephemeral copy
Code Block |
---|
-- connect as SYSDBA to a FIRST DB to create common user
CREATE USER c##liquibase_ephemeral_user_a IDENTIFIED BY password;
GRANT CREATE SESSION TO c##liquibase_ephemeral_user_a CONTAINER=all;
GRANT CREATE PLUGGABLE DATABASE TO c##liquibase_ephemeral_user_a CONTAINER=all;
GRANT SYSOPER TO c##liquibase_ephemeral_user_a CONTAINER=all; |
On the database B we will to create a new user on oracle CDB with the following privileges to be able to create an ephemeral copy and additionally create a link with database A
Code Block |
---|
-- connect as SYSDBA to a SECOND DB to create common user
CREATE USER c##liquibase_ephemeral_user_b IDENTIFIED BY password;
GRANT CREATE SESSION TO c##liquibase_ephemeral_user_b CONTAINER=all;
GRANT CREATE PLUGGABLE DATABASE TO c##liquibase_ephemeral_user_b CONTAINER=all;
GRANT SYSOPER TO c##liquibase_ephemeral_user_b CONTAINER=all;
--- you need to know hostname, port and service name of DB2 database instance
--- you need to know credetials for database user which has enough priviliges
--- to perform copy operation
CREATE PUBLIC DATABASE LINK liquibase_db_link
CONNECT TO c##liquibase_ephemeral_user_a IDENTIFIED BY password
USING '(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=172.18.0.2)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=ORCLCDB))
)'; |
Also there is a possibility to use TNS name during link creation, e.g.
Code Block |
---|
CREATE DATABASE LINK liquibase_db_link
CONNECT TO c##liquibase_ephemeral_user_a IDENTIFIED BY password
USING TNS_NAME; |
To check if database link has been created correctly please run query below, if you don’t get errors - database link is correct.
Code Block |
---|
SELECT * FROM dual@liquibase_db_link; |
If you would like to use another name for database link - please use oracleEphemeralDatabaseLinkName
packager property.
Info |
---|
Note regarding Oracle Managed Files (OMF): If using OMF with BackupRestoreOracleEphemeralExternalPdb then OMF mode should be the same on both instances of the Oracle database. |
...