Oracle APEX21安装部署

官方下载
官方文档

安装APEX

  1. 安装

    1
    2
    3
    4
    5
    
    <!-- -->
    @apexins.sql SYSAUX SYSAUX TEMP /i/
    
    <!--  设置 APEX_PUBLIC_USER -->
    ALTER USER APEX_PUBLIC_USER IDENTIFIED BY S9dFCaUaCejbmLM52L ACCOUNT UNLOCK;
    
    用户 环境 密码 备注
    APEX_PUBLIC_USER test162 S9dFCaUaCejbmLM52L 最低特权帐户。
  2. 设置internal工作区admin用户,配置RESTful服务

    1
    2
    3
    4
    5
    
    <!--设置 INTERNAL 工作区的admin用户及密码  S9dFCaUaC.ejbmLM52L -->
    @apxchpwd.sql
    
    <!--配置RESTful服务  b7qP9Atb2f^vV2LU -->
    @apex_rest_config.sql
    
安装中文支持
  1. 安装中文支持
    1
    2
    3
    4
    
    <!-- 切换SCHEMA -->
    ALTER SESSION SET CURRENT_SCHEMA = APEX_190200;
    <!--安装中文支持-->
    @builder/zh-cn/load_zh-cn.sql
    
验证APEX的有效性
  1. 验证APEX的有效性
    1
    2
    
    SELECT STATUS FROM DBA_REGISTRY WHERE COMP_ID = 'APEX';
    SELECT * FROM apex_release;
    
安装Apex补丁
  1. unzip p30392181_1920_Generic.zip

  2. cat 30392181/README.txt

  3. 按照说明执行

    1
    2
    3
    4
    5
    6
    7
    8
    9
    
     /****************看文档************
     sqlplus "sys/ as sysdba" 
     <!--切SESSION -->
     <!--以下任选其一-->
     1. @catpatch.sql        -- 适用于Oracle数据库11.2及更早版本,适用于非CDB,以及APEX没有安装在根目录下的CDB
     2. @catpatch_con.sql    -- for CDB where Application Express is installed in the root
     3. @catpatch_appcon.sql -- for installations where Application Express is installed in an application container
     **************************************/
    @catpatch.sql 
    
  4. 验证补丁

    1
    
    SELECT * FROM apex_release;
    
  5. 将补丁中的静态文件覆盖到原静态文件

    1
    2
    
    [oracle@xxxxxxxx 37366599]$ zip -r apex242_images_p4.zip images
    [oracle@xxxxxxxb 37366599]$ rsync -av ./images/ /usr/local/nginx/html/i242/
    
设置Oracle 数据库 wallet HTTPs 证书
压缩 `zip -r  cas_https.zip /data/app/oracle/admin/edexcas/wallet/https`,
设置Oracle 数据库 HTTP ACL
```sql 

DECLARE
	l_acl_name  varchar2(30) := 'HttpsServiceACLConfig.xml';
	-- l_principal varchar2(20) := 'APEX_190200';
	l_principal varchar2(20) := 'APEX_210200';
BEGIN
	BEGIN
		dbms_network_acl_admin.drop_acl(acl => l_acl_name);
	EXCEPTION
		WHEN OTHERS THEN
			NULL; -- ACL does not exist yet
	END;
	dbms_network_acl_admin.create_acl(
			acl => l_acl_name
		, description => 'https'
		, principal => l_principal
		, is_grant => TRUE
		, privilege => 'connect'
		, start_date => SYSTIMESTAMP
		, end_date => NULL
	);
	dbms_network_acl_admin.add_privilege(
			acl => l_acl_name
		, principal => l_principal
		, is_grant => TRUE
		, privilege => 'resolve'
		, start_date => SYSTIMESTAMP
		, end_date => NULL
	);

	dbms_network_acl_admin.assign_acl(
			acl => l_acl_name
		, host => '*'
		, lower_port => 443
		, upper_port => 443
	);
	-- 添加
	dbms_network_acl_admin.assign_acl(
			acl => l_acl_name
		, host => '*'
		, lower_port => 80
		, upper_port => 80
	);
	dbms_network_acl_admin.assign_acl(
			acl => l_acl_name
		, host => '*.aliyun.com'
		, lower_port => 25
		, upper_port => 25
	);
	COMMIT;
END;
```
设置Oracle 数据库 授权加解密包
grant execute on dbms_crypto to APEX_210200;

Ords相关

```bash
ords --config  /opt/edex_config_edex_test  install
ords --config /opt/edex_config_edex_test    config set misc.pagination.maxRows 1000
ords --config /opt/edex_config_edex_test    config set feature.sdw  false
ords --config /opt/edex_config_edex_test    config set database.api.enabled true
ords  --config /opt/edex_config_edex_test  config --db-pool edex_test set misc.defaultPage  apex  
ords  --config /opt/edex_config_edex_test   config --db-pool edex_test secret --password-stdin db.password 
```

其他

  1. 安装ords时出错
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[root@xxxxxxxx opt]# ords --config  /opt/edex_config_edex_test  install --debug 
Retrieving information.
2025-08-19T05:10:09.179Z INFO        The log file is defaulted to the current working directory located at /root/logs/
2025-08-19T05:10:09.300Z INFO        Installing Oracle REST Data Services version 24.4.0.r3451601 in NON_CDB
2025-08-19T05:10:10.895Z INFO        ... Verified database prerequisites
Error executing script: ords_create_rest_users.sql Error: ORA-17041: Missing IN or OUT parameter at index: 1
https://docs.oracle.com/error-help/db/ora-17041/
 Refer to log file /root/logs/ords_install_2025-08-19_051009_18063.log for details
[root@xxxxxxxx ~]# cat /root/logs/ords_install_2025-08-19_051009_18063.log
------------------------------------------------------------
Date       : 19 Aug 2025 05:10:09                                                                                                                        
Release    : Oracle REST Data Services 24.4.0.r3451601
Type       : ORDS Install
Database   : Oracle Database 19c Enterprise Edition
DB Version : 19.28.0.0.0 
                                 
[*** script: ords_create_rest_users.sql]             
declare                                                 
*                               
ERROR at line 1:
ORA-17041: Missing IN or OUT parameter at index: 1
https://docs.oracle.com/error-help/db/ora-17041

More Details :                                    
https://docs.oracle.com/error-help/db/ora-17041/ 

原因是 设定 ORDS_PUBLIC_USER 的密码时有特殊符号,例如 42J5-37q'jueZwY^,可以通过删除原有配置文件 rm -fr /opt/edex_config_edex_test/*重新配置 导出ords安装时执行的脚本ords --config /opt/edex_config_edex_test extract scripts ,再依据find . -name "ords_create_rest_users.sql" 查找具体脚本, 查看报错脚本明细cat ./install/core/ords_create_rest_users.sql

Licensed under CC BY-NC-SA 4.0
最后更新于 2025-12-03 15:07
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计