Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy contents of one field to another field in another database

Status
Not open for further replies.

openeratech

Technical User
May 23, 2005
62
IN
Hi,

I have to copy contents of one field to another field in another database,

I am using Oracle 8 on Windows 2000 server.

Please tell me how can i do it.

Thanks
Yunus
 
Opener,

Hoinz's suggestion is right on the money. Also, knowing how much trouble I had originally figuring out how database links worked, I thought I would pass along some simple samples for you of a syntax option to create at database link, then an example of how to use a database link to both access and update a remote database.

First, I have a database on a machine on our network that is 750 miles away on the West Coast. The alias that I have in my tnsnames.ora for that database is RIV817. Here then is my code to create a database link to the SYSTEM user on that database:
Code:
create database link RIVER
   connect to SYSTEM identified by <SYSTEM password goes here>
   using 'RIV817';

Database link created.
Then to access yet another schema in the remote database:
Code:
select * from dontdrop.dummy@riv817;

X
---------
£
1

2 rows selected.

To update the remote database, you can say:
Code:
update dontdrop.dummy@riv817
set x = '$' where x = '£';

1 row updated.

select * from dontdrop.dummy@riv817;

X
---------
$
1

2 rows selected.
Then, to illustrate that you have full consistency control over even a remote transaction:
Code:
rollback;

Rollback complete.

select * from dontdrop.dummy@riv817;

X
---------
£
1

2 rows selected.
Does this give you the illustration you need to take care of business?


[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
Hi,
Just one added note about a very common 'gotcha' when using Database Links:
The tnsnames.ora file On the Oracle Database Server , Not the client PC is the one that needs to have the entry for the remote database instance..

I usually test my DB LInks right after I create them by using a
select sysdate from dual@Remote

It will indicate any problems with the link and usually is very fast.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Good point of emphasis, Turkbear. (BTW, [and not wanting to take this thread off into the weeds...I imagine that the weather 30 miles south of Dublin on a summer's day like today must be amazing, true or false?)

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
Hi,
Actually, I am in Minnesota - but the weather is great this time of year ( assuming you like 90s and high humidity) - makes up for the -20s F and low humidity in the Winter...




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi,

thanks everyone for their help. I got this one sorted out by using utility DB Commander Pro.

As i am not a full time DBA so i dont understand most of the things explained above. I was looking for some easy solution.

But anyways my word of thanks is for all who helped me.

Cheers
Yunus
 
Hi,
Glad you found a way to get it done, but, if you are going to be held accountable for DBA type work, especially with a complex system like Oracle, you need to get some training or at least do lots of reading...Oracle is not a simple beast to tame...






[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top