...
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.
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
...
| |||
BackupRestoreOracleEphemeralExternalPdb | This container is different and separate from the cloned dbDef.
|
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
|
...
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 |
...
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.
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 : 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 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 Default link name will be 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 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
anddba_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 bothGRANT SELECT ANY DICTIONARY TO DATICAL_ROLE;
andGRANT 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 ephemeraldatabaseBackupRestoreMethod
- permissions to queryv$pdbs
anddba_data_files
is available.
Use Oracle Managed Files (OMF) with Oracle Ephemeral Database
...