Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Package Method Name

Description

BackupRestoreOracleEphemeralInternalPdb

This is the same container that holds the dbDef to be copied. Eg. if I want to use the DEV database, the cloned db will be created on the same container as the DEV database.
BackupRestoreOracleEphemeralExternalPdb

Info
This container

BackupRestoreOracleEphemeralInternalPdb is

different and separate from the cloned dbDef.
We strongly suggest you have the same Oracle versions if they want to use this method.

See: Use the Required deployPackager.properties File

1. Create ORCLCDB SYSOPER User

...

the faster and more reliable option. Usually it is 2.5 times faster, but it is important to take into account that BackupRestoreOracleEphemeralExternalPdb depends on the internet speed. BackupRestoreOracleEphemeralInternalPdb can be even faster if your internet speed becomes a bottle neck for BackupRestoreOracleEphemeralExternalPdb),We strongly recommend this option.

BackupRestoreOracleEphemeralExternalPdb

This container is different and separate from the cloned dbDef.

Info

If you are using OMF mode it should be same on both databases when the copy is made.

We strongly suggest you have the same Oracle versions if they want to use this method.

See: Use the Required deployPackager.properties File

1. Create ORCLCDB SYSOPER User

First you must decide if you are using the internal or external Ephemeral method. Once that is decided, you will create a user.

...

Internal user privileges:

Code Block
# Should be created on ORCLCDB
CREATE USER c##liquibase_ephemeral_user_source IDENTIFIED BY password;
GRANT CREATE SESSION TO c##liquibase_ephemeral_user_source CONTAINER=all;
GRANT CREATE PLUGGABLE DATABASE TO c##liquibase_ephemeral_user CONTAINER=all;
GRANT SYSOPER TO c##liquibase_ephemeral_user_source CONTAINER=all;

External user privileges:

On the external database we will create a new user on oracle CDB with the following privileges. This allows us to create an ephemeral copy and additionally create a link with the source database.

...

a link with the source database.

Code Block
CREATE USER c##liquibase_ephemeral_source IDENTIFIED BY password;
GRANT CREATE SESSION TO c##liquibase_ephemeral_source CONTAINER=all;
GRANT SYSOPER TO c##liquibase_ephemeral_source CONTAINER=all;
Info

The user name must start with c## to be a correct user type.

c##liquibase_ephemeral_user is just an example value, you can specify any name you would like. This is the user that connects to the ephemeral dbDef.

...

Learn more about traditional LDAP connections here: LDAP Connection to an Oracle Database

If you use TNS names in your dbDef, then you should prepare a TNS name with _eph postfix for the ephemeral copy . In most cases because we are not able to modify TNS files in most cases.

If this is what your dbDefs look like:

...

Then you will create the tnsnames.ora file that contains a dev alias for DEV DbDef, dev_eph alias, and admin_sysoper alias for DEV_EPHEMERAL DbDef_EPHEMERAL DbDef.

If you have a dev entry in your TNS file, then you should create an alias for the dev_eph entry which points to the ephemeral copy.

Example tnsnames.ora file:

...

Follow the instructions below based on the desired method.

Info

Important note for all external methods: If the source dbDef does NOT use TNS, then the ephemeral dbDef should also NOT use TNS. When we create a PDB copy in another database we need to retrieve the host and port to connect to it. If the ephemeral database uses TNS, then we don’t know where to connect to. If the source dbDef uses TNS, then the ephemeral dbDef can use anything. You also need to create a TNS entry with _eph postfix to be able to connect to it.

...

Property Name

Description

oracleEphemeralSourceName

[Optional] Defines a source name for an Oracle source PDB in the event Liquibase has not been granted the necessary permissions to query for this name.

Necessary permissions are included below. If these grants are not present, oracleEphemeralSourceName will be required.

  • Multi-schema projects: GRANT SELECT ANY DICTIONARY TO DATICAL_ROLE;

    Single schema projects Liquibase requires either:

  • GRANT SELECT ANY DICTIONARY TO DATICAL_SCHEMA_OWNER_ROLE;

  • Or GRANT SELECT ON DBA_SYS_PRIVS TO DATICAL_SCHEMA_OWNER_ROLE;, GRANT SELECT ON DBA_ROLE_PRIVS TO DATICAL_SCHEMA_OWNER_ROLE; and GRANT SELECT ON DBA_COL_PRIVS

    : GRANT SELECT ANY DICTIONARY TO DATICAL_ROLE;

  • Single schema projects Liquibase requires either:

    • GRANT SELECT ANY DICTIONARY TO DATICAL_SCHEMA_OWNER_ROLE;

    • ORpermission to query v$pdbs and dba_data_files

  • See Roles and Permissions for Liquibase Enterprise on Oracle Database for further information on permissions.

Property Validation: Source name should up to 30 characters long, contain no spaces [ ], slashes [/] and semicolons [;] and cannot begin with a number.

oracleEphemeralCopyName

[Optional] Defines a name for an Oracle copy PDB in the event the default name is not desired.

Default name for the ephemeral copy will be source PDB name with _eph postfix. For example, if source name is bucket_01, the copied bucket name will be bucket_01_eph.

Property Validation: Copy name should be up to 30 characters long, contain no spaces [ ], slashes [/] and semicolons [;] and cannot begin with a number.

oracleEphemeralDatabaseLinkName

[Optional] Defines a name for a database link which is used with PackageMethod BackupRestoreOracleEphemeralExternalPdb in the even the default name is not desired.

Default link name will be liquibase_db_link.

Property Validation: Database link name should up to 128 characters long, contain no spaces [ ], slashes [/] and semicolons [;] and cannot begin with a number.

oracleEphemeralCopyWithData

[Optional] By default Liquibase will copy databases without data. (*) If you would like to copy both the structure and data, use this boolean property.

(*) There is one exception in that the data from the DATABASECHANGELOG table is included in the database copy.

Property Validation: true/false

oracleEphemeralSkipFinalDeploy

[Optional] The default value for this setting is false. Any changes being packaged are deployed to the first database in the pipeline during the Deploy Packager operation.

Setting this value to true allows changes to be packaged and changesets to be created and stored in the changelog.xml, but the deployment to the first database in the pipeline does not occur.

Property Validation: true/false

...

Troubleshooting:

Potential grants issues

  • If oracleEphemeralSourceName packager property is not specified we try to get the PDB name from

...

  • 3 tables on the DB (v$pdbs and dba_data_files, or v$parameter). If you already gave the user required grants according to Multi-Schema Projects - Oracle Roles and Permissions , everything should work because both GRANT SELECT ANY DICTIONARY TO DATICAL_ROLE; and GRANT IMP_FULL_DATABASE TO DATICAL_PACKAGER_ROLE; already give us enough permission to query the tables. If you haven’t given such permission to us and want to use the ephemeral databaseBackupRestoreMethod - permissions to query v$pdbs and dba_data_files is available.

Use Oracle Managed Files (OMF) with Oracle Ephemeral Database

...