In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "how PLSQL connects to local or remote oracle databases". In daily operation, I believe many people have doubts about how PLSQL connects to local or remote oracle databases. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts of "how PLSQL connects to local or remote oracle databases". Next, please follow the editor to study!
Catalogue
Preface
Step1 copies network files
Step2 modify configuration file
2.1 modify the oracle database file
2.2 modify the oracle database file
2.3 modify client files
Step3 configuration OCI
Step4 environment variable configuration
Step5 restart the computer (sometimes it is not necessary to restart)
Step6 log in to plsqlboys!
Preface
Every time after installing Oracle, there will be a problem that you can't connect with plsql! After many painful experiences of rebooting the computer and reinstalling the system
You and I are lucky to see this article today! Hope to help the majority of technical staff to reduce some time, smooth connection!
Note: you can also use plsql to connect to a remote database (as long as you have oracle's network\ admin\ tnsnames.ora).
First download 64-bit oracle and 32-bit lightweight clients (note that the version corresponds to 11g oracle and 11.2 clients):
Click to go to the oracle download page and click to go to the client download page
Please change the path by yourself in the following steps, otherwise, don't blame me for making a mistake:
Step1 copies network files
Oracle installation to a certain path, the installation steps are very simple, can be found online!
The client is randomly unzipped to a path, and mine is put in D:\ app\ shuhao\ instantclient_11_2.
Then copy the entire network folder in D:\ app\ shuhao\ product\ 11.2.0\ dbhome_1 in oracle
Paste into the client folder D:\ app\ shuhao\ instantclient_11_2, as shown in the following figure:
Step2 modify configuration file 2.1 modify oracle database file
D:\ app\ shuhao\ product\ 11.2.0\ dbhome_1\ NETWORK\ ADMIN\ listener.ora file contents, add a SID_DESC:
# listener.ora Network Configuration File: d:\ app\ shuhao\ product\ 11.2.0\ dbhome_1\ network\ admin\ listener.ora# Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_NAME = CLRExtProc) (ORACLE_HOME = D:\ app\ shuhao\ product\ 11.2.0\ dbhome_1) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:D:\ app\ shuhao\ product\ 11.2.0\ dbhome_1\ bin\ oraclr11.dll") # SID_DESC is a new addition Notice to modify the ORACLE_HOME path (SID_DESC = (SID_NAME = orcl) (ORACLE_HOME = D:\ app\ shuhao\ product\ 11.2.0\ dbhome_1) (GLOBAL_DBNAME = orcl)) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521)) ADR_BASE_LISTENER = D:\ app\ shuhao2.2 modify the oracle database file
D:\ app\ shuhao\ product\ 11.2.0\ dbhome_1\ NETWORK\ ADMIN\ tnsnames.ora file contents, the source file has not been changed:
# tnsnames.ora Network Configuration File: d:\ app\ shuhao\ product\ 11.2.0\ dbhome_1\ network\ admin\ tnsnames.ora# Generated by Oracle configuration tools. ORACLR_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = orcl) LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521) ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521)) DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)) 2.3 modify client files
D:\ app\ shuhao\ instantclient_11_2\ network\ admin\ tnsnames.ora file contents:
# tnsnames.ora Network Configuration File: d:\ app\ shuhao\ product\ 11.2.0\ dbhome_1\ network\ admin\ tnsnames.ora# Generated by Oracle configuration tools. ORACLR_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = orcl) LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521) ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521)) DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)) # add @ identifier Used to distinguish between local and remote oracleORCL@192.168.0.164 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.164) (PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)) step3 configuration OCI
Do not log in to plsql, press Cancel directly, and then configure the OCI whose OCI is a 32-bit client in Tools--- > Preferences---- > Connection
D:\ app\ shuhao\ instantclient_11_2\ oci.dll
Step4 environment variable configuration
Add the first 2 system variables:
1. Variable name: TNS_ADMIN
Variable value: d:\ app\ shuhao\ instantclient_11_2\ network\ admin
two。 Variable name: NLS_LANG
Variable value: SIMPLIFIED CHINESE_CHINA.ZHS16GBK
3. Configure to join in Path:
D:\ app\ shuhao\ product\ 11.2.0\ dbhome_1\ BIN;D:\ app\ shuhao\ instantclient_11_2
Step5 restart the computer (sometimes it is not necessary to restart)
Start the oracle service and snooping, this does not need to be described.
Step6 log in to plsqlboys!
When you see the local ORCL and remote ORCL@192.168.0.164 in the Database drop-down box, it is considered a success!
At this point, the study on "how PLSQL connects to a local or remote oracle database" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.