Creating link between two database
Hi
I need to copy tables from abc5/abc5@pqrXYZ1 to jk8/jk8@pqrXYZ1. For this I am trying to create a link between the 2 databases but not wkng.I am pasting here what I ve tried.Please let me know why isnt this wkng. sqlplus jk8/jk8@pqrXYZ1 CREATE DATABASE LINK DB1.WORLD CONNECT TO abc5 IDENTIFIED BY abc5 USING 'DB1.WORLD'; please help!!! |
Why don't you just use mysqldump if you just want to copy the tables?
mysqldump abc5 > abc5.sql mysql jk8 < abc5.sql You can just get certain tables if you don't want them all, just look at the documentation for mysqldump. |
but i need to first link the two databases and then do a COPY.
is mysqldump possible in oracle? |
Oh, I didn't realize this was for Oracle. I'm afraid I'll be of no help then.
|
i found the solution ans itz working.I ve posted the full script for others like me!!!
#!/bin/ksh #echo "Please enter the userID: \c" #read $1 #stores the uid #echo "Please enter the password: \c" #read $2 #stores the pwd #echo "Please enter the database instance: \c" #read $3 # stores the instance #sqlplus -s $1/$2@$3 #connecting to the environment where the tables need to be copied #set heading off feedback off pagesize 0 linesize 30000 trimout on; #whenever sqlerror exit 1; #whenever oserror exit 1; sqlplus 1/2@3 <<EOF #id and pwd and istance of DB where u need to copy create database link smriti connect to id IDENTIFIED BY pwd using 'instance'; #id and pwd and instance of DB1 from which u need to pick the tables CREATE TABLE new_a AS SELECT * FROM DB1instance.a@smriti; CREATE TABLE new_b AS SELECT * FROM DB1instance.b@smriti; CREATE TABLE new_c AS SELECT * FROM DB1instance.c@smriti; EOF |
All times are GMT -5. The time now is 04:07 PM. |