Remote connection to Oracle server operations Summary

Source: Internet
Author: User

When weRemote ServerOnOracle DatabaseDuring the operation, you should first establish a connection before calling RPC and other operations on the database on the remote server. The last thing to do is to disconnect and delete the link. This is a complete procedure for operating the Oracle database on the remote server. This article mainly introduces the implementation code of this process. Let's take a look at it.

Create a linked server linked to ORACLE:

 
 
  1. EXEC sp_addlinkedserver  
  2.  
  3.  @server = 'QZYDJK_Link',  
  4.  
  5.  @srvproduct = 'Oracle',  
  6.  
  7.  @provider = 'MSDAORA',  
  8.  
  9.  @datasrc = 'CSC25' 

Remotely link to the linked server:

 
 
  1. EXEC sp_addlinkedsrvlogin  
  2.  
  3.  @rmtsrvname = 'QZYDJK_Link',  
  4.  
  5.  @useself = 'false',  
  6.  
  7.  @locallogin = NULL,  
  8.  
  9.  @rmtuser = 'xxxx',  
  10.  
  11.  @rmtpassword = '1234' 

Enable the remote call process RPC on the remote connection Server:

 
 
  1. EXEC sp_serveroption  
  2.  
  3.  @server = 'QZYDJK_Link',  
  4.  
  5.  @optname = 'rpc out',  
  6.  
  7.  @optvalue = true 

Query data on a remote connection Server:

 
 
  1. EXEC  
  2.  
  3. ('SELECT * FROM table'  
  4.  
  5. )  
  6.  
  7. AT QZYDJK_Link 

Disconnect the remote connection Server:

 
 
  1. EXEC sp_droplinkedsrvlogin 'QZYDJK_Link',NULL; 

Delete remote connection server link:

 
 
  1. EXEC sp_dropserver [QZYDJK_Link] 

This article describes how to establish a remote connection to the Oracle database and operate data on the remote server. We hope you can get some help from this introduction. Thank you for your reference!

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.