PL/SQL developer connect to remote ORACLE

Source: Internet
Author: User

Client installed on the local machine

Find the % ORACLE_HOME % \ Network \ admin \ tnsnames. ora (D: \ oracle \ product \ 10.2.0 \ db_2 \ Network \ ADMIN) file and add it to the file:

201_orcl =
(Description =
(Address = (Protocol = TCP) (host = 172.168.201) (Port = 1521 ))
(CONNECT_DATA =
(Server = dedicated)
(SERVICE_NAME = cnaps2)
)
)

Note: The value of SERVICE_NAME

Select 201_orcl in the database of PL/SQL, and enter the user name and password.

========================================================== ==================================

Oracle can be remotely connected using PLSQL without installing a client


Every time I ask people whether PLSQL can connect to the server remotely, they say they want to install the client. Remember what SQL deveplore or other tools have been used before, and there is no need to install the client, in addition, it comes from the green software. I just want to solve this problem, so you don't have to bother installing the client. I searched for it online. Next I will record the detailed process of my practice. I hope it will be helpful to you. If anything is wrong, please comment on it and point it out.
First, installOracleSearch for the following files on the server machine,
OCI. dll
Ocijdbc10.dll
Ociw32.dll
Orannzsbb10.dll
Oraocci10.dll
Oraociei10.dll (the server may not exist. If not, you can log on to pl SQL with the username and password)
Sqlnet. ora
Tnsnames. ora
Classes12.jar
Ojdbc14.jar
Put it in a folder, such as your lient
2. Configure tnsnames. ora. If Oracle is not installed on the local machine, copy one (tnsnames. the ora file is under % ORACLE_HOME % \ Network \ ADMIN) in the Directory D: \ clientlient above.
Oracledata =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = 192.168.0.58) (Port = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = oracledata)
)
)

3. Add an environment variable named tns_admin with the value tnsnames. the path of the ora file (for example, D: \ release lient, especially after reinstallation or other operations, if you forget the tns_admin variable, PLSQL logs in and reportsThe specified connection identifier cannot be resolved.) To find tnsnames. ora. If Oracle is installed on the local machine and the ORACLE_HOME environment variable is set, the tnsnames. ora file is automatically located in % ORACLE_HOME %/Network/admin.

4. Set the Oracle language and add environment variables:
"Nls_lang = simplified chinese_china.zhs16gbk)
(This step is currently correct. If the encoding is incorrect, garbled characters will be generated)

5. download and install the Pl. SQL. developer configuration application
Configure tools> preferences> connection
Oracle Home = D: \ oracleclient
OCI library = D: \ oracleclient \ OCI. dll

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

========================================================== ===

Meanings and differences of SERVICE_NAME and Sid in tnsname. ora



Sid is equivalent to the Instance name of SQL Server. the difference is that the next instance of SQL Server can have multiple databases, and the next instance of Oracle corresponds to a database. (several instances under Oracle RAC can correspond to one database .)


Service_names = db_name. db_domain ========================

A database has many initialization parameters, db_name and db_domain. The two are connected together with a complete database service name.

============================

"One Sid corresponds to one database" is correct, "SERVICE_NAME corresponds to the entire Oracle, including all Sid" is not like this. SERVICE_NAME refers to the name of your database that provides external services, excluding Sid.

========================================

Sid is the operating system identifier!

In the distributed database system, the global database name is db_name.domain_name. If it is a single database, we usually only have db_name, which is the same as Sid.

==========================================

Assume that your Sid is orcl, the global database name is orcl.zhxuef.oracle.com, and the host name is zhxf.


Assume that when you connect to SQL on the server, you use the service name orcl;

Assume that you use the service name orcl_zhxf when connecting to SQL on the database client.

Otherwise, you may not be able to connect to SQL, such as SQL * Plus.


You can try it. You will know the difference.


Does a SERVICE_NAME contain several Sid IDs? For this sentence, I think the question is a bit biased. The service name is the database ID used for connection, and the SID is the database Operating System ID, not the same monk. The service name is one or more service names that can be used when the customer service connects to the routine.


SERVICE_NAME = db_name. db_domain this is the default value. As I said above, in a single database, you may see SID = DB-name = routine name = SERVICE_NAME, which is easy to confuse.

==========================================

Sid is the identifier of the Oracle instance. Different Sid corresponds to different memory buffers (SGA) and different background processes.


SERVICE_NAME indicates the global database name when a database domain name exists.

If there is no database domain name, it is the database name


Confusing terms:

Db_name: the unique identifier of a database (Oracle Database). This database is the Oracle database mentioned in Chapter 1. This expression is sufficient for a single database, but with the popularization of distributed databases composed of multiple databases, this method of Command database creates a certain burden on database management, because the names of various databases may be the same, resulting in management confusion. To solve this problem, the db_domain parameter is introduced. In this way, the database ID is determined by the two parameters db_name and db_domain, avoiding management confusion caused by database name duplication. This is similar to managing machine names on the Internet. We connect the parameters db_name and db_domain with '.' to indicate a database, and the database name is global_name, that is, it extends db_name. The db_name parameter can only contain letters, numbers, '_', '#', and '$', and can contain a maximum of 8 characters.



Db_domain: defines the domain where a database is located. The domain name has nothing to do with the 'region' on the Internet. It is determined by the database administrator in order to better manage the distributed database. Of course, to facilitate management, it can be equal to the domain of the Internet.



Global_name: the unique identifier of a database (Oracle Database). We recommend that you use this method to command the database. This value is determined when you create a database. The default value is db_name. db_domain. Any modifications to the parameters of db_name and db_domain In the parameter file will not affect the value of global_name. To modify global_name, you can only use the alter database rename global_name to <db_name.db_domain> command to modify it, modify the parameters.



SERVICE_NAME: this parameter is newly introduced by Oracle8i. Before 8i, we used Sid to identify an instance of the database. However, in the parallel environment of Oracle, a database corresponds to multiple instances, so that multiple network service names are required, configuration is cumbersome. To facilitate the setting in the parallel environment, the SERVICE_NAME parameter is introduced, which corresponds to a database rather than an instance, and has many other advantages. The default value of this parameter is db_name. db_domain, which is equal to global_name. A database can correspond to multiple service_names for more flexible configuration. This parameter has no direct relationship with Sid, that is, the service is not required.
Name must be the same as Sid.



Net service name: the name of the network service, also known as the database alias (Database alias ). It is required when the client program accesses the database. It shields the details of how the client connects to the server and achieves the location transparency of the database.

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.