Tag Archives: oracle

-bash: sqlplus: command not found [How to Solve]

Error description

$ sqlplus/as sysdba
-bash: sqlplus: command not found

Treatment method

View environment.bash_ Profile configuration

$ find -name .bash_profile
./.bash_profile
$ pwd
/home/oracle
$ vi .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

#add by rui on 20210715
export ORACLE_BASE=/oracle/app
export ORACLE_HOME=$ORACLE_BASE/oracle/product/12.1.0/dbhome_1 --Configuration error, change to [1]
export ORACLE_SID=rui1
export PATH=$HOME/bin:$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

[1] export ORACLE_ HOME=$ORACLE_ BASE/product/12.1.0/dbhome_ one

Open a new window and enter the command again

$ sqlplus/as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Jul 15 04:42:11 2021

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL>

It can be seen that the problem has been successfully solved
the reason for this error is $oracle_ Home configuration error.

Several problems caused by device encryption

Description: ora-12541tns no monitor program + velvet software icon turns black

Problem Description:                 

         After Oracle is unloaded and reloaded, ora-12541tns no monitor program will not appear for the time being, and then the problem of restarting the computer appears again — the problem solved from the perspective of Oracle (this problem will appear again in a few days after it is solved through other operations — the above error occurs when opening PL/SQL developer software.)

         At the same time, the tinder software icon turns black or the tinder software installation pop-up cannot be installed in the encrypted directory (prompt: when the tinder is installed in other disks other than disk C.).

        At this point, the big probability is due to the problem of device encryption.

resolvent:

        Turn off device encryption settings.

Process (simple operation, just two steps)

1. Window + Q output “device encryption”( The window key icon is similar to the key of the window where the window is turned on. It is generally located near FN in the lower left corner.)

2. Select close( It will take some time)

         I was puzzled by this problem for a period of time. During this period, I solved it through online methods. I even uninstalled Oracle and then reloaded it. At that time, it was solved and there was no problem. However, the problem will still appear later, which is more annoying.

         Later, I found out the problem. The problem is quite special and the solution is also quite special. I would like to share it with those who encounter similar and partial problems. Finally, I hope I can help you solve the problem.

       

      

Ora-02292: integrity constraint (XX) violated – child record found foreign key Association, record cannot be deleted

When we delete data with foreign keys, Oracle will prompt: ora-02292: integrity constraint (XX) violated – child record found  

Step 1: invalidate the primary key: alter table_ name disable primary key cascade;

Step 2: delete from   table_ name   where id = ‘xx’;

Step 3: make the primary key effective: alter table_ name enable primary key;

Java.sql.sqlexception: unable to read more data from socket

Some online is to modify the configuration, I tried no effect, later found that because the query statement, the subquery contains the order statement, the subquery Order to remove the problem. This statement through the PLSQL direct query is no problem, but through the jdbc background query will report an error.
error:
exe_sql = select * from (select t1.*, rownum r from ( select device_site.major,device_site.site_code,device_site.type_code,device_site.site_type,device_site.site_name,device_site.site_prop,device_site.site_level,device_site.site_allname,device_site.major_code,device_site.site_comname,device_site.rule_name,device_site.special,device_site.install_site,device_site.arrive,device_site.pinyin,device_site.house_code,device_site.dept_name,device_site.area,device_site.photo,device_site.mi_num,device_site.wmi_num,device_site.site_supe_code,device_site.memo,device_site.site_id from device_site where (site_id like (select site_id || ‘%’ from water_reg where water_id=?)) order by site_code asc) t1 where rownum < 51) t2 where t2.r > 0
where_type = string
where_value = eam-704-556
2021-06-28 13:55:31 jxstar: org.jxstar.dao.DaoUtil.showException on line: -1
java.sql.SQLException:Unable to read more data from a socket
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1200)
at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1155)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:279)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:205)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:861)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1145)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1267)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3493)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1203)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.jxstar.dao.JsonDao.query(Unknown Source)
at org.jxstar.service.query.GridQuery.query(GridQuery.java:139)
at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.jxstar.service.control.ControlerUtil.invoke(Unknown Source)
at org.jxstar.service.control.ControlerUtil.executeEvent(Unknown Source)
at org.jxstar.service.control.ServiceControllerImp.execute(Unknown Source)
at org.jxstar.control.action.CommonAction._$1(Unknown Source)
at org.jxstar.control.action.CommonAction.execute(Unknown Source)
at org.jxstar.control.AjaxController.processRequest(Unknown Source)
at org.jxstar.control.AjaxController.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jxstar.control.filter.JxstarFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jxstar.control.filter.XSSFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:610)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:503)
at java.lang.Thread.run(Thread.java:745)
2021-06-28 13:55:31 jxstar: org.jxstar.service.query.GridQuery.query on line: 141
warn: grid query error!
2021-06-28 13:55:31 jxstar: org.jxstar.service.control.ServiceControllerImp.execute on line: -1
org.jxstar.dao.transaction.TransactionException: tranobject.rollback:Unable to read more data from a socket
at org.jxstar.dao.transaction.TransactionObjectImp.rollback(Unknown Source)
at org.jxstar.dao.transaction.TransactionManagerImp.rollbackTran(Unknown Source)
at org.jxstar.service.control.ServiceControllerImp.execute(Unknown Source)
at org.jxstar.control.action.CommonAction._$1(Unknown Source)
at org.jxstar.control.action.CommonAction.execute(Unknown Source)
at org.jxstar.control.AjaxController.processRequest(Unknown Source)
at org.jxstar.control.AjaxController.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jxstar.control.filter.JxstarFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jxstar.control.filter.XSSFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:610)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:503)
at java.lang.Thread.run(Thread.java:745)
2021-06-28 13:55:34 jxstar: request is have file upload: false

