Oracle11gRAC安装JVM组件

安装前检查:

检查角色:

select * from dba_roles where ROLE in ('JAVAIDPRIV','JAVAUSERPRIV');

检查DBMS_JAVA:

select * from dba_procedures where OBJECT_NAME= 'DBMS_JAVA';

检查组件:

-- Start of File full_jvminst_ceshi.sql
spool full_jvminst_ceshi.log;
set echo on
select obj#, name from obj$
where type#=28 or type#=29 or type#=30 or namespace=32;
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
set echo off
spool off
exit
-- End of File full_jvminst_ceshi.sql

安装JVM组件:

方式一(图形化安装)

Add the Oracle JVM component using the Database Configuration Assistant Utility

a. Start the Database Configuration Assistant and Click Next at the Welcome screen.
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

预计完成时间: 半个小时左右,视数据库的性能安装时间有所偏差

方式二(执行脚本安装)

Manually Add the JVM Component by executing the initjvm.sql script.

The following steps need to be executed precisely as listed below to ensure that they complete successfully:

a. Verify the following system requirements are available:

The Shared Pool has at least 96Mb of free space.
The Java Pool has at least 50Mb of free space
The SYSTEM tablespace has at least 70Mb of free space
The SYSTEM RBS has at least 100Mb of free space

The initjvm.sql script in 11g will check these resources are available when it is run, and if they aren’t available the execution of the script will terminate with an error indicating which resource needs to be increased.

b. Shutdown the instance and then create and run the following sql script from a new sqlplus session:

-- Start of File full_jvminst.sql
spool full_jvminst.log;
set echo on
connect / as sysdba
startup mount
alter system set "_system_trig_enabled" = false scope=memory;
alter database open;
select obj#, name from obj$
where type#=28 or type#=29 or type#=30 or namespace=32;
@?/javavm/install/initjvm.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
@?/xdk/admin/initxml.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
@?/xdk/admin/xmlja.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
@?/rdbms/admin/catjava.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
@?/rdbms/admin/catexf.sql
select count(*), object_type from all_objects
where object_type like '%JAVA%' group by object_type;
shutdown immediate
set echo off
spool off
exit
-- End of File full_jvminst.sql

c. Once the database has been restarted, resolve any invalid objects.

This can be performed by running the utlrp.sql script e.g.:

@?/rdbms/admin/utlrp.sql

检查DB JVM状态脚本

column comp_name format a30
column version format a20
column status format a15
column owner format a30
column object_name format a30
column object_type format a15
column long_name format a75
column role format a40
column act_time format a24
column action format a15
column comments format a20
set pagesize 500
set linesize 150
set trimspool on
set serveroutput on
set echo on

spool jvm_info.log

------ REGISTRY INFO ------

SELECT SUBSTR(comp_name, 1, 30) comp_name, SUBSTR(version, 1, 20) version, status
  FROM dba_registry
 ORDER BY comp_name;

------ REGISTRY HISTORY -------

SELECT TO_CHAR(action_time, 'DD-MON-YYYY HH24:MI:SS') act_time, action, version, id, comments
FROM dba_registry_history
ORDER BY action_time DESC;

 

------ JAVA OBJECT INFO ------

-- Are there a substantial number of VALID Java objects in SYS?

SELECT owner, object_type, status, COUNT(*)
  FROM dba_objects
 WHERE object_type LIKE '%JAVA%'
 GROUP BY owner, object_type, status
 ORDER BY owner, object_type, status;

-- Is the DBMS_JAVA package VALID?

SELECT owner, object_name, object_type, status
  FROM dba_objects
 WHERE object_name LIKE 'DBMS_JAVA%'
    OR object_name LIKE '%INITJVMAUX%'
 ORDER BY owner, object_name, object_type;

-- Are there any INVALID Java objects in SYS?

SELECT owner, NVL(longdbcs,object_name) long_name, object_type, status
  FROM dba_objects, sys.javasnm$
 WHERE object_type LIKE '%JAVA%'
   AND status <> 'VALID'
   AND short (+) = object_name
 ORDER BY owner, long_name, object_type;

------ JAVA ROLE INFO ------

-- The number expected varies by release.

SELECT role
  FROM dba_roles
 WHERE role LIKE '%JAVA%'
 ORDER BY role;

------ MEMORY INFO ------

SELECT *
  FROM v$sgastat
 WHERE pool = 'java pool' OR name = 'free memory'
 ORDER BY pool, name;

------ DATABASE PARAMETER INFO ------

show parameter pool_size

show parameter target

show parameter sga

------ TEST JAVAVM USAGE (and return the JDK version if > 11g) ------

-- Calling routines in DBMS_JAVA will invoke the JavaVM and expose certain problems.

SET SERVEROUTPUT ON
DECLARE
  ver NUMBER := 0;
  val VARCHAR2(30);
BEGIN
  BEGIN
    SELECT TO_NUMBER( SUBSTR(version, 1, 2) )
      INTO ver
      FROM dba_registry
     WHERE comp_name = 'JServer JAVA Virtual Machine';
  EXCEPTION
    WHEN OTHERS THEN NULL;
  END;

  IF ver >= 12 THEN
    EXECUTE IMMEDIATE
              'SELECT ''JDK version is '' ||
                      dbms_java.get_jdk_version() FROM dual'
            INTO val;
  ELSE
    val := dbms_java.longname('JDK version not available');
  END IF;
  dbms_output.put_line(val);
END;
/

spool off

至此结束,有什么问题欢迎留言

参考官方文档:
How to Add the JVM Component to an Existing Oracle Database (Doc ID 1461562.1)
Script to Check the Status of the JVM within the Database (Note: 456949.1)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
Oracle 11g RAC(Real Application Clusters)安装步骤如下: 1. 安装操作系统并配置网络 确保所有节点都安装了支持Oracle 11g的操作系统,例如Oracle Linux或Red Hat Enterprise Linux,并且网络配置正确并可访问。 2. 安装Oracle Grid Infrastructure 在所有节点上安装Oracle Grid Infrastructure(GI),此步骤将配置集群的基础设施,例如Clusterware和ASM(Automatic Storage Management)。 3. 创建ASM磁盘组 使用ASM创建磁盘组,这将用于存储Oracle数据库的数据文件和日志文件。 4. 安装Oracle软件 在所有节点上安装Oracle软件,此步骤将安装Oracle数据库软件和Database Configuration Assistant(DBCA)等附加组件。 5. 创建数据库 使用DBCA创建RAC数据库。在创建数据库时,可以选择使用ASM存储数据文件和日志文件,并指定需要在哪些节点上创建实例。 6. 安装并配置Oracle Net Services 在所有节点上安装Oracle Net Services,并配置监听器和服务名,以便客户端可以连接到集群中的数据库。 7. 安装并配置Oracle Clusterware 在所有节点上安装Oracle Clusterware,并确保它可以在各个节点之间正常运行。此步骤将确保集群中的节点可以协同工作并实现高可用性。 8. 安装并配置Oracle Enterprise Manager 在一个节点上安装Oracle Enterprise Manager,并配置它以管理整个集群。 9. 测试集群 在集群中的每个节点上,测试数据库和所有组件的运行状况,并确保所有节点都可以连接到数据库和应用程序。 以上是Oracle 11g RAC安装的简要步骤,具体步骤和注意事项可以参考Oracle官方文档。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值