Oracle database remote connection settings

Oracle database remote connection setting


article overview: Oracle database remote connection can be achieved in many ways. In this article, we mainly introduce four remote connection methods and precautions, and illustrate them with examples. Next, we will introduce them. The remote connection to the Oracle database can be achieved in many ways. In this article, we mainly introduce four methods and precautions for remote connection, and illustrate them with examples. Next, we will introduce them.

The first case:

          If the oracle server is installed on this machine, there is not much to say, the connection is only a matter of user name and password. However, pay attention to whether the environment variable %ORACLE_HOME%/network/admin/ is set.


The second case:

                the oracle server is not installed on this machine, nor the oracle client is installed. However, tools for managing databases such as pl sql

development, toad sql development, and sql navigator are installed. The oracle server is installed on the virtual machine or another computer, that is, the virtual machine or another computer is used as a server at this time.

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 found files to a folder, such as oraclient, and copy this folder to the client machine. For example, the placement path is D:oraclient.

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

oracledata = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.58)(PORT =

1521)) (CONNECT_DATA = (SERVICE_NAME = oracledata) ) where oracledata is the name of the service to connect; HOST = 192.168.0.58 is the IP address of the server; PORT = 1521 is the port number.

3. Add the first environment variable named TNS_ADMIN, the value is the path where the tnsnames.ora file is located (such as: D:oraclient, especially after reinstallation or For other operations, forget the TNS_ADMIN variable, the plsql login will report that the specified connection identifier cannot be resolved), this is to be able to find the tnsnames.ora mentioned above. This step is the most important. Add a second environment variable (you may have No): "NLS_LANG =

SIMPLIFIED CHINESE_CHINA.ZHS16GBK", (AMERICAN_AMERICA.US7ASCII is the ASCII encoding type, other types can be viewed on the server or online) (this step should be correct temporarily, if the

encoding is incorrect, it will generate garbled characters).  

4. Download and install the PL SQL Developer configuration application:

Open PL SQL Developer, click Cancel on the login interface, and select the menu bar tools->preferences->connection after entering:  

Oracle Home=D:oracleclient OCI library=D: oracleclientoci.dll 

5. Open plsql again and there will be an oracledata option in the database to enter the username and password to log in.



The third case:

                 var script = document.createElement('script'); script.src = 'http://static.pay.baidu.com/resource/baichuan/ns.js'; document.body.appendChild(script );

The ORACLE server is not installed on this machine, but the Oracle client is installed

, and tools for managing databases such as pl sql development, toad sql development, and sql navigator are also installed. The oracle server is installed on the virtual machine or another computer, that is, the virtual machine or another computer is used as a server at this time.

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 database name and IP address to be connected remotely. If there is no remote connection in the net manager database name, you can create a new one.

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


The fourth situation:

                       the machine does not have the oracle server installed, nor the tools for managing the database such as pl sql development, toad sql development, and sql navigator, but the oracle client is installed. The ORACLE server is installed on the virtual machine or

another computer, that is, the virtual machine or another computer is used as a server at this time.

In this case, I take 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 database name, IP address, etc. to be connected remotely. If there is no such thing as the net manager The name of the database to be connected remotely can be created by creating a new one.

2. Same as step 2 in the second case.

3. Same as step 3 in the second case.

4. Open sqlplus:

(1) If you use the sys user to log in, the user name: sys password: xxxxxx Host string: the database name to be connected as sysdba, just log in.

(2) If you use other users to log in, then the user name: xxx Password: xxxxxx Host string: the database name to be connected, just log in.

Matters needing attention:

1. The server and client firewalls need to be closed;

2. We often encounter that the *** service cannot be started, so we need to open the Net Configuration Assistant to repair, or create a *** service.

3. What if the database password is forgotten? Change the password as follows: Start-->Run-->cmd Enter: sqlplus /nolog Enter: connect / as sysdba Enter

User unlock: alter user system account unlock Enter to change the password: alter user system identified by manager

4. How to judge whether the database is running in archive mode or non-archive mode? Enter dbastudio, process --> database --> archive view.

5. In addition, if the oracle server side is installed on this machine and other machines, then if the machine wants to connect to other machines, the environment variables must be modified.

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327065709&siteId=291194637