Oracle 18c Datapump-Parfile Parameter
Description:-
- In this article we are going to see the Oracle 18c Datapump-using parfile backup
- A parameter file allows you to specify Data Pump parameters within a file, and then that file can be specified on the command line instead of entering all the individual commands. This can be useful if you use the same parameter combination many times. The use of parameter files is also highly recommended if you are using parameters whose values require the use of quotation marks.
Syntax :
open textfile and save it as a sam.par
tables=emp dumpfile=emp1.dmp logfile=emp1.log directory=TEST_DIR
expdp scott/tiger parfile=/u01/sam.par
Let’s start the Demo:-
Pre-steps:-create a directory in the filesystem and creates a directory object in the database and grants privileges to the HR user.
[oracle@testdb ~]$ mkdir –p /u01/app/oracle/datapump [oracle@testdb ~]$ sqlplus '/as sysdba' SQL*Plus: Release 18.0.0.0.0 Production on Sat Jun 30 05:50:19 2018 Version 18.1.0.0.0 Copyright (c) 1982, 2017, Oracle. All rights reserved. Connected to: Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production Version 18.1.0.0.0 SQL> alter session set container=pdb1; Session altered. SQL> create or replace directory test_dir as '/u01/app/oracle/datapump'; Directory created. SQL> grant read,write on DIRECTORY test_dir to hr; Grant succeeded.
Demo 1:-Export the table using parfile.
[oracle@testdb ~]$ cat sam.par
tables=emp directory=TEST_DIR query=’where DEPARTMENT_ID=80′ dumpfile=par.dmp logfile=par1.log
[oracle@testdb ~]$ expdp hari/hari@pdb1 parfile=sam.par
Export: Release 18.0.0.0.0 - Production on Sun Jul 1 16:30:47 2018
Version 18.1.0.0.0
Copyright (c) 1982, 2018, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Starting "HARI"."SYS_EXPORT_TABLE_01": hari/********@pdb1 parfile=sam.par
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 "HARI"."EMP" 12.08 KB 34 rows
Master table "HARI"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for HARI.SYS_EXPORT_TABLE_01 is:
/u01/app/oracle/datapump/par.dmp
Job "HARI"."SYS_EXPORT_TABLE_01" successfully completed at Sun Jul 1 16:31:09 2018 elapsed 0 00:00:18
Catch Me On:- Hariprasath Rajaram
LinkedIn:https://www.linkedin.com/in/hari-prasath-aa65bb19/
Facebook:https://www.facebook.com/HariPrasathdba
FB Group:https://www.facebook.com/groups/894402327369506/
FB Page: https://www.facebook.com/dbahariprasath/?
Twitter: https://twitter.com/hariprasathdba