Teach you step by step how to use PLSQL to remotely connect to Oracle database [Intranet Penetration]

Preface

Oracle is a relational database management system from Oracle Corporation, which has always been a leader in the database field. It can be said that the Oracle database system is a popular relational database management system in the world. The system has good portability, easy use, and strong functions. It is suitable for various large, medium, and small computer environments. It is a database solution that is efficient, reliable and adaptable to high throughput.

In this tutorial, we will build an Oracle database locally, and map the local port to the public network through [cpolar intranet penetration] ( cpolar - a secure intranet penetration tool ), so that PL/SQL tools can be used in the public network environment. Perform remote connection access.

1. Database construction

Install the oracle database and enter the official download. The official 19C version is selected for installation here.

Select download Microsoft windows 64 bit download

2023021411601

After downloading, unzip and install. During the installation process, you need to set a password. The password is the password required for login.

2023021411602

After installation, open PL/SQL

2023021411603

After opening, enter the user name: system, and the password is the password set above. If sql appears, the login is successful.

2023021411604

2. Intranet penetration

Currently, the database can only be accessed within the LAN, but we can use the cpolar intranet penetration tool to map the intranet Oracle database to the public network to achieve remote access.

2.1 Install cpolar intranet penetration

cpolar official website: https://www.cpolar.com/

Enter the cpolar official website download page, download the windows installation package locally and then unzip it and install it by default.

20230214113215

2.2 Create tunnel mapping

After cpolar is installed successfully, double-click to open cpolar [or access the local 9200 port 127.0.0.1:9200 on the browser ], use the cpolar email account to log in to the web UI management interface, if you have not registered a cpolar account, click Free Registration, and you will jump to Just register an account on the cpolar official website.

20230214113806

After successful login, click Tunnel Management - Create Tunnel on the left dashboard to create a TCP protocol tunnel pointing to the local port 1521 (Oracle default port)

  • Tunnel name: It can be customized. Be careful not to duplicate the existing tunnel name.
  • Protocol: tcp
  • Local address: 1521
  • Domain name type: Choose a random domain name for free
  • Region: Default is China top

Click创建

2023021411605

After the tunnel is successfully created, click Status on the left - Online Tunnel List. You can see that the tunnel just created has generated a corresponding public network address. Copy it.

2023021411606

3. Public network remote access

Open the PLSQL graphical tool, enter the tcp public network address, enter the user name: systm and password. The password is the password set when creating the database.

2023021411607

After connecting, execute the check system table. If the data appears, it means success.

2023021411608·

4. Configure a fixed TCP port address

Since the tunnel created above is a random address tunnel, the address will change within 24 hours. In order to make the connection more stable, the TCP connection address needs to be fixed.

4.1 Reserve a fixed public network TCP port address

Log in to the cpolar official website, click Reserve on the left, and select the reserved TCP address. Let's first reserve a fixed port address for the remote Oracle.

  • Region: Select China VIP
  • Description: Notes, which can be customized

Click保留

2023021411610

After the address is successfully reserved, the system will generate the corresponding fixed public address and copy it.

2023021411611

4.2 Configure a fixed public network TCP port address

Access port 9200 on the browser, http://127.0.0.1:9200/, log in to the cpolar web ui management interface, click Tunnel Management - Tunnel List on the left dashboard, find the svn tunnel, and click Edit on the right

2023021411612

Modify the tunnel information and configure the successfully reserved fixed tcp address into the tunnel.

  • Port type: modified to fixed tcp port
  • Reserved tcp address: fill in the successfully reserved address

Click更新

2023021411613

After the tunnel is successfully updated, click the status on the left dashboard - Online Tunnel List, find the Minecraft Tunnel, and you can see that the public network address has been updated to a fixed TCP address.

2023021411614

4.3 Test remote Oracle using fixed TCP port address

Open PLsql again and connect using a fixed tcp address

2023021411615

After logging in, execute the query system table select * from DBA_TABLES. If the data appears, the connection is successful.

2023021411616

Reprinted from cpolar pole cloud article: Using PLSQL to remotely connect to the Oracle database on the public network [intranet penetration]

Guess you like

Origin blog.csdn.net/fq157856469/article/details/133272463