Get the App
SLTechnology News&Howtos  ›  Database  › 

My process of getting data from a remote oracle view

Shulou Source: shulou.com Published: 2022-06-01 10:28:55 10月03日 Update

Three oracle objects are involved here, one is the customer's view, one is the oracle on the transfer station server provided by the customer, and the other is the oracle of our own development machine. Finally, we develop and use the oracle data of our own development machine for development. After the development is completed, we change the oracle source to the customer's view source, and deploy the product to the transfer station provided by the customer. And the oracle of the transit station is no longer needed and can be stopped. In fact, the web product is deployed on another node, which provides a place for computing processors to live. The following describes the specific steps for me to access the development data. I import and export in the form of a table, and the data pump of oracle is used.

Verify whether the connection is possible, assuming that the user password is xsc, the remote ip is 192.168.2.2, the instance port is 9010, and the instance name is orcltyg

Scan instance port: nmap remote ip

Sqlplus "xsc" / "xsc" @ 192.168.2.2:9010/orcltyg

Install oracle11g silently on this machine (brief)

Create tablespaces and oracle users locally. Assume that the user is xsc, and the data tablespace is xsc,temp tablespace xsctemp.

Create temporary tablespace xsctemp tempfile'/ opt/oracle/oradata/orcl/xsctemp.dbf' size 1000m autoextend on next 1000m maxsize unlimited extent management local

Create tablespace xsc logging datafile'/ opt/oracle/oradata/orcl/xsc.dbf' size 1000m autoextend on next 1000m maxsize unlimited extent management local autoallocate segment space management auto

Create user xsc identified by xsc default tablespace xsc temporary tablespace xsctemp

Grant connect,resource,dba to xsc

Create a dblink to the remote 192.168.2.2

Create database link orcltyglink connect to xsc identified by "xsc" using'(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.2.2) (PORT = 9010)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCLTYG)'

Select * from xsjl@orcltyglink

Use dblink to connect remote view to select data to create a local table xsjl

Create table xsjl as select * from xsjl@orcltyglink

Select a row to look at

Select * from xsjl where rownum

Tags: Development data customer transit view relay station instance user space product port native authentication one line three host site backup actually actually Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Huawei Shulou Tech Info Redmi MySQL