Friday, May 10, 2019

Oracle: datapump a database by excluding a table

There might be a time that request to clone an extremely large database into an internal lab for data related troubleshooting. 99% of the time, development might only be interested in a certain set of tables but knowingly, a few tables are extremely large and unneeded. This can be easily achieved by performing a Datapump export from the customer database by excluding the table/s. In the following situation, Audit_Event data taking about 87% of the size of the database and they stored uninterested data. 


expdp username/password  dumpfile=mycloudexport.dmp directory=dumpdir_vcloud schemas=VCLOUD exclude=TABLE:\"IN \'AUDIT_EVENT\'\" logfile=vcloud_dumpfile.log

By excluding the audit_event, the database pump process was speedy. Otherwise, the database backup file transfer will take over a day.