top of page
Writer's pictureShashi Kallae

Refresh a Non-Prod Oracle Database With a Production Database




Before we delve into the refresh, let's explore the Backup and Recovery of an Oracle database!

What is the purpose of backup and recovery?

In general, the purpose of database backup and recovery is to protect the database from data loss and reconstruct the database from scratch in case of any disasters.



Oracle Data Protection Methods.
Oracle Data Protection Methods.

Incremental Backups

1. Incremental backup in the Oracle database captures only blocks of data that have changed since the previous backup, not the entire database.

2. This makes the Incremental backups smaller than the full backups, which are easy to store and recover.

3. Redo logs track the changes not yet written to the primary data files. Incremental backups already capture these changes, minimizing the need to apply redo logs during data file media recovery.

Block Media Recovery

1. This process repairs corrupted data blocks within a data file without taking the entire data file offline or restoring it from a backup.

2. This process is ideal for situations where only a few blocks are affected, saving time and minimizing downtime.

3. The “Recover Block” command performs this operation.

Binary Compression

1. This feature reduces the size of the backups by compressing the data before storing it.

2. This improves backup efficiency, as smaller backups require less storage space and less time to transfer.

3. This feature comes as a built-in mechanism for the Oracle database.

Encrypted Backups

1. Encryption protects sensitive data from unauthorized access even if the backups are compromised.

2. This feature allows you to Securely Store the Backup sets by encrypting them.

3. Oracle’s Recovery Manager (RMAN) uses data encryption capabilities for this process.

Automated Database duplication

1. This process or feature allows you to create an exact replica of your database quickly.

2. It supports various storage configurations, directly copying data between Automatic Storage Management (ASM) databases.

3. This feature helps create Non-Production environments (Development, Test, QA) and disaster recovery environments.

Cross-Platform data conversion

1. This Capability allows you to migrate data between databases running on different platforms.

2. This can be beneficial when you move your database from one Operating System to another or upgrade your database to a newer version.

Key Takeaways

Incremental backups are a space and time-efficient way to capture data changes in your database. They are faster to create and, at the same time, faster to restore than the full backups. Block media recovery efficiently repairs corrupted data blocks, Binary compression saves storage space efficiently, Encrypted backups protect sensitive data, Automated database duplication simplifies database replication, and Cross-Platform data conversion helps and enables data migration between different platforms.


Overall, the above-mentioned features offer tools to manage and secure the Oracle database effectively. 

Note

Approach Oracle Support when you are in question with any of the above tools. This way, you will receive authentic and up-to-date information.


The following tasks are associated with a backup and recovery strategy,



Oracle Database Backup Strategies.
Oracle Database Backup Strategies.

Oracle Database Backup Strategies

1. Protect the database against data loss.

2. Reconstruct the database after data loss.


Typical backup administration tasks include,

1. Planning the database keeping different kinds of failures in view.

2. Validating and Testing responses.

3. Schedule a backup.

4. Monitor the backups and the disaster recovery environments.

5. Troubleshoot and document backup problems.

6. When needed, reconstruct the database and recover the data from data loss. 

7. Create a copy and store the database for long-term storage for the Data Archival process.

8. Move the database or part of the database from one environment to another, such as from production environment to non-production environments.


Pre-refresh tasks


Source Database

sourcedbProd1@sourcedbservername:/mount_name/directory_name/global_storage_location/sourcedbProd1<database_name>

Target Database

targetdbProd1@targetdbservername:/mount_name/directory_name/global_storage_location/targetdbProd1<database_name>

TDE Keys (Transparent Data Encryption Keys)

  • Ensure to note the Non-Prod and Prod TDE Keys before you begin the process.

  • Back up the TDE Keys.

Transparent Data Encryption.
Transparent Data Encryption.

Transparent Data Encryption (TDE): TDE is a security feature in Oracle Database that encrypts the data at rest, which means the data stored on the disk is encrypted, making it unreadable to anyone who doesn’t have a decryption key.


