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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export/Import from 1 Sun box to another 1

Status
Not open for further replies.

mmemon

Programmer
Nov 21, 2002
46
US
Hello,

I need to write a cron job on my solaris machine that exports data from an oracle 8i database on another machine on our network and then imports the data into an Oracle 9i database that is sitting on the machine that is launching the cron job.
Can this be done? Where does the export get dumped? On the machine that is running the script or the machine that is being called?

I have a database link that is created between machines but I am not sure if that needs to be in the script.

As of now, I have the below but I am not sure if I am on the right track:

ORACLE_SID=oracle8i
export ORACLE_SID
exp userid=8i/8i file=weeklyLdat.dmp log=weeklyLdatExp.log tables=(8i.COMPANY,8i.COMNUMBR) rows=y
ORACLE_SID=oracle91
export ORACLE_SID
imp userid=9i/9i file=weeklyLdat.dmp fromuser=8i touser=9i tables=(9i.COMPANY,9i.COMNUMBR)
log=weeklyLdatImp.log rows=y

Any help would be appreciated. Thanks
Michele

 
Michele,

The export will put the dump file wherever you specify. If I were you put the .dmp file in a local directory. Write a simple cron to scp the file from one host to another and use imp on remote host to load it. Then you have control on the cronfile. Run the cron on the source machine. Use UNIX commands to check that every stage was successful. This should be fairly painless.

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top