SQL Server transfers data to Oracle

Source: Internet
Author: User
/* -------------------- Create an oracle linked server --------------------*/ Exec Sp_addmediaserver @ Server = 'Orcl' , -- Orcl is the link server name in SQL @ srvproduct = 'Oracle' , -- Oracle fixed @ provider = 'Msdaora' , -- Msdaora fixed @ datasrc = 'Orcl' -- Datasrc local service name Go  Exec Sp_add1_srvlogin 'Orcl' , False , 'Sa' , 'Scott' , 'Admin' -- SA is an SQL local Logon account, and POS/POS is an oracle Logon account. However, this statement does not help us. -- Test Select * From Orcl .. Scott. EMP -- Note uppercase/* ----------------------- create an sqlserver link server ------------------------------------*/ Exec Master. DBO. sp_addmediaserver @ Server = N '1970. 168.0.170' , @ Srvproduct = N 'SQL Server'  Go  Exec Sp_add1_srvlogin '1970. 168.0.170' , 'False' , 'Sa' , 'Sa' , '123'  Go Select * From [192.168.0.170]. Pubs. DBO. Authors -- you can use DTS to create the table structure on the target Oracle/* ------------------------ import data ------------------------------------------------------*/ Select * From Orcl.. Scott. zx_nrinsert orcl... Scott. Authors Select * From Authors insert orcl... Scott. Employee Select * From Employee insert orcl..scott.jobs Select * From Jobs insert orcl... Scott. Stores Select *From Stores insert orcl... Scott. Sales Select * From [192.168.0.170]. Pubs. DBO. salesinsert orcl... Scott. zx_xx Select   Top 100 WJ
 
From[192.168.0.170]. vsatdata. DBO. zx_xxWhereLx ='2'Insert orcl... Scott. zx_nrSelect Top10 *From[192.168.0.170]. vsatdata. DBO. zx_nr
  where  WJ  in  ( select   top  100 WJ  from  [192.168.0.170]. vsatdata. DBO. zx_xx  where  Lx =  '2' )  select   top  10 *  from  [192.168.0.170]. vsatdata. DBO. zx_gp_nr 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.