What does TDE protect against?

TDE protects against unauthorized access to the database and data files even if someone gains access to the physical storage data files. They would require the TDE master encryption key to decrypt the data from the data files.


How does TDE work?

1) Groups of Tables are called Tablespaces. TDE encrypts entire Tablespaces or specific sensitive columns within the Tables.

2) TDE is transparent to the applications, meaning application teams can continue to access and use the data without any changes to their code.

3) The encryption and decryption happen in the background without impacting the application’s performance, accessing the data using SQL (neither inbound SQL statements nor outbound SQL query results).

4) Encryption and decryption occur at the database storage level.

5) Data encrypted with TDE is decrypted when the data is read from database files. If this data goes over the network, it will be in clear-text. However, the data can be encrypted in transit using TLS or Oracle’s Native encryption method over the network. This ensures that the data traveling over the network from SQL*plus to the database and vice versa is encrypted.

6) Use the Oracle Database Security Assessment Tool to determine what sensitive data is stored in your databases.


What else does TDE encrypt?

1) Temporary Tablespaces used for processing data.

2) Undo Tablespaces used for rollback.

3) Redo logs used for database recovery.

4) Entire database backups (RMAN). Note: An Oracle Advanced security license is required to encrypt RMAN backups to disk, regardless if the TDE master encryption key or a passphrase is used to encrypt the data file.

5) Data Pump exports.


What does Oracle recommend?

1) Oracle recommends using TDE Tablespace encryption because TDE Tablespace encryption performs better and more consistently in most cases.

2) Leverages hardware-based crypto acceleration wherever available, reducing the performance impact to the “near-zero” range.


Disk Space

  • Ensure the disk space at the source and target database servers or mounts.

  • Ensure enough disk space for the RMAN export on the production database server mount.

  • Ensure enough space for the RMAN Import at the Non-Prod database server or mount.

RMAN backup at Source (Disk Based)

Please follow the below steps to take a full RMAN backup to DISK in the Primary production database. Do not run the full backup in the standby database unless your development team is concerned about running the backup in the primary database.

  • Verify that the RMAN backup directory used in the backup script exists.

  • Ensure the RMAN backup directory has enough space to hold the full database backup.

  • The number of channels should be decided based on the number of available CPUs in the host.

  • The below command file for RMAN backup can be used; ensure to set the directory path as needed for the refreshes.

run
{
allocate channel ch1 type disk;
allocate channel ch2 type disk;
allocate channel ch3 type disk;
allocate channel ch4 type disk;
allocate channel ch5 type disk;
allocate channel ch6 type disk;
allocate channel ch7 type disk;
allocate channel ch8 type disk;
allocate channel ch9 type disk;
allocate channel ch10 type disk;
allocate channel ch11 type disk;
allocate channel ch12 type disk;
allocate channel ch13 type disk;
allocate channel ch14 type disk;
allocate channel ch15 type disk;
backup as compressed backups incremental level 0 database format
‘/mount_name/directory_name/local_storage_location/sourcedbProd1<database_name>/RMAN_BACKUP_DIRECTORY/sourcedb_%d_%T_%t_%s_%p’;
backup as compressed backups archive log all format
'/mount_name/directory_name/local_storage_location/sourcedbProd1<database_name>/RMAN_BACKUP_DIRECTORY/archivelog_%d_%T_%t_%s_%p’;
backup current controlefile format
'/mount_name/directory_name/local_storage_location/sourcedbProd1<database_name>/RMAN_BACKUP_DIRECTORY/controlfile_%d_%T_%t_%s_%p.ctl’;
backup spfile format
'/mount_name/directory_name/local_storage_location/sourcedbProd1<database_name>/RMAN_BACKUP_DIRECTORY/spfile_%d_%T_%t_%s_%p’;
}
  • Include a log file for the RMAN backup execution and verify the backup when completed successfully without errors.


