search
HomeDatabaseMysql Tutorial【oracle案例】oracle EM和isqlplus 无法打开, JDK冲突

背景: 前些天安装了JDK,并设置了相应的环境变量。 JDK安装路径 C:/Program Files/Java/jdk1.6.0_25 JDK环境变量如下: JAVA_HOME=C:/Program Files/Java/jdk1.6.0_25 CLASSPATH=.;%JAVA_HOME%/lib/dt.jar;%JAVA_HOME%/lib/tools.jar PATH中添加java.exe,jav

背景:

前些天安装了JDK,并设置了相应的环境变量。

JDK安装路径 C:/Program Files/Java/jdk1.6.0_25  

JDK环境变量如下:

JAVA_HOME=C:/Program Files/Java/jdk1.6.0_25

CLASSPATH=.;%JAVA_HOME%/lib/dt.jar;%JAVA_HOME%/lib/tools.jar

PATH中添加java.exe,javac.exe的路径,加入;%JAVA_HOME%/bin

 

预备知识

oracle自己也带有一个JDK,目录D:/oracle/product/10.2.0/db_1/jdk,在PATH环境变量中有这么一条路径D:/oracle/java/bin/ 这个是oracle自带的JDK路径

 

问题

 

Oracle的服务都可以正常启动,在用浏览器打开OracleEM和isqlplus的WEB界面时连接失败,在命令提示符下查看emctl状态,输入命令emctl status dbconsole ,结果失败,提示查看oracle日志。进入oracle日志文件夹,路径D:/oracle/product/10.2.0/db_1/主机名_SID/sysman/log文件夹,打开emdctl(oracle enterprise manager 10g database control)日志文件提示如下

2011-05-28 20:43:49 Thread-2544 WARN  http: snmehl_connect: connect failed to (SUN-PC:3938): No connection could be made because the target machine actively refused it.
 (error = 10061)

 

查看了日志文件知道是:目标主机主动拒绝连接。同时考虑到环境变量PATH含有oracle自带的JDK路径,而我却在环境变量中设置了JAVA_HOME=C:/Program Files/Java/jdk1.6.0_25,这将导致oracleEM和iSQLPLUS在读取配置文件的时候出现错误,即错误的去读取JAVA的JDK环境变量,而不是oracle自带的JDK的路径。 就是JAVA_HOME误导oracle读取错误的JDK路径。因此我们需要更改环境变量设置,让oracle能够正确的读取。

解决办法是更改JAVA的JDK环境变量设置,删掉JAVA_HOME,更改CLASSPATH=.;C:/Program Files/Java/jdk1.6.0_25/lib/dt.jar;C:/Program Files/Java/jdk1.6.0_25/lib/tools.jar  更改PATH中JDK路径为C:/Program Files/Java/jdk1.6.0_25/bin

经过这样的更改,oracleEM和iSQLPLUS就可以在浏览器上正常打开了。

 

参考文章 http://topic.csdn.net/u/20090222/20/0ff645fb-5a3f-430f-b0d0-f7519286c6f3.html   回帖里面lpc19598188提出了一种解决方法,试了一下,有一个设置提示错误,是因为文件路径问题,呵呵,这个没搞懂,电脑里面安装的东西有点乱……

 

PS:oracle自己带有一个JDK环境,在设置Java语言开发环境的JDK的时候,设置的JAVA_HOME导致oracle错误地读取了Java的JDK,即

       读取了错误的路径导致EM无法正常打开。

 

       解决并总结一个问题用了2个多小时,天啊!!!我要提高效率

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What Are the Limitations of Using Views in MySQL?What Are the Limitations of Using Views in MySQL?May 14, 2025 am 12:10 AM

MySQLviewshavelimitations:1)Theydon'tsupportallSQLoperations,restrictingdatamanipulationthroughviewswithjoinsorsubqueries.2)Theycanimpactperformance,especiallywithcomplexqueriesorlargedatasets.3)Viewsdon'tstoredata,potentiallyleadingtooutdatedinforma

Securing Your MySQL Database: Adding Users and Granting PrivilegesSecuring Your MySQL Database: Adding Users and Granting PrivilegesMay 14, 2025 am 12:09 AM

ProperusermanagementinMySQLiscrucialforenhancingsecurityandensuringefficientdatabaseoperation.1)UseCREATEUSERtoaddusers,specifyingconnectionsourcewith@'localhost'or@'%'.2)GrantspecificprivilegeswithGRANT,usingleastprivilegeprincipletominimizerisks.3)

What Factors Influence the Number of Triggers I Can Use in MySQL?What Factors Influence the Number of Triggers I Can Use in MySQL?May 14, 2025 am 12:08 AM

MySQLdoesn'timposeahardlimitontriggers,butpracticalfactorsdeterminetheireffectiveuse:1)Serverconfigurationimpactstriggermanagement;2)Complextriggersincreasesystemload;3)Largertablesslowtriggerperformance;4)Highconcurrencycancausetriggercontention;5)M

MySQL: Is it safe to store BLOB?MySQL: Is it safe to store BLOB?May 14, 2025 am 12:07 AM

Yes,it'ssafetostoreBLOBdatainMySQL,butconsiderthesefactors:1)StorageSpace:BLOBscanconsumesignificantspace,potentiallyincreasingcostsandslowingperformance.2)Performance:LargerrowsizesduetoBLOBsmayslowdownqueries.3)BackupandRecovery:Theseprocessescanbe

MySQL: Adding a user through a PHP web interfaceMySQL: Adding a user through a PHP web interfaceMay 14, 2025 am 12:04 AM

Adding MySQL users through the PHP web interface can use MySQLi extensions. The steps are as follows: 1. Connect to the MySQL database and use the MySQLi extension. 2. Create a user, use the CREATEUSER statement, and use the PASSWORD() function to encrypt the password. 3. Prevent SQL injection and use the mysqli_real_escape_string() function to process user input. 4. Assign permissions to new users and use the GRANT statement.

MySQL: BLOB and other no-sql storage, what are the differences?MySQL: BLOB and other no-sql storage, what are the differences?May 13, 2025 am 12:14 AM

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

MySQL Add User: Syntax, Options, and Security Best PracticesMySQL Add User: Syntax, Options, and Security Best PracticesMay 13, 2025 am 12:12 AM

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

MySQL: How to avoid String Data Types common mistakes?MySQL: How to avoid String Data Types common mistakes?May 13, 2025 am 12:09 AM

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)