,推荐SUN的官方网站www.sun.com,下载后放在/home目录中,当然其它地方也行。
进入安装目录
#cd /home
#cp jdk-1_5_0_02-linux-i586.rpm /usr/local
#cd /usr/local
给所有用户添加可执行的权限
#chmod +x jdk-1_5_0_02-linux-i586.rpm.bin
#./jdk-1_5_0_02-linux-i586.rpm.bin
此时会生成文件jdk-1_5_0_02-linux-i586.rpm,同样给所有用户添加可执行的权限
#chmod +x jdk-1_5_0_02-linux-i586.rpm
安装程序
#rpm -ivh jdk-1_5_0_02-linux-i586.rpm
出现厅缓安装协议等,按接受即可。
Linux安装JDK步骤2.设置环境变量。
#vi /etc/profile
在最后面加入
#set java environment
JAVA_HOME=/usr/java/jdk-1_5_0_02
CLASSPATH=.:$JAVA_HOME/lib.tools.jar
PATH=$JAVA_HOME/扮备模bin:$PATH
export JAVA_HOME CLASSPATH PATH
保存退出。
要使JDK在所有的用户中使用,可以这样:
vi /etc/profile.d/java.sh
在新的java.sh中输入以下内容:
#set java environment
JAVA_HOME=/usr/java/jdk-1_5_0_02
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
保存退滚毁出,然后给java.sh分配权限:chmod 755 /etc/profile.d/java.sh
Linux安装JDK步骤3.在终端使用echo命令检查环境变量设置情况。
#echo $JAVA_HOME
#echo $CLASSPATH
#echo $PATH
4.检查JDK是否安装成功。
#java -version
如果看到JVM版本及相关信息,即安装成功!
测试环境,创建user的时候,遇到错误如衫腊腊下:SQL>grant javasyspriv to XXXX
*
ERROR at line 1:
ORA-01919: role 'JAVASYSPRIV' does not exist
SQL>
原来是因为安装的时候,用silent模式,或滑执行sql的时候,少了一些。
当前信息:
SQL>SELECT comp_name || ' : '||version|| ' : '|| status FROM dba_registry
COMP_NAME||':'||VERSION||':'||STATUS
--------------------------------------------------------------------------------
Oracle Database Catalog Views : 11.2.0.3.0 : VALID
Oracle Database Packages and Types : 11.2.0.3.0 : VALID
SQL>
按照文局郑档执行安装(就是两个sql)。
cd $ORACLE_HOME
SQL>@?/javavm/install/initjvm.sql
SQL>@?/rdbms/admin/catjava.sql
然后验证一下:
SQL>SELECT comp_name || ' : '||version|| ' : '|| status FROM dba_registry
COMP_NAME||':'||VERSION||':'||STATUS
--------------------------------------------------------------------------------
Oracle Database Catalog Views : 11.2.0.3.0 : VALID
Oracle Database Packages and Types : 11.2.0.3.0 : VALID
JServer JAVA Virtual Machine : 11.2.0.3.0 : VALID
Oracle Database Java Packages : 11.2.0.3.0 : VALID
SQL>grant javasyspriv to XXXXX
Grant succeeded.
SQL>
参考了URL如下:
http://abcdba.com/abcdbaserverinstallguideshowtoinstalloraclejvm
How To Install Oracle JVM
BACKGROUND &OVERVIEW
Oracle Java Virtual Machine (JVM) is a feature of the Oracle Database. It provides the ability to run java code from within the database.
This document explains the full set of steps that need to be taken in order to perform a complete and working installation.
ASSUMPTIONS &PRE-REQUISITES
This document expects and assumes the following:
The instructions are carried out by a qualified DBA, fully conversant with Oracle.
A fully working database without JVM exists.
All references to SID should be replaced with correct database name as derived using the database naming standard.
STEP-BY-STEP GUIDE
As SYS, confirm the JVM is not already installed.
SELECT comp_id, comp_name FROM dba_registryshould not list JAVAM or CATJAVA.
As SYS, perform the JVM installation.
@?/javavm/install/initjvm.sql
@?/rdbms/admin/catjava.sql
As SYS, confirm the JVM is now fully installed:
SELECT comp_id, comp_name FROM dba_registry
COMP_IDCOMP_NAME
--------- --------------------------------------------
EM Oracle Enterprise Manager
CATALOGOracle Database Catalog Views
CATPROCOracle Database Packages and Types
JAVAVM JServer JAVA Virtual Machine
CATJAVAOracle Database Java Packages
HEALTHCHECK
In addition, the following healthcheck can be performed to confirm the stability of the installed JVM, further details can be found in Metalink Article 456949.1:
connect / as sysdba
spool jvm_stats.log
set serveroutput on
set echo on
set pagesize500
set linesize 100
column comp_name format a40
select comp_name, version, status from dba_registry
select owner, status, count(*) from all_objects
where object_type like '%JAVA%' group by owner, status
select owner, object_type, count(*) from all_objects
where object_type like '%JAVA%' and status <>'VALID' group by owner, object_type
select owner, status, object_type, object_name from all_objects
where object_name like'%DBMS_JAVA%'
select owner, status, object_type, object_name from all_objects
where object_name like'%INITJVMAUX%'
select role from dba_roles where role like '%JAVA%'
select * from v$sgastat where POOL = 'java pool' or NAME = 'free memory'
show parameter pool_size
show parameter sga
select owner, object_type, status, dbms_java.longname(object_name) from all_objects
where object_type like '%JAVA%' and status <>'VALID'
spool off
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)