Pre-refresh tasks on the Target host

  • Create a tmp directory

$ mkdir -p /tmp/dbrefresh_Feb052024_1017pmcst_monday
  • create pfile from spfile on target database before dropping it.

SQL>create pfile=/tmp/dbrefresh_Feb052024_1017pmcst_monday/init_targetdbProd1.ora’ from spfile;
  • Modify the parameters appropriately in the target database ora file.

$ vi /tmp/dbrefresh_Feb052024_1017pmcst_monday/init_targetdbProd1.ora

1. Update the db_name from the non-prod env to prod env.
2. Add the db_file_name_convert   db_file_name_convert='/mount_name/directory_name/oradata02/database_name01’,'/mount_name/directory_name/oradata02/database_name02’,'/mount_name/directory_name/oradata01/database_name01’,'/mount_name/directory_name/oradata01/database_name02'

3. Add the log_file_name_convert
log_file_name_convert='/mount_name/directory_name/oradata02/database_name01’,'/mount_name/directory_name/oradata02/database_name02/onlinelog','/mount_name/directory_name/oradata01/database_name01’,'/mount_name/directory_name/oradata01/database_name02/onlinelog'

4. Backup existing control file to trace on the target database before dropping the target DB.
SQL> alter database backup control file to trace;

5. Take a backup of all the User account passwords for all users or schemas in the database.
SQL>col db_users for a5000
set long 9999;

SQL>select dbms_metadata.get_ddl(‘user’,username)||’;’ as “db_users” from dba_users;

Drop existing Target Database

Drop the database

SQL> shutdown immediate;
SQL> startup pfile='/mount_name/directory_name/orabin/admin/dbrefresh_Feb052024_1017pmcst_monday/init/targetdbProd1.ora’ mount exclusive restrict;
drop database;

Ensure all the files are removed from the fra location; there shouldn’t be any files.

Path: /mount_name/directory_name/fra01


Preparation tasks for restoration from backup

  1. Restore the control file from the backup.

  2. Mount database.

  3. Catalog backup files.

  4. Get the SCN from the control file needed for the restore.

  5. Generate restore preview. Ensure all archive redo logs are fetched from the production environment.

Restore the control file from the backup.

rman target /

run {

allocate channel d1 device type disk;

restore primary from

'/mount_name/directory_name/global_storage_location/sourcedbProd1/rman_full_backup/sourcedbProd1_primary_contril_xxxxxx_xxxxxx_x_x_xxxxxxxx.ctl’;

}


Mount database.

SQL> alter database mount;

Catalog backup files

catalog start with '/mount_name/directory_name/global_storage_location/sourcedbProd1/rman_full_backup/sourcedbProd1_date’;
crosscheck backup device type disk;
delete expired backup device type disk;

Find the SCN from the control file


Example

RMAN> list backup of controlfile;

List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ------------------
101     Full    162.04M    DISK        00:00:02     2024-01-01 09:00:00
        BP Key: 101   Status: AVAILABLE  Compressed: NO  Tag: TAG20240101T090000
        Piece Name: /path/to/controlfile_backup_20240101.bkp
  Controlfile Included: Ckp SCN: 1234567      Ckp time: 2024-01-01 08:59:59

102     Full    163.75M    DISK        00:00:03     2024-01-02 09:00:00
        BP Key: 102   Status: AVAILABLE  Compressed: NO  Tag: TAG20240102T090000
        Piece Name: /path/to/controlfile_backup_20240102.bkp
  Controlfile Included: Ckp SCN: 2345678      Ckp time: 2024-01-02 08:59:59

