Home>

The remote connection of the oracle database can be achieved in many ways,In this article, we mainly introduce four methods and precautions for remote connection.And illustrated by example,Next we will introduce

the first method:

If the oracle server is installed on this machine,Not much to say thenThe connection is just a matter of username and password.

However, pay attention to whether the environment variable%oracle_home%/network/admin/is set.

The second method:

No oracle server or oracle client is installed on this machine. But installed pl sql development, toad sql development, sql navigator and other tools to manage the database.An oracle server is installed on a virtual machine or another computer, that is, the virtual machine or another computer serves as the server at this time.

In this situation,I take pl sql development to connect to the oracle server database remotely as an example:

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

code show as below:

oracledata =
(description =
(address_list =
(address=(protocol=tcp) (host=192.168.0.58) (port=1521))
(connect_data =
(service_name=oracledata)
)

Among them, oracledata is the name of the service to be connected;host=192.168.0.58 is the server IP address;port=1521 is the port number.

2. Add the first environment variable,The name is tns_admin, and the value is the path where the tnsnames.ora file is located (such as:d:\ oraclient, especially after reinstallation or other operations,Forget the tns_admin variable, plsql login will report that it cannot resolve the specified connection identifier), this is to be able to find the tnsnames.ora mentioned above. This step is the most important.

Add a second environment variable (optional):"nls_lang=simplified chinese_china.zhs16gbk", (american_america.us7ascii is the ascii encoding type,For other types, you can check it on the server or find it online.)If the encoding is incorrect,Garbled).

3. Download and install the pl sql developer configuration application:

Open pl sql developer, click cancel on the login interface,Select the menu bar tools->preferences->connection after entering:

Oracle home=d:\ oracleclient

Oci library=d:\ oracleclient \ oci.dll

4, open plsql again will have oracledata option in the database, enter the user name and password to log in.

The third method:

The machine is not installed on this machine, but the oracle client is installed, and pl sql development, toad sql development, sql navigator and other tools for managing the database are installed.An oracle server is installed on a virtual machine or another computer, that is, the virtual machine or another computer serves as the server at this time.

In this situation,I take pl sql development to connect to the oracle server database remotely 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 database name to be connected remotely in the net manager,Just create a new one.

2. The other steps are the same as in the second method.

The fourth method:

Oracle server is not installed on this machine, and pl sql development, toad sql development, sql navigator and other tools for managing databases are not installed.But the oracle client is installed. An oracle server is installed on a virtual machine or another computer, that is, the virtual machine or another computer serves as the server at this time.

In this situation,I take the 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 database name to be connected remotely in the net manager,Just create a new one.

2. Same as step two in the second case.

3. Same as step three in the second case.

4. Open sqlplus:

(1) If you log in as the sys user,Then user name:sys password:xxxxxx host string:database name to connect as sysdba, just log in.

(2) If you log in with another user,Then username:xxx password:xxxxxx host string:the name of the database to connect to,Just sign in.

Precautions:

1. The server and client firewalls need to be turned off;

2, we often encounter that the listener service cannot be started,Then you need to open the net configuration assistant to repair or create a new listener service.

3. What if I forget the database password?Just change the password as follows:

Start->Run->cmd

Enter:sqlplus/nolog Enter

Enter:connect/as sysdba

User unlock:alter user system account unlock

Change password:alter user system identified by manager

4, how to determine whether the database is running in archive mode or non-archive mode?

Enter dbastudio, history->database->archive view.

5. In addition, if the oracle server is installed on this machine and other machines,Then if this machine is to be connected to another machine,You must modify the environment variables.

  • Previous Detailed explanation of setting default value and event of select usage in Angular2
  • Next AngularJS built-in service $http to the database addition, deletion and modification of the tutorial