Wednesday, 22 February 2023

Ensuring Data Integrity with Oracle 21c Data Pump Checksum

 Today, we’re diving into a fantastic feature of Oracle 21c – the Data Pump checksum parameter. This tool helps ensure your Data Pump dump files are valid and intact. Let’s explore how to use it and why it’s a game-changer for data integrity.

Introduction
Consider a scenario when just transferred a huge dump file to an object store, or perhaps you’ve copied it to a different on-premises server. How can you be sure the file hasn’t been corrupted or tampered with during the transfer? Enter the checksum parameter. By calculating a checksum at the end of the job, you can confirm that no accidental or malicious changes have occurred.

Why use Checksum ?
Checksums are your digital security guard, ensuring that your dump files are complete and uncorrupted after network transfers or even validating older files. Think of it as giving your files a clean bill of health before you import them.

 Key benefits
  • Validation: Ensures your dump file is complete and uncorrupted.
  • Security: Detects any accidental or malicious changes.
  • Efficiency: Processes multiple files in parallel, saving time.

Now, let’s walk through a demo to see how it’s done u
sing Oracle 21c Data Pump Checksum

Step 1: Exporting Data with the Checksum Parameter
First, let's take an export using Oracle 21c's new Data Pump parameter – checksum

[oracle@oradbhelp ~]$ expdp expuser/paszword@orablog1 dumpfile=export.dmp logfile=export_test.log directory=data_pump_dir tables=jumbotable reuse_dumpfiles=y checksum=yes

Export: Release 21.0.0.0.0  Production on Tue Feb 21 11:47:15 2023
Version 21.3.0.0.0
Copyright (c) 1982, 2021, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 21c Enterprise Edition Release 21.0.0.0.0  Production
Starting EXPUSER.SYS_EXPORT_TABLE_01: expuser/********@orablog1 dumpfile=export.dmp logfile=export_test.log directory=data_pump_dir tables=jumbotable reuse_dumpfiles=y checksum=yes
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported “EXPUSER”.”JUMBOTABLE” 7,538 KB 189 rows
Master table “EXPUSER”.”SYS_EXPORT_TABLE_01″ successfully loaded/unloaded
Generating checksums for dump file set
******************************************************************************
Dump file set for EXPUSER.SYS_EXPORT_TABLE_01 is:
/u01/shared_fs/datapump/export.dmp
Job “EXPUSER”.”SYS_EXPORT_TABLE_01″ successfully completed at Tue Feb 21 11:57:09 2023 elapsed 0 00:10:06




Step 2: Verifying the Dump File
Next, validate the checksum to confirm if your dump file is corrupted or not using the VERIFY_ONLY parameter.

[oracle@oradbhelp ~]$ impdp impuser/paszword@orablog2 dumpfile=export.dmp directory=data_pump_dir verify_only=yes

Import: Release 21.0.0.0.0  Production on Tue Feb 21 12:15:05 2023
Version 21.3.0.0.0
Copyright (c) 1982, 2021, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 21c Enterprise Edition Release 21.0.0.0.0  Production
Verifying dump file checksums
Master table IMPUSER"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
dump file set is complete
verified checksum for dump file “/u01/shared_fs/datapump/export.dmp"
dump file set is consistent
Job IMPUSER"."SYS_IMPORT_FULL_01" successfully completed at Tue Feb 21 12:15:05 2023 elapsed 0 00:00:15



Step 3: Importing Data
Once the verification gives you the all-clear, you can proceed to import the data with confidence.
[oracle@oradbhelp ~]$ impdp impuser/paszword@orablog2 dumpfile=export.dmp directory=data_pump_dir verify_checksum=yes



Import: Release 21.0.0.0.0  Production on Tue Feb 21 12:22:09 2023
Version 21.3.0.0.0
Copyright (c) 1982, 2021, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 21c Enterprise Edition Release 21.0.0.0.0  Production
Verifying dump file checksums
Master table IMPUSER"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting “IMPUSER"."SYS_IMPORT_FULL_01": impuser/********@orablog2 dumpfile=export.dmp directory=data_pump_dir verify_checksum=yes
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported “IMPUSER"."JUMBOTABLE" 7,538 KB 189 rows
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Job “IMPUSER"."SYS_IMPORT_FULL_01" successfully completed at Thu Tue Feb 21 12:34:51 2023 elapsed 0 00:12:45


Conclusion
Using Oracle 21c’s Data Pump checksum parameter is a fantastic way to ensure the integrity of your dump files. Whether you’re transferring files across the network or just safeguarding old data, this feature makes the process smooth and reliable. 

Happy exporting and importing!


No comments:

Post a Comment