From the above example output,

  • Two backup sets of the control file are listed (BP Key 101 and BP Key 102).

  • Each backup set includes details such as the backup type (Full), size, device type, elapsed time, and completion time.

  • The "Piece Name" indicates the file path of the backup piece.

  • The "Controlfile Included" section provides information about the control file copy included in the backup set, including the checkpoint SCN (Ckp SCN) and checkpoint time (Ckp time).

  • The SCNs are listed under "Controlfile Included" as "Ckp SCN". In this example, the SCNs are "1234567" and "2345678" for the respective backup sets. These SCNs represent the System Change Number when the backup was taken, which helps identify the state of the database at that point in time.

Get the SCN from the control file needed for the restore.


How do you get SCN?

RMAN> list backup of controlfile;

This command in RMAN does not directly provide the SCN details of the control file backups. Instead, you would need to query additional data dictionary views to obtain the SCN information.

However, you can use "V$BACKUP" and "V$BACKUP_DATAFILE" views.

Example SQL ONLY:

SELECT bs.recid AS backup_set_id,
       bs.start_time AS backup_start_time,
       bf.creation_change# AS scn
FROM   v$backup bs
JOIN   v$backup_datafile bf ON bs.recid = bf.backup_set_recid
WHERE  bf.file# = 1; -- Specify the file number of the control file

This query retrieves the backup set ID, backup start time, and SCN details of the control file backups. Adjust the WHERE clause to filter for the control file backups based on your database configuration. Additionally, note that the SCN information is obtained from the V$BACKUP_DATAFILE view, which tracks SCN details of backup data files, including the control file.

Executing this SQL query will provide you with the SCN details of the control file backups, allowing you to track the SCN associated with each backup set.


Example

RUN {
  ALLOCATE CHANNEL ch1 DEVICE TYPE DISK FORMAT '/path/to/backup/%U';
  ALLOCATE CHANNEL ch2 DEVICE TYPE DISK FORMAT '/path/to/backup/%U';
  ALLOCATE CHANNEL ch3 DEVICE TYPE DISK FORMAT '/path/to/backup/%U';
  
  SET UNTIL SCN 1234567; -- Specify the SCN until which recovery should be performed
  
  RESTORE DATABASE PREVIEW;
  
  RELEASE CHANNEL ch1;
  RELEASE CHANNEL ch2;
  RELEASE CHANNEL ch3;
}
run
{
allocate channel ch1 type disk;
allocate channel ch2 type disk;
allocate channel ch3 type disk;
allocate channel ch4 type disk;
allocate channel ch5 type disk;
allocate channel ch6 type disk;
allocate channel ch7 type disk;
allocate channel ch8 type disk;
allocate channel ch9 type disk;
allocate channel ch10 type disk;
allocate channel ch11 type disk;
allocate channel ch12 type disk;
allocate channel ch13 type disk;
allocate channel ch14 type disk;
allocate channel ch15 type disk;
set until scn 1234567;
restore database preview device type disk;
release channel d1;
release channel d2;
release channel d3;
release channel d4;
release channel d5;
release channel d6;
release channel d7;
release channel d8;
release channel d9;
release channel d10;
release channel d11;
release channel d12;
release channel d13;
release channel d14;
release channel d15;
}

Sample output

recovery will be done up to SCN 2345678
Media recovery start SCN is 1234567
Recovery must be done beyond SCN 2345778 to clear datafile fuzziness
Finished restore at MM/DD/YYYY

NOTE:
Take note of the above SCN from "Recovery must be done beyond SCN 2345778 to clear datafile fuzziness”.

Now, add 1 to the above SCN to get the Recovery SCN.

Example: Recovery = 2345778 (Above SCN) + 1 = 2345779.

Click here to go to the “Recovery” section.


Fetch Archive Redo Logs

Note: Only use the below sqls to fetch the archives as needed.

RMAN> connect target sys/password@targetdbProd1
connected to target database:targetdbProd1 (DBID=xxxxxxxxxx)

RMAN>CONNECT CATALOG rman_catalog_user/password123@tns_entry;

In the above,
“rman_catalog_user" is the username for the RMAN catalog.
password123 is the password associated with the rman_catalog_user account.
“tns_entry" is the TNS entry configured in the tnsnames.ora file, which provides the connection details for the catalog database.

