troubleshooting Question

In Korn Shell execute sql script accessing two databases

Avatar of cringleb
cringleb asked on
Oracle DatabaseShell ScriptingSQL
3 Comments1 Solution1401 ViewsLast Modified:
The current solution I have:
sqlplus -s /nolog <<EOF 1> sdwh_sc.results
connect UIDr/PWORD@db1
set serveroutput on
@sdwh_sc.sql
EOF
sqlplus -s /nolog <<EOF 1> dm_sc.results
connect UID/PWORD@db2
set serveroutput on
@dm.sql
EOF

I then compare the output of the two *results files using UNIX scripting; however, it would be far faster if I could use SQL to decode table extracts for comparison. Is there a way to connect to another database from within a sql script so that I can use both databases in the from clause? I must be able to do this from a korn shell as indicated in the above code snippets.

Thank you for your trouble,
C:)
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros