You are on page 1of 3

DATAPUMP

Scenario1)
1. Toexportcompleteschemafromonedatabase&importitinanother
database.(followingisastepswithexample)

TOEXPORTCOMPLETESCHEMAFROMRAHULDATABASE&IMPORTINHARSHAL
DATABASE
>wehavetwodatabase1)RAHUL2)HARSHAL
>wehaveuserGAURAV"inRAHULdatabase&HVD"inHARSHALdatabase
withCONNECT,RESOURCEprivelliges

LogininRAHULdatabase
(stepsforrahuldatabase)
1.Loginassysinrahuldatabase.
Forex.
$exportORACLE_SID=rahul
$sqlplus/assysdba
2.GivecreatedirectoryprivillegetoGAURAVuser.
Forex.
SQL>grantcreateanydirectorytogaurav;

3.connecttoGAURAVuserandcreatedirectoryandgrantappropriatePRIVELLIGES
Forex.
SQL>conngaurav/(password)
SQL>createdirectoryg_diras'/tmp';(/tmppathissameforbothdatabases)
SQL>grantread,writeondirectoryg_dirtopublic;

4.Checkthedirectorypath(loginassys)
Forex.
SQL>selectDIRECTORY_NAME,DIRECTORY_PATHfromdba_directories;

5.Now,wecanexportGAURAVschema(fromserverprompt)
Forex.
[oracle@server1/]$expdpgaurav/gauravdumpfile=g_dir:exp.dmplogfile=g_dir:exp.log
schemas=gaurav
LogininHARSHALdatabase
(stepsforharshaldatabase)
1.Loginassysinharshaldatabase.
Forex.
$exportORACLE_SID=harshal
$sqlplus/assysdba

2.GivecreatedirectoryprivillegetoHVDuser.
Forex.
SQL>grantcreateanydirectorytohvd;
3.connecttoHVDuserandcreatedirectoryandgrantappropriatePRIVELLIGES
Forex.
SQL>connhvd/(password)
SQL>createdirectoryh_diras'/tmp';(/tmppathissameforbothdatabases)
SQL>grantread,writeondirectoryh_dirtopublic;

4.Checkthedirectorypath(loginassys)
Forex.
SQL>selectDIRECTORY_NAME,DIRECTORY_PATHfromdba_directories;

5.NOWwecanimportGAURAVschemainHVDschema
Forex.
[oracle@server1~]$impdphvd/hvddumpfile=h_dir:exp.dmplogfile=h_dir:imp.log
remap_schema="GAURAV:HVD"remap_tablespace="USERDATA:HDATA"
schemas=gaurav
6.wecancheckschemaisimported

SQL>select*fromtab;

Scenario2)

2)ToexportTABLEfromonedatabaseSCHEMA&importitinanotherdatabase
SCHEMA(followingisastepswithexample)
Followthestepsgiveninaboveexampleno.1
(startwithlogininRAHULdatabasestep1tostep4)
consideringyouperformedallstepstillstepno.4.
step5.NowweareexportingPRODUCTStablefromGAURAVschemain
RAHULdatabase
Forex.

[oracle@server1~]$expdpgaurav/gauravtables=productsdumpfile=g_dir:exp1.dmp
logfile=g_dir:exp1.log
**********************************************************************************
Followthestepsgiveninaboveexampleno.1
(startwithlogininHARSHALdatabasestep1tostep4)

consideringyouperformedallstepstillstepno.4.
step5.NowweareimportingPRODUCTStableinHVDschemainHARSHAL
database
Forex.
[oracle@server1~]$impdphvd/hvddumpfile=h_dir:exp1.dmp
logfile=h_dir:imp.logtables=productsremap_schema="GAURAV:HVD"
remap_tablespace="USERDATA:HDATA"exclude=constraint
(NOTE:excludeifyouwanttoskiptheconstraint)

Scenario3)

You might also like