RMAN> run{
allocate channel dev1 type disk;
set archivelog destination to ‘/tmp’;
restore archivelog sequence xxxxx;
}

Restore the Database

Create a file with the help of a restore file. For this, either touch a file to restore or use “vi” editor to create a new file.

Touch Command:
$ pwd
$ cd /home/oracle
$ touch dbrestorefile.rman
$ ls -lthr

You should see the above file.

$ vi dbrestorefile.rman

run
{
allocate channel ch1 type disk;
allocate channel ch2 type disk;
allocate channel ch3 type disk;
allocate channel ch4 type disk;
allocate channel ch5 type disk;
allocate channel ch6 type disk;
allocate channel ch7 type disk;
allocate channel ch8 type disk;
allocate channel ch9 type disk;
allocate channel ch10 type disk;
allocate channel ch11 type disk;
allocate channel ch12 type disk;
allocate channel ch13 type disk;
allocate channel ch14 type disk;
allocate channel ch15 type disk;
set until scn 1234567;
restore database preview device type disk;
release channel d1;
release channel d2;
release channel d3;
release channel d4;
release channel d5;
release channel d6;
release channel d7;
release channel d8;
release channel d9;
release channel d10;
release channel d11;
release channel d12;
release channel d13;
release channel d14;
release channel d15;
}

Recovery

From the above Sample Output, get the recovery SCN number to recover the database.

run
{
allocate channel ch1 type disk;
allocate channel ch2 type disk;
allocate channel ch3 type disk;
allocate channel ch4 type disk;
allocate channel ch5 type disk;
allocate channel ch6 type disk;
allocate channel ch7 type disk;
allocate channel ch8 type disk;
allocate channel ch9 type disk;
allocate channel ch10 type disk;
allocate channel ch11 type disk;
allocate channel ch12 type disk;
allocate channel ch13 type disk;
allocate channel ch14 type disk;
allocate channel ch15 type disk;
set until scn 2345779;
restore database;
release channel d1;
release channel d2;
release channel d3;
release channel d4;
release channel d5;
release channel d6;
release channel d7;
release channel d8;
release channel d9;
release channel d10;
release channel d11;
release channel d12;
release channel d13;
release channel d14;
release channel d15;
}

Convert pfile to spfile

create spfile from pfile='/mount_name/directory_name/global_storage_location/sourcedbProd1/rman_full_backup/Backup_xx/inittargetdbProd1.ora.bak’;

Restart the database

SQL> shutdown immediate;
SQL> startup mount;

Open resetlogs

SQL> alter database open resetlogs;

Change DBID using DBNEWID Utility

What is DBNEWID Utility?

The DBNEWID utility lets you change only the DBID, DBNAME, or a database's DBID and DBNAME.


Sequence of DBNEWID Utility
  1. Preparation

    • Ensure you have the necessary privileges (SYSDBA) to execute the utility.

    • Back up your database as a precaution. 2. Execution

    • Launch the command prompt (SQL*Plus, Toad, etc.)

    • Connect to your database using the appropriate credentials.

    • Execute the DBNEWID command with the desired parameters:

    • SETDBID to change only the DBID

    • SETNAME to change only the DBNAME

    • SETALL to change both DBID and DBNAME

    • Provide additional parameters like new name, target PDB (if applicable)

    • Press Enter or execute the command based on your tool.

3. Verification

  • Check the output message for success or failure indications.

  • Query the system tables to confirm the changes (e.g., v$database view).

4. Additional steps

  • If changing DBNAME, modify dependent objects (e.g., tnsnames).

  • Update scripts or configurations relying on the old names.

  • Restart the database if required.


Step 1: Mount the database after a clean shutdown.

SHUTDOWN IMMEDIATE;
STARTUP MOUNT;

