troubleshooting Question

Need help on Unix ,oracle and sql server

Avatar of digs developer
digs developer asked on
LinuxOracle DatabaseMicrosoft SQL Server
18 Comments1 Solution758 ViewsLast Modified:
I have requirement to get spool data from sql server and oracle into 2 seperate files from linux server. both db has one column account number to extact in both files

I can connect oracle server and spool data into file like sqlplus user/pass @spool.sql

to connect sql server sqlcmd which path or client software or pacakge needs to install on linux server or can i run that command on sql server from this server so no

need to install anything locally.

1.I need to know which sqlcmd(envinemnt setting in linux ) needs to use to connect sql server db and run given sql and get output in textfile without header/feedback.

2. need to comapre both data files and get different accountno file only for another sql server query

Below is the data from one file SQLSERVERFILE

ACCOUNTNO
1111
2222
3333
4444
5555
6666

AND below is the data from Oracle ORACLEFILE
ACCOUNTNO
1111
2222
3333
4444


So compaire above 2 files and create new files with missing records.

Output of NEWFILE

ACCOUNTNO
5555
6666

BUT I need output like - this is critical for me now.. how to keep accountno one by one
5555,6666

as this will be pass to another sql server query like where accountno in(5555,6666);

i also need to know if there is error then it will stop at taht process and give me someoutput saying it failed on which step.

create script with logfile to append
run sql server extracr cmd
check status for above run . good then go for next
run oracle sql extract cmd
check status
find different accountno and create file with ,
check status
logfile
ASKER CERTIFIED SOLUTION
johnsone
Senior Oracle DBA

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 18 Comments.
Start Free Trial
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 18 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