[Solved] SpringBoot Integrating Oracle reports errors: ORA-12504, TNS:listener was not given the SID in CONNECT_DATA

Obviously, an error is reported here, saying that Sid cannot be obtained. Obviously, the path is wrong. Check whether the path is completely written?

The error is as follows

java.sql.SQLException: Listener refused the connection with the following error:
ORA-12504, TNS:listener was not given the SID in CONNECT_DATA
 
	at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:480) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:413) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-4.0.3.jar:na]
	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar:na]
	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar:na]
	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) [HikariCP-4.0.3.jar:na]
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) [HikariCP-4.0.3.jar:na]
	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) [HikariCP-4.0.3.jar:na]
	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) [HikariCP-4.0.3.jar:na]
	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:158) [spring-jdbc-5.3.8.jar:5.3.8]
	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:116) [spring-jdbc-5.3.8.jar:5.3.8]
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79) [spring-jdbc-5.3.8.jar:5.3.8]
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:330) [spring-jdbc-5.3.8.jar:5.3.8]
	at org.springframework.boot.jdbc.EmbeddedDatabaseConnection.isEmbedded(EmbeddedDatabaseConnection.java:184) [spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializer.isEmbeddedDatabase(DataSourceScriptDatabaseInitializer.java:64) [spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.isEnabled(AbstractScriptDatabaseInitializer.java:87) [spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.initializeDatabase(AbstractScriptDatabaseInitializer.java:74) [spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.afterPropertiesSet(AbstractScriptDatabaseInitializer.java:65) [spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1845) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.8.jar:5.3.8]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.8.jar:5.3.8]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[spring-boot-2.5.1.jar:2.5.1]

solve

jdbc:oracle:thin:@xxx:1521:orcl/xe

ls: cannot access /usr/sbin/smartctl: No such file or directory /usr/sbin/smartctl not found

When installing 11g RAC, an error was reported when installing cvuqdisk-1.0.9-1.rpm package

Oracle version: 11.2.0.4 RAC
operating system version: Oracle_ Linux7.9

# rpm -ivh cvuqdisk-1.0.9-1.rpm 
Preparing...                          ################################# [100%]
ls: cannot access /usr/sbin/smartctl: No such file or directory
/usr/sbin/smartctl not found.
error: %pre(cvuqdisk-1.0.9-1.x86_64) scriptlet failed, exit status 1
error: cvuqdisk-1.0.9-1.x86_64: install failed

Reason: lack of smartctl command
solution: install Smartmontools toolkit : Yum install - y Smartmontools installation

The output is as follows:

# yum install -y smartmontools
Loaded plugins: ulninfo
Resolving Dependencies
--> Running transaction check
---> Package smartmontools.x86_64 1:7.0-2.el7 will be installed
--> Processing Dependency: mailx for package: 1:smartmontools-7.0-2.el7.x86_64
--> Running transaction check
---> Package mailx.x86_64 0:12.5-19.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================
 Package                    Arch                Version                    Repository             Size
=======================================================================================================
Installing:
 smartmontools              x86_64              1:7.0-2.el7                ol7_base              546 k
Installing for dependencies:
 mailx                      x86_64              12.5-19.el7                ol7_base              244 k

Transaction Summary
=======================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 790 k
Installed size: 2.4 M
Downloading packages:
(1/2): mailx-12.5-19.el7.x86_64.rpm                                             | 244 kB  00:00:00     
(2/2): smartmontools-7.0-2.el7.x86_64.rpm                                       | 546 kB  00:00:00     
-------------------------------------------------------------------------------------------------------
Total                                                                  5.5 MB/s | 790 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mailx-12.5-19.el7.x86_64                                                            1/2 
  Installing : 1:smartmontools-7.0-2.el7.x86_64                                                    2/2 
  Verifying  : mailx-12.5-19.el7.x86_64                                                            1/2 
  Verifying  : 1:smartmontools-7.0-2.el7.x86_64                                                    2/2 

Installed:
  smartmontools.x86_64 1:7.0-2.el7                                                                     

Dependency Installed:
  mailx.x86_64 0:12.5-19.el7                                                                           

Complete!
# 

Perform the installation again:

# rpm -ivh cvuqdisk-1.0.9-1.rpm 
Preparing...                ########################################### [100%]
Using default group oinstall to install package
   1:cvuqdisk               ########################################### [100%]

Navicate premium Connecting to a remote Oracle,ORA-12514: TNS:listener does not currently know of service requested in c

Navicate premium, ora-12514: TNS: listener does not currently know of service requested in connect descriptor

Ora-12514: TNS: listener does not currently know of service requested in connect descriptor

many methods on the Internet are to modify tnsnames.ora and listener.ora files, but the results are useless check the tnsnames.ora file and find that the service name is orcl.localdomain instead of orcl by default. Login successfully after modification

[Two Methods] Ora-00904: invalid group by error identifier

I believe many students encounter the problem of invalid prompt identifier when using group by. Don’t worry, let’s summarize the common solutions to this problem:

Example: take the information of the youngest employee in each department
my SQL statement is as follows:

select name,min(age),(select deptname from dept d where d.deptid=uif.deptid)deptname from userinfo uif group by name,deptname

When you click execute, the system prompts:

ORA-00904:"deptname":Identifier is invalid

Error reason: the field after group by cannot be an alias (if you want to use an alias, you need to nest it at one level)

Solution 1:

--goup by The department name (alias: deptname ) is directly used in the deptid field of the employee information table
select name,min(age),(select deptname from dept d where d.deptid=uif.deptid)deptname from userinfo uif group by uif.name,uif.deptid

Solution 2:

--Grouping after one level of nesting
select us.name,min(us.age),us.deptname from (select name,age,(select deptname from dept d where d.deptid=uif.deptid)deptname from userinfo uif)us
group by us.name,us.deptname

How about this time?If you have any questions, please leave a message to study together~

PLSQL environment variable configuration tnsnames.ora file path

1、 Directory structure

D:\install\PLSQL
    |-- instantclient_11_2
        |-- tnsnames.ora
    |-- PLSQL Developer
    |-- readme.txt

2、 Environment variables
you must configure environment variables, otherwise the database fields will be added with random comments

NLS_LANG = SIMPLIFIED CHINESE_CHINA.ZHS16GBK

TNS_ADMIN = D:\install\PLSQL\instantclient_11_2

3、 PL/SQL developer environment settings

1. Location

    Tools -> Preferences -> Connections

2. Settings

    Oracle home directory name = D:\install\PLSQL\instantclient_11_2

    OCI library = D:\install\PLSQL\instantclient_11_2\oci.dll 

4. Supplement

The tnsnames.ora file needs to be created manually and set up accordingly, refer to the online tutorial.

Problem: you need to modify the tnsnames.ora file to configure the database connection, but you can’t find the path of the file. Many online searches say that it’s in the app directory of disk D, but you still can’t find it.

Solution: open PL/SQL and find help – & gt; Support information
after opening, you will see the PL/SQL version information and other configuration information. If you pull down, there will be a “TNS file”, which is the tnsnames.ora file path of the PL/SQL you installed. After modification, you need to restart PL/SQL