export/import
transportable tablespaces – importuje sie tylko metadane, a potem kopiuje pliki
DataPump (10g)
SQL Loader
—
exp scott tables=person,cities log=log.txt grants=n
transportable tablespaces
alter tablespace users read only;
alter tablespace data read only;
exp sys/sys tablespaces=users,data transportable_tablespace=y
skopiowac dane pliki miedzy systemami
—
DataPump (10g)
select directory_path from dba_directories where directory_name=’DATA_PUMP_DIR’;
expdp scott/tiger dumpfile=data_dump_dir:info.dmp nologfile=y tables=person,cities
select * from dba_datapump_jobs;
sql> create directory dp as ‘c:\expimp’;
sql> grant read,write od directory dp to public;
sql> grant exp_full_database to scott;
expdp scott/tiger full=y dumpfile=dp:full%u.dmp logfile=dp:full.log job_name=full_export
w trakcie trwania exportu mozna wcisnac CTR+C aby wejsc w tryb interaktywny i mozna dac np.: exit_client (export idzie w tlo i trwa nadal)
expdp scott/tiger full=y estimate_only=y logfile=dp:estimate_full.log job_name=estimate_full_export
—
SQL Loader
tworze plik: person.ctl
load data
infile ‘c:\data.txt’
into table person2
fileds terminated by “:” optionally enclosed by ‘”‘
(pid,first,last)
potem uruchamiam komende:
sqlldr scott/tiger contro=person.ctl
tworze plik: person2.ctl
load data infile ‘c:\data.txt’ replace into table person2
(pid position (01:02) integer external,
first position (03:10) char,
last position (10:20) char)
tworze plik: person3.ctl
load data
infile ‘c:\data.txt’
replace
into table person2
when city=’denver’
fileds terminated by “:” optionally enclosed by ‘”‘
(pid,first,last,city,state)