This is the third of a multi-part blog series walking through how to copy your TDE encrypted on premise Oracle Database to an OCI instance in the oracle cloud. This blog post will focus on how to restore OKV (Oracle Key Vault) into an instance in OCI to manage your encryption keys, and support restoring an encrypted database.
The first part of this series went through how to migrate a database from on premise to an instance in the cloud using the Oracle Database Cloud Backup Module. You can find it here.
The second part of this series went through how to backup OKV to an immutable OCI bucket leveraging ZFSSA. You can find it here.
I will add to this by restoring from my OKV backup into the Oracle Cloud (OCI), and then restoring my database.
I am going to skip over how to migrate my database to using OKV. If you are starting at the beginning (small database no encryption), the steps to get to this next blog post are.
- Create a new database for testing.
- Implement Advanced Security (TDE) which is covered in my post here.
- Migrating from a local wallet to OKV which is covered in my post here.
- Backup your database to an OCI bucket encrypted, and compressed.
Create a ZFS Image in OCI to restore OKV from Object Store.
Create an OKV Image in OCI to restore OKV from Object Store.
- Always deploy the same version in OCI as the backup you are restoring from.
- The command when first logging into the image to configure it may be different from the video, but the login screen will give you clear instructions.
Configure ZFS as a backup location for OKV
- Create the user on the ZFS image to own the backups
- Log into OKV and save the "public key" for Authentication.
- Configure SFTP on the ZFS image, and add the "Public Key" for the new user.
- Configure the OCI Object Store on the ZFS image as a "cloud target" pointing to the same bucket you had written to.
- Create a new project on the ZFS image with the OKV backup owner as the owner of the project.
- Configure protocols on the new project to ensure that "SFTP" is read/write.
- Creating a share within the project
- Creating a backup location within OKV.
Restore the share to the ZFS image in OCI
This will bring up a popup window where you will choose where to restore the backup to. Chose the project that you previously created (with the OKV backup user, and "SFTP" protocol enabled"). Give the share a name, and click on "APPLY".
When it completes the restore, take note of the share name, and you can configure OKV to restore from this share.
Restore the OKV backup in OCI
Re-enroll your database in OCI
- root
- support
- "recovery passphrase"
audit_file_dest='/u01/app/oracle/admin/ocitest/adump'
audit_trail='db'
compatible='19.0.0'
control_files='/u01/app/oracle/oradata/OCITEST/controlfile/o1_mf_jo6q53rf_.ctl''
db_block_size=8192
db_create_file_dest='/u01/app/oracle/oradata'
db_name='ocitest'
db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
db_recovery_file_dest_size=32212254720
diagnostic_dest='/u01/app/oracle'
enable_pluggable_database=true
pga_aggregate_target=1547m
processes=300
sga_target=4638m
tde_configuration='KEYSTORE_CONFIGURATION=OKV|FILE'
undo_tablespace='UNDOTBS1'
wallet_root='/u01/app/wallets/ocitest'
- Startup nomount
- Open the wallet pointing to my keys in OKV
- Set the DBID
- Allocate the channel
- Restore the controlfile
- Mount the database.
sqlplus / as sysdba
SQL> startup nomount;
SQL> ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "0KV2021!";
SQL> exit
rman target /
RMAN> set dbid=301925655;
RMAN> run {
RMAN> allocate CHANNEL c1 TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/home/oracle/ociconfig/lib/libopc.so,SBT_PARMS=(OPC_PFILE=/home/oracle/ociconfig/config/ocitestbackup.ora)';
RMAN> restore controlfile from autobackup ;
RMAN> release channel c1;
RMAN> }
RMAN> alter database mount;
Once mounted, I can follow the normal steps to restore my database, and my encryption keys are available. The backup information for my OCI bucket is in my controlfile.
No comments:
Post a Comment