Transfer particular single table from one database to other database.
Some time requirement is to transfer only one table to other database for development operation or any operation so that time impdp/expdp logical backup utility helps us to transfer table from one database to other database.so my bellow example showing you transfer one table using expdp/impdp.
Example:-
Target database:- orcl
Source database:- db11g
1]on target Database
[oracle@orcl expd]$ sqlplus
/as sysdba
SQL> create user rock
identified by rock
default tablespace users;
user created
SQL> grant connect,resource to rock;
Grant succeeded.
SQL> conn rock/rock
SQL> create table rock (id number);
table created
sql>begin
for i in 1...100000 loop
insert into rock values(i);
end loop;
end;
/
SQL> commit;
SQL> select count(*) from rock;
COUNT(*)
----------
100000
SQL>exit
[oracle@orcl expd]$expdp directory=expdp dumpfile=rock_table.dmp logfile=rock_table.log tables=rock.rock
2] copy perticuler table to source database through (FTP,hard drive etc.....) location /u02/dump.
3] on source Database
[oracle@db11g]$ mkdir -p /u02/dump
[oracle@db11g]$ sqlplus
/as sysdba
SQL>create directory dump as '/u02/dump';
SQL>create user rock
identified by rock
default tablespace test; (any tablespace of your database)
user created
SQL> Grant connect,resource to rock;
Grant succeeded.
SQL>!
[oracle@db11g]$impdp directory=expdp dumpfile=rock_table.dmp logfile=rock_table.log full=y
[oracle@db11g]$exit
SQL> conn rock/rock
SQL> select count(*) rock;
COUNT(*)
----------
100000
Note:- this blog is dedicated to all my collage friends.......
No comments:
Post a Comment