Step 2: Invoke the DBNEWID utility (nid) specifying the target database name (DBNAME) from the command line using a user with SYSDBA privilege.

nid TARGET=sys/password DBNAME=targetdbProd1

Step 3: Change the DBID

$ nid TARGET=sys/password DBNAME=targetdbProd1
DBNEWID: Release 19.0.0.0.0 - Production
Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Connected to database sourcedbProd1 (DBID=1234567890)

Control Files in database:
    /mount_name/directory_name/oradata01/targetdbProd1/control01.ctl    /mount_name/directory_name/oradata02/targetdbProd1/control01.ctl

Change database ID and database name sourcedbProd1 to targetdbProd1? (Y/[N]) => Y
Proceeding with operation
Changing database ID from 1234567890 to 1234567891
Changing database name from sourcedbProd1 to targetdbProd1
Control File /mount_name/directory_name/oradata01/targetdbProd1/control01.ctl - modified
Control File /mount_name/directory_name/oradata02/targetdbProd1/control01.ctl - modified
…………………………………………………………………………………………………………………………………………………………………………………
Datafile /mount_name/directory_name/oradata01/targetdbProd1/system01_.db - dbid changed, wrote new name
…………………………………………………………………………………………………………………………………………………………………………………
Control File /mount_name/directory_name/oradata01/targetdbProd1/control01.ctl - dbid changed, wrote new name
Instance shut down

Database name changed to targetdbProd1.
Modify parameter file and generate a new password file before restarting.
Database ID for database targetdbProd1 changed to 1234567891.
All previous backups and archived redo logs for this database are unusable.
Database is not aware of previous backups and archived logs in Recovery Area.
Database has been shutdown, open with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.

Confirm Enterprise User Security (EUS) works

The "sqlplus /nolog" command is a way to start SQLPlus, which is an interactive command-line tool for Oracle Database management and development, without immediately connecting to a specific database. When you run "sqlplus /nolog", it starts SQLPlus without attempting to log in to any Oracle database.

$ sqlplus /nolog
CONNECT username/password@tns_entry;

Oracle Enterprise Manager (OEM)

If the above doesn’t work, then login to OEM and execute the EUS script from OEM.

  1. Login to OEM.

  2. Enterprise -> Provisioning and Patching -> Procedure Library.

  3. Factory -> EUS -> Config 1.1 -> Click Launch

  4. Follow the directions.

Troubleshooting Snippets (This part needs to be reviewed thoroughly)

Note: Ensure you understand the below before proceeding.

In the context of Oracle Database, "snippets" typically refer to small pieces of SQL code or PL/SQL code that can be stored and reused for various purposes.

Grab the backup script from above,

run
{
allocate channel ch1 type disk;
allocate channel ch2 type disk;
allocate channel ch3 type disk;
allocate channel ch4 type disk;
allocate channel ch5 type disk;
allocate channel ch6 type disk;
allocate channel ch7 type disk;
allocate channel ch8 type disk;
allocate channel ch9 type disk;
allocate channel ch10 type disk;
allocate channel ch11 type disk;
allocate channel ch12 type disk;
allocate channel ch13 type disk;
allocate channel ch14 type disk;
allocate channel ch15 type disk;
backup as compressed backupset full database format
‘/mount_name/directory_name/local_storage_location/sourcedbProd1<database_name>/RMAN_BACKUP_DIRECTORY/sourcedbProd1/spdb_%d_%T_%t_%s_%p’;
backup as compressed backups archive log all 
format
'/mount_name/directory_name/local_storage_location/sourcedbProd1<database_name>/RMAN_BACKUP_DIRECTORY/sourcedbProd1/arlog_%d_%T_%t_%s_%p’;
backup current controlefile format
'/mount_name/directory_name/local_storage_location/sourcedbProd1<database_name>/RMAN_BACKUP_DIRECTORY/controlfile_%d_%T_%t_%s_%p.ctl’;
release channel d1;
release channel d2;
release channel d3;
release channel d4;
release channel d5;
release channel d6;
release channel d7;
release channel d8;
release channel d9;
release channel d10;
release channel d11;
release channel d12;
release channel d13;
release channel d14;
release channel d15;
}

