Oracle Export-Import - Refresh Table

Oracle Export-Import - Refresh Table

For DBA Refreshing Table, Schema and Database are routine activity. You can refresh/Clone database using below method:

1.Conventional Restore method and Rename DB post DB Refresh
2.Conventional Duplicate Database method
3. Active database Cloning 
4.Backup Base Cloning

In Todays blog , We will discuss about how to refresh table from one database to another database. 

Below are the Steps to refresh table:

1)Export the XXX.XXX_DATA table on Source Database

 expdp \"/ as sysdba\" directory=DATAPUMPDIR logfile=XXXX_XXX_adhoc_180113.log dumpfile=XXXX_XXXX_adhoc_180113.dmp tables=XXX.XXXX_DATA


2) SCP the backup dump to target server .

3)At Target Database ,Take the export backup of the existing table as below.

expdp \"/ as sysdba\" directory=DATAPUMPDIR logfile=XXXX_XXXX_adhoc_backup_180113.log dumpfile=XXXX_XXXX_adhoc_backup_180113.dmp tables=XXX.XXXX_DATA


4) Finally Import it as below

impdp \"/ as sysdba\" directory=DATAPUMPDIR logfile=XXXX_XXXX_adhoc_180113.log dumpfile=XXXX_XXXX_adhoc_180113.dmp tables=AIA.XXXX_XXXX TABLE_EXISTS_ACTION=TRUNCATE


5) Compare the indexes/constraints on both source and target

select owner,index_name,table_name from dba_indexes where table_name='XXXX_XXXX';

6) For any error related to Dependent object use below commands to disable the constraints first and run the import again.

select 'ALTER TABLE ' || owner || '.' || table_name || ' disable constraint ' ||constraint_name || ';' from dba_constraints where owner='&user' and TABLE_NAME='<XXXX>';

You can learn more about oracle database administration: 

Pro Oracle GoldenGate for the DBA

Oracle Security Tools Installation and Configuration

Expert Oracle Exadata 

Oracle Database 12c Release 2 Real Application Clusters Handbook: Concepts, Administration, Tuning & Troubleshooting

Expert Oracle RAC 12c

==========================================================

Please check our other blogs for Refresh

Comments

Popular posts from this blog

Restart Innodb MySQL Cluster after Complete outage(All node Down)

How to clone Pluggable Database from one container to different Container Database

Oracle Block Corruption - Detection and Resolution