Afrikaans
Akan
Albanian
Amharic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
In this lesson, we're going to look at data migration
using Data Pump Import.
So Data Pump Import is the partner tool
to Data Pump Export.
So data is exported, or taken out of the database,
into files using Export.
And Import will take it from the file
back into a table in the database.
So again, we used to use an older tool
to import data, the imp command line
tool, that could import data that had been exported
using the exp tool.
But starting in 10g, Oracle recommends
the use of Data Pump Import.
And primarily, because it has a number of different
features, and it can be up to 15 times faster in importing data.
It also has a number of features,
such as compression, encryption, some important things that we
can use that are important when we migrate data
from one place to another.
It's also important to note that Data Pump Import and Export are
also integrated with tools such as Oracle Enterprise Manager
and can be accessed from the GUI using those tools.
So let's take a look at what we have here.
We already have some exported files.
In order to run Data Pump Import,
we're going to create a parameter
file that will specify how we want the data imported.
So to verify something here first,
let's log in as Scott and select star from dept_copy.
So we have no table called dept_copy at this point.
What we're going to do is we're going to import data
from the dump file that was dumped out of the DEPT table
into a table called dept_copy.
So we need to construct our import parameter file.
I'm just going to create a text file here called dept_imp.par.
So let's add some commands here.
User ID will be Scott.
The directory object we're using will be dept_external.
The dump file we'll specify as dept_exp01.dump.
Notice that we have that file right here.
It contains the data from the DEPT table.
Logfile will be dept_imp.log.
And here's the key.
We're going to say remap_table equals scott.dept:dept_copy.
Every reference there is in this dump file
to the scott.dept table will now be
mapped to a new table called dept_copy.
Save and close this.
And in order to invoke our Data Pump Import tool, we use impdp.
parfile will be dept_imp.par.
So that is our dept_imp parameter file, and hit Enter.
And notice that it imports the scott.dept_copy table and puts
four rows.
So let's take a look, if we can see the data.
Select star from dept_copy, which if you recall
did not exist before we ran our import.
And there is the data.
Let's look at one more thing.
What would happen if we ran this again,
if it was our intent to load the same data into the table again?
Notice that it says, completes with 1 error.
And it says the table scott.dept_copy exists.
And so it says any dependent metadata
and data will be skipped.
So if we want to do something like that, as load
the data again, we need to make a modification to our parameter
file.
We're just going to add, table_exists_action
equals append.
So there is a number of different table_exists_action
commands that we can use-- append, truncate,
a number of different ones.
So we want to append that data into the table again.
We'll save it, and run our Data Pump Import again.
Again, we're importing data from that dump file into the table.
It says it's completed successfully.
Let's log in as Scott, do a select star from dept_copy.
And then notice that the data was imported again.
So that's how we can use Data Pump
Import to leverage data migration in an Oracle
database.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.