Four methods and precautions for setting remote connection for Oracle databases

Source: Internet
Author: User

Oracle DatabaseOfRemote connectionThis can be achieved through multiple methods. This article describes four methods and precautions for remote connection, and describes them through examples. Next we will introduce them.

First case:

If the oracle server is installed on the local machine, That is not to mention. The connection is just a matter of user name and password. However, check whether the environment variable % ORACLE_HOME %/network/admin/is set.

Case 2:

The oracle server is not installed or the oracle client is not installed. However, pl SQL development, toad SQL development, SQL navigator, and other database management tools are installed. An oracle server is installed on a virtual machine or another computer, that is, a virtual machine or another computer.

In this case, I use pl SQL development to remotely connect to the ORACLE server database as an example:

1. Search for the following files on the machine where the oracle server is installed:

  • Oci. dll
  • Ocijdbc10.dll
  • Ociw32.dll
  • Orannzsbb10.dll
  • Oraocci10.dll
  • Oraociei10.dll
  • Sqlnet. ora
  • Tnsnames. ora
  • Classes12.jar
  • Ojdbc14.jar

Copy these files to a folder, such as clientlient, and copy them to the client machine. For example, the placement path is D: \ clientlient.

2. Configure tnsnames. ora and modify the database connection string.

 
 
  1. oracledata =  
  2.  
  3. (DESCRIPTION =  
  4.  
  5. (ADDRESS_LIST =  
  6.  
  7. (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.58)(PORT = 1521))   
  8.  
  9. (CONNECT_DATA =  
  10.  
  11. (SERVICE_NAME = oracledata)   
  12.  

Here, oracledata is the service name to be connected; HOST = 192.168.0.58 is the Server IP address; PORT = 1521 is the PORT number.

3. Add the first environment variable named TNS_ADMIN with the value tnsnames. the path of the ora file is D: \ clientlient, especially after reinstallation or other operations. If you forget the TNS_ADMIN variable, the connection identifier cannot be parsed when you log on to plsql ), this is to find the tnsnames mentioned above. ora. This step is the most important.

Add the second environment variable (optional): "NLS_LANG = SIMPLIFIED CHINESE_CHINA.ZHS16GBK" (AMERICAN_AMERICA.US7ASCII is of the ASCII encoding type. For other types, go to the server and check it online) this step is currently correct. If the encoding is incorrect, garbled characters will be generated ).

4. download and install the pl SQL Developer configuration application:

Open pl SQL Developer, click Cancel on the logon page, and choose tools> preferences> connection:

 
 
  1. Oracle Home=D:\oracleclient  
  2.  
  3. OCI library=D:\oracleclient\oci.dll 

5. If you enable plsql again, you can log on to the database by entering the username and password with the oracledata option.

Case 3:

ORACLE server is not installed on this machine, but the oracle client is installed. pl SQL development, toad SQL development, SQL navigator, and other database management tools are also installed. An oracle server is installed on a virtual machine or another computer, that is, a virtual machine or another computer.

In this case, I use pl SQL development to remotely connect to the oracle server database as an example:

1. Open the net manager in the oracle client and configure the name and IP address of the database to be remotely connected. If the net manager does not have the name of the database to be remotely connected, create a new database.

2. The other steps are the same as 2-5 in the second case.

Case 4:

Oracle server is not installed on the local machine, pl SQL development, toad SQL development, SQL navigator, and other database management tools are not installed, but the oracle client is installed. An ORACLE server is installed on a virtual machine or another computer, that is, a virtual machine or another computer.

In this case, I use sqlplus in the oracle client to remotely connect to the oracle server database as an example:

1. Open the net manager in the oracle client and configure the name and IP address of the database to be remotely connected. If the net manager does not have the name of the database to be remotely connected, create a new database.

2. Same as step 2 in the second case.

3. In the same case as in step 3.

4. Enable sqlplus:

1) if you use sys to log on, log on to the database as sysdba with the username: sys password: xxxxxx host string.

2) if you use another user to log on, the user name: xxx password: xxxxxx host string: name of the database to be connected. log on.

Note:

1. The server and client firewalls must be disabled;

2. We often encounter that the listener service cannot be started, so we need to enable the Net Configuration Assistant to fix it, or create a new listener service.

3. What should I do if I forget my Database Password? Follow these steps to change the password:

Start --> Run --> cmd

Input: sqlplus/nolog press ENTER

Enter connect/as sysdba and press Enter.

Unlock user: alter user system account unlock press ENTER

Change Password: alter user system identified by manager

4. How can I determine whether the database is running in archive mode or non-archive mode?

Go to dbastudio, and choose history> database> archive.

5. If the oracle server is installed on both the local host and other hosts, you must modify the environment variables if the local host is connected to another host.

Here are the four methods and precautions for Oracle Database remote connection. I hope this introduction will bring you some benefits. Thank you!

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.