Data Migration [message #74192] |
Sun, 03 October 2004 11:27 |
nik flash
Messages: 3 Registered: October 2004
|
Junior Member |
|
|
I have to move some data from one database to another database. The structure of data objects will be different in the two database. So I need only selected fields from the tables of first database and have to populate with them the tables of second database. What's the best way of doing it?I was thinking of using SQlloader for this. Is there anyother better way of doing it ? I am using oracle9i ( 9.2.0.1.0 ) on solaris. Thanks in advance.
__________________
regards
nik
|
|
|
Re: Data Migration [message #74193 is a reply to message #74192] |
Mon, 04 October 2004 03:42 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
depends on the complexity and volume of data.
sql*loader will work. But u need to spend your time in creating the flatfile, 'mapping' the columns to the oracle tables etc.
SINCE the data is already in an ORACLE DATABASE, we should make use of oracle functionalities within the database itself.
there is something folks call ETL (Extraction, transformation, loading).
use database links to talk from one database to another database.
then you can use simple insert statements or stored
procedures to extract the data from source tables
(source database) , transform the data (if there is
difference in datatype, or fields being concatenated
etc), and load into the target database (insert).
--
-- here i am connected to a database LAWT
--
dbadmin@constitution_lawt2 > select name from v$database;
NAME
---------
LAWT
--
-- lawp is a database link, that connects to another database LAWP
-- lets check it.
dbadmin@constitution_lawt2 > select name from v$database@lawp;
NAME
---------
LAWP
--
-- Lets do some querying in the remote database.
--
dbadmin@constitution_lawt2 > select table_name from dba_tables@lawp where owner='DBADMIN';
TABLE_NAME
------------------------------
DEPT
EMP
PLAN_TABLE
TABLE_STATS
--
-- lets create a table (locally in lawt) from the remote db(lawp).
--
dbadmin@constitution_lawt2 > create table another_emp as select ename,sal from emp@lawp;
Table created.
dbadmin@constitution_lawt2 > desc another_emp;
Name Null? Type
----------------------------------------------------- -------- ------------------------------------
ENAME VARCHAR2(10)
SAL NUMBER(7,2)
|
|
|
Re: Data Migration [message #74247 is a reply to message #74193] |
Tue, 19 October 2004 20:41 |
nik flash
Messages: 3 Registered: October 2004
|
Junior Member |
|
|
Hi Mahesh
thanks for ur reply...
the data will have to be replicated almost real time.
What's the best strategy to do it? Since we'll be picking up the updated rows only or new rows only depending upon the timestamp.....
|
|
|