Drop all the standby redologs

SQL> alter database drop standby log file group xx;
Database altered.
SQL> alter database drop standby log file group yy;
Database altered.
SQL> alter database drop standby log file group zz;
Database altered.

Recreate Temp files

SQL> alter tablespace temp add tempfile size 29999M autoextend off;

Backup the control file to trace

SQL> alter database backup control file to trace;
Database altered.
/mount_name/directory_name/oradata01/orabin/diag/rdbms/targetdbProd1/targetdbProd1/trace/targetdbProd1_ora_xxxxx.trc

Change the global name

SQL> select * from global_name;
GLOBAL_NAME
————————————————————————————————
sourcedbProd1.fqdn

SQL> alter database rename global_name to targetdbProd1.fqdn;
Database altered.

SQL> select * from global_name;
GLOBAL_NAME
————————————————————————————————
targetdbProd1.fqdn

Create spfile

Create spfile from the pfile that was used in the restore.

SQL> create spfile from pfile='/mount_name/directory_name/oradata01/orabin/admin/dbrefreshxxxxxx/inittargetdbProd1.ora'
File created.

Validate TDE Keys (Transparent Data Encryption Keys)

ADMINISTER KEY MANAGEMENT SET KEYSTORE open IDENTIFIED BY <keystore_password>;

This command is used to open the keystore in the Oracle database, allowing you to manage TDE keys.

Here's a breakdown of the command:

  1. ADMINISTER KEY MANAGEMENT: This clause indicates that you administer the key management functionality.

  2. SET KEYSTORE: This subclause specifies that you are setting the keystore.

  3. open: This keyword is used to open the keystore. This command is typically used to open the keystore when it is closed.

  4. IDENTIFIED BY <keystore_password>: This part specifies the password needed to access the keystore. Replace <keystore_password> with the actual password for the keystore.

After executing this command, you would be able to perform further operations related to managing TDE keys in the Oracle database.


About Backup

A Backup is a copy of a database or part of a database that can be used to reconstruct data during disasters or database refresh tasks. Backups can be physical backups or logical backups.


Oracle Database Backup Types.
Oracle Database Backup Types.

Physical BackupsData Files, control files, and archived redo log files are physical files. These files are used to store and recover a database. Physical backups should be stored in different locations apart from the source location, such as external disks or tapes. Backup tools from several vendors support this process, but Oracle recommends using their native RMAN tool to back up and recover the data.Logical BackupsLogical backups comprise metadata such as tables, stored procedures, and others. Oracle recommends using their native utility, the Oracle data pump to export logical data from the source and import it into the target. Data pup command line clients such as expdp and impdp use the DBMS_DATAPUMP and DBMS_METADATA PL/SQL packages.


RMAN Backups

RMAN backup can be done in Consistent and Inconsistent ways,


RMAN Backups.
RMAN Backups.

Consistent Backup

Oracle database is said to be consistent when you shut down the database with the SHUTDOWN NORMAL, SHUTDOWN IMMEDIATE, or SHUTDOWN TRANSACTIONAL commands, which means Oracle offers three shutdown methods (NORMAL, IMMEDIATE, and TRANSACTIONAL) to ensure data consistency. These three methods wait for ongoing transactions to complete, or they roll back. This eliminates incomplete changes that may lead to an inconsistent state. Also, This guarantees that all redo logs have been applied to the data files. Redo logs record every database change. Applying them ensures all changes are reflected before shutdown.

Inconsistent Backup

A backup made when the database is in open mode is called Inconsistent. This is because while the database is open, data is constantly being changed and updated. Backing up while this happens means there's a higher chance of capturing the data in an incomplete state.

Recent Posts

See All

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page