在ORACLE 12C 上安装APEX 19.2

安装环境

  • 操作系统:win 10 x 64
  • 中间件:本文尝试了三个安装环境 PL/SQL gateway/ORDS独立模式/Apache + ORDS
  • 数据库版本:采用windowns X64 版本的 oracle db 12.1.0
  • 目标容器:安装在PDB中(已经自建好名字为apexpdb)
  • 提前修改好pdb的sys用户的密码并熟记
  • 参考官方文档:https://docs.oracle.com/en/database/oracle/application-express/19.2/

安装步骤(通用步骤):

下载apex安装包

并解压到ORACLE_HOME目录下的 apex文件夹中,并切换到apex目录中,
sqlplus / as sysdba 登录数据库:

PS C:\app\oracle\oracle\product\12.1.0\dbhome_1\apex> sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on 星期日 31 16:43:59 2020

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


连接到:
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> alter session set container=apexpdb;

会话已更改。

SQL> show con_name;

CON_NAME
------------------------------
PDBORCL
SQL> show user;
USER"SYS"
SQL> EXEC DBMS_XDB.SETHTTPPORT(0);
--下面后续操作都在pdborcl 这个容器下进行操作

创建apex专用表空间

SQL> CREATE TABLESPACE apex DATAFILE 'C:\APP\ORACLE\ORACLE\ORADATA\ORCL\apex01.dbf' SIZE 300M AUTOEXTEND ON NEXT 1M;

表空间已创建。

调用apex安装命令执行安装

--如果已经安装老版本的,可以执行如下命令卸载
@apxremov.sql

@apexins.sql APEX APEX TEMP /i/

-- 采用系统默认表空间的话用这个 @apexins.sql SYSAUX SYSAUX TEMP /i/

----------------------------------------
参数含义(摘自oralce doc):
@apxrtins.sql tablespace_apex tablespace_files tablespace_temp images
Where:

tablespace_apex is the name of the tablespace for the Oracle Application Express application user.

tablespace_files is the name of the tablespace for the Oracle Application Express files user.

tablespace_temp is the name of the temporary tablespace or tablespace group.

images is the virtual directory for Oracle Application Express images. To support future Oracle Application Express upgrades, define the virtual image directory as /i/.

Example:

@apxrtins.sql SYSAUX SYSAUX TEMP /i/

经过几分钟的等待,安装完成:

...
Thank you for installing Oracle Application Express 19.2.0.00.18

Oracle Application Express is installed in the APEX_190200 schema.

The structure of the link to the Application Express administration services is as follows:
http://host:port/pls/apex/apex_admin (Oracle HTTP Server with mod_plsql)
http://host:port/apex/apex_admin     (Oracle XML DB HTTP listener with the embedded PL/SQL gateway)
http://host:port/apex/apex_admin     (Oracle REST Data Services)

The structure of the link to the Application Express development interface is as follows:
http://host:port/pls/apex (Oracle HTTP Server with mod_plsql)
http://host:port/apex     (Oracle XML DB HTTP listener with the embedded PL/SQL gateway)
http://host:port/apex     (Oracle REST Data Services)

计时: Phase 3 (Switch)
已用时间:  00: 00: 11.97
计时: Complete Installation
已用时间:  00: 13: 54.10

PL/SQL 过程已成功完成。

已选择 1 行。

...null1.sql
SYS>

unlock APEX_PUBLIC_USER

SYS> show con_name

CON_NAME
------------------------------
PDBORCL
SYS> alter user APEX_PUBLIC_USER identified by "apex_Passw0rd" account unlock;

用户已更改。

SYS>

Create the APEX Instance Administration user and set the password

	begin
	    apex_util.set_security_group_id( 10 );
	    apex_util.create_user(
	        p_user_name => 'ADMIN',
	        p_email_address => 'your@emailaddress.com',
	        p_web_password => 'apex_Passw0rd',
	        p_developer_privs => 'ADMIN' );
	    apex_util.set_security_group_id( null );
	    commit;
	end;
	/

官方文档是用下面这个命令: @apxchpwd.sql

方式1:PL/SQL 网关模式

Configuring the Embedded PL/SQL Gateway


SYS> @apex_epg_config.sql C:\app\oracle\oracle\product\12.1.0\dbhome_1

PL/SQL 过程已成功完成。

已选择 1 行。
已选择 1 行。
已选择 1 行。

PL/SQL 过程已成功完成。

已选择 1 行。

PL/SQL 过程已成功完成。

PL/SQL 过程已成功完成。

. Loading images directory: C:\app\oracle\oracle\product\12.1.0\dbhome_1/apex/images

目录已创建。

PL/SQL 过程已成功完成。

PL/SQL 过程已成功完成。

PL/SQL 过程已成功完成。

提交完成。

目录已删除。

计时: Load Images
已用时间:  00: 03: 15.34

PL/SQL 过程已成功完成。
提交完成。

解锁 ANONYMOUS

–切换到CDB$ROOT,执行下面的解锁命令

SYS> ALTER USER ANONYMOUS ACCOUNT UNLOCK;

配置端口


SYS> SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;

GETHTTPPORT
-----------
       8080

已选择 1 行。

SYS> EXEC DBMS_XDB.SETHTTPPORT(8080);

PL/SQL 过程已成功完成。

Config APEX REST and set the passwords of APEX_REST_PUBLIC_USER and APEX_LISTENER

    @apex_rest_config.sql

对于数据库版本为12.1版本的安装环境,最好执行下更改密码的口令:

alter user APEX_LISTENER identified by "apex_Passw0rd" account unlock;
alter user APEX_REST_PUBLIC_USER identified by "apex_Passw0rd" account unlock;

输入下面的地址应该就可以访问了: http://localhost:8080/apex

方式2:ORDS 独立模式

下载JDK

版本要求为:1.8 以上(含)

可以去下面网址下载:

https://www.oracle.com/java/technologies/javase-jdk13-downloads.html

如果开发环境需要多个JDK版本,最好下载那个免安装版的:Windows x64 Compressed Archive

下载完成后解压到 C:\app\apex\jdk-13.0.2 这个路径下

下载ORDS

下载地址 :https://www.oracle.com/database/technologies/appdev/rest-data-services-downloads.html

解压路径:C:\app\apex\ords

进入命令行模式,切换到 C:\app\apex\ords 路径下,输入

..\jdk-13.0.2\bin\java.exe -jar ords.war install advanced

结果如下:

PS C:\app\apex\ords> ..\jdk-13.0.2\bin\java.exe -jar ords.war install advanced
输入数据库服务器的名称 [localhost]:
输入数据库监听端口 [1521]:
输入 1 指定数据库服务名称, 或输入 2 指定数据库 SID [1]:
输入数据库服务名:apexpdb
如果您希望验证/安装 Oracle REST Data Services 方案, 则输入 1; 或者输入 2 跳过此步骤 [1]:
输入ORDS_PUBLIC_USER的数据库口令:
确认口令:
需要 SYS AS SYSDBA 以验证 Oracle REST Data Services 方案。

Enter the administrator username:sys
输入SYS AS SYSDBA的数据库口令:
确认口令:

检索信息.
Enter the default tablespace for ORDS_METADATA [SYSAUX]:
Enter the temporary tablespace for ORDS_METADATA [TEMP]:
Enter the default tablespace for ORDS_PUBLIC_USER [USERS]:
Enter the temporary tablespace for ORDS_PUBLIC_USER [TEMP]:
如果您希望使用 PL/SQL 网关, 则输入 1; 或者输入 2 跳过此步骤。
如果正在使用 Oracle Application Express 或者正在从 mod_plsql 移植, 则必须输入 1 [1]:
输入 PL/SQL 网关数据库用户名 [APEX_PUBLIC_USER]:
输入APEX_PUBLIC_USER的数据库口令:
确认口令:
输入 1 可以为 Application Express RESTful 服务数据库用户 (APEX_LISTENER, APEX_REST_PUBLIC_USER) 指定口令; 或者输入 2 跳过此步骤 [1]:
输入APEX_LISTENER的数据库口令:
确认口令:
输入APEX_REST_PUBLIC_USER的数据库口令:
确认口令:
3月 14, 2020 7:33:23 下午
信息: reloaded pools: []
正在安装Oracle REST Data Services版本 19.2.0.r1991647
... 日志文件已写入C:\Users\thinker\ords_install_core_2020-03-14_193323_00225.log
Warning: Nashorn engine is planned to be removed from a future JDK release
... 已验证数据库的先决条件
... 已创建 Oracle REST Data Services 代理用户
... 已创建 Oracle REST Data Services 方案
... 已授予 Oracle REST Data Services 权限
... 已创建 Oracle REST Data Services 数据库对象
... 日志文件已写入C:\Users\thinker\ords_install_datamodel_2020-03-14_193347_00429.log
... 日志文件已写入C:\Users\thinker\ords_install_apex_2020-03-14_193353_00941.log
已完成 Oracle REST Data Services 版本 19.2.0.r1991647 的安装。用时: 00:00:37.2

要以独立模式启动, 请输入 1; 要退出, 请输入 2 [1]:1
输入 APEX 静态资源位置:C:\app\apex\apex\images
如果使用 HTTP, 则输入 1; 如果使用 HTTPS, 则输入 2 [1]:
输入 HTTP 端口 [8080]:
2020-03-14 19:39:34.405:INFO::main: Logging initialized @450091ms to org.eclipse.jetty.util.log.StdErrLog
3月 14, 2020 7:39:34 下午
信息: HTTP and HTTP/2 cleartext listening on port: 8080
3月 14, 2020 7:39:34 下午
信息: Disabling document root because the specified folder does not exist: C:\app\apex\ords\config\ords\standalone\doc_root
2020-03-14 19:39:35.164:INFO:oejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2019-05-02T09:46:34.874Z; git: 14f32d50076f2b706f41a33066eb364d8492e199; jvm 13.0.2+8
2020-03-14 19:39:35.198:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2020-03-14 19:39:35.205:INFO:oejs.session:main: No SessionScavenger set, using defaults
2020-03-14 19:39:35.208:INFO:oejs.session:main: node0 Scavenging every 660000ms
3月 14, 2020 7:39:35 下午
信息: Configuration properties for: |apex||
cache.caching=false
cache.directory=/tmp/apex/cache
cache.duration=days
cache.expiration=7
cache.maxEntries=500
cache.monitorInterval=60
cache.procedureNameList=
cache.type=lru
db.hostname=localhost
db.password=******
db.port=1521
db.servicename=apexpdb
db.username=APEX_PUBLIC_USER
debug.debugger=false
debug.printDebugToScreen=false
error.keepErrorMessages=true
error.maxEntries=50
jdbc.DriverType=thin
jdbc.InactivityTimeout=1800
jdbc.InitialLimit=3
jdbc.MaxConnectionReuseCount=1000
jdbc.MaxLimit=10
jdbc.MaxStatementsLimit=10
jdbc.MinLimit=1
jdbc.statementTimeout=900
log.logging=false
log.maxEntries=50
misc.compress=
misc.defaultPage=apex
resource.templates.enabled=true
security.disableDefaultExclusionList=false
security.maxEntries=2000
security.requestValidationFunction=wwv_flow_epg_include_modules.authorize
security.validationFunctionType=plsql

3月 14, 2020 7:39:35 下午
警告: *** 配置|apex||中的jdbc.MaxLimit使用的是值10, 对于生产环境, 可能无法充分调整此设置的大小 ***
3月 14, 2020 7:39:35 下午
警告: *** 配置|apex||中的jdbc.InitialLimit使用的是值3, 对于生产环境, 可能无法充分调整此设置的大小 ***
3月 14, 2020 7:39:36 下午
信息: Configuration properties for: |apex|al|
cache.caching=false
cache.directory=/tmp/apex/cache
cache.duration=days
cache.expiration=7
cache.maxEntries=500
cache.monitorInterval=60
cache.procedureNameList=
cache.type=lru
db.hostname=localhost
db.password=******
db.port=1521
db.servicename=apexpdb
db.username=APEX_LISTENER
debug.debugger=false
debug.printDebugToScreen=false
error.keepErrorMessages=true
error.maxEntries=50
jdbc.DriverType=thin
jdbc.InactivityTimeout=1800
jdbc.InitialLimit=3
jdbc.MaxConnectionReuseCount=1000
jdbc.MaxLimit=10
jdbc.MaxStatementsLimit=10
jdbc.MinLimit=1
jdbc.statementTimeout=900
log.logging=false
log.maxEntries=50
misc.compress=
misc.defaultPage=apex
resource.templates.enabled=true
security.disableDefaultExclusionList=false
security.maxEntries=2000
security.requestValidationFunction=wwv_flow_epg_include_modules.authorize
security.validationFunctionType=plsql

3月 14, 2020 7:39:36 下午
警告: *** 配置|apex|al|中的jdbc.MaxLimit使用的是值10, 对于生产环境, 可能无法充分调整此设置的大小 ***
3月 14, 2020 7:39:36 下午
警告: *** 配置|apex|al|中的jdbc.InitialLimit使用的是值3, 对于生产环境, 可能无法充分调整此设置的大小 ***
3月 14, 2020 7:39:36 下午
信息: Configuration properties for: |apex|pu|
cache.caching=false
cache.directory=/tmp/apex/cache
cache.duration=days
cache.expiration=7
cache.maxEntries=500
cache.monitorInterval=60
cache.procedureNameList=
cache.type=lru
db.hostname=localhost
db.password=******
db.port=1521
db.servicename=apexpdb
db.username=ORDS_PUBLIC_USER
debug.debugger=false
debug.printDebugToScreen=false
error.keepErrorMessages=true
error.maxEntries=50
jdbc.DriverType=thin
jdbc.InactivityTimeout=1800
jdbc.InitialLimit=3
jdbc.MaxConnectionReuseCount=1000
jdbc.MaxLimit=10
jdbc.MaxStatementsLimit=10
jdbc.MinLimit=1
jdbc.statementTimeout=900
log.logging=false
log.maxEntries=50
misc.compress=
misc.defaultPage=apex
resource.templates.enabled=true
security.disableDefaultExclusionList=false
security.maxEntries=2000
security.requestValidationFunction=wwv_flow_epg_include_modules.authorize
security.validationFunctionType=plsql

3月 14, 2020 7:39:36 下午
警告: *** 配置|apex|pu|中的jdbc.MaxLimit使用的是值10, 对于生产环境, 可能无法充分调整此设置的大小 ***
3月 14, 2020 7:39:36 下午
警告: *** 配置|apex|pu|中的jdbc.InitialLimit使用的是值3, 对于生产环境, 可能无法充分调整此设置的大小 ***
3月 14, 2020 7:39:37 下午
信息: Configuration properties for: |apex|rt|
cache.caching=false
cache.directory=/tmp/apex/cache
cache.duration=days
cache.expiration=7
cache.maxEntries=500
cache.monitorInterval=60
cache.procedureNameList=
cache.type=lru
db.hostname=localhost
db.password=******
db.port=1521
db.servicename=apexpdb
db.username=APEX_REST_PUBLIC_USER
debug.debugger=false
debug.printDebugToScreen=false
error.keepErrorMessages=true
error.maxEntries=50
jdbc.DriverType=thin
jdbc.InactivityTimeout=1800
jdbc.InitialLimit=3
jdbc.MaxConnectionReuseCount=1000
jdbc.MaxLimit=10
jdbc.MaxStatementsLimit=10
jdbc.MinLimit=1
jdbc.statementTimeout=900
log.logging=false
log.maxEntries=50
misc.compress=
misc.defaultPage=apex
resource.templates.enabled=true
security.disableDefaultExclusionList=false
security.maxEntries=2000
security.requestValidationFunction=wwv_flow_epg_include_modules.authorize
security.validationFunctionType=plsql

3月 14, 2020 7:39:37 下午
警告: *** 配置|apex|rt|中的jdbc.MaxLimit使用的是值10, 对于生产环境, 可能无法充分调整此设置的大小 ***
3月 14, 2020 7:39:37 下午
警告: *** 配置|apex|rt|中的jdbc.InitialLimit使用的是值3, 对于生产环境, 可能无法充分调整此设置的大小 ***
3月 14, 2020 7:39:37 下午
信息: Oracle REST Data Services initialized
Oracle REST Data Services version : 19.2.0.r1991647
Oracle REST Data Services server info: jetty/9.4.z-SNAPSHOT

2020-03-14 19:39:38.663:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@24d4d7c9{/ords,null,AVAILABLE}
2020-03-14 19:39:38.669:INFO:oejsh.ContextHandler:main: Started o.e.j.s.h.ContextHandler@4763c727{/i,null,AVAILABLE}
2020-03-14 19:39:40.245:INFO:oejs.AbstractConnector:main: Started ServerConnector@693e4d19{HTTP/1.1,[http/1.1, h2c]}{0.0.0.0:8080}
2020-03-14 19:39:40.247:INFO:oejs.Server:main: Started @455933ms

在前台输入: http://localhost:8080/ords 就可以访问了

方式3:Apache + ORDS 模式

Apache 配置

下载地址:https://tomcat.apache.org/download-90.cgi

解压到: C:\app\apex\apache-tomcat-9.0.31

修改bin目录下的startup.bat 脚本,来配置JDK环境(如果不需要指定JDK版本则不用修改)

在setlocal 下面插入下面三行:

set JAVA_HOME=C:\app\apex\jdk-13.0.2
set PATH=%JAVA_HOME%\bin\;
set CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;

在webapps目录下建立一个 i 名字的文件夹,并将apex下的images里面的所有内容复制到这个文件夹中

配置ORDS

参加方式2中配置ORDS的步骤,当配置到下面环节时:

要以独立模式启动, 请输入 1; 要退出, 请输入 2 [1]:2

输入2 退出,并将ords.war 复制到Apache的webapps这个文件中

启动Apache

进入命令行模式,切换到Apache的bin目录下输入

startup.bat

如下:

PS C:\app\apex\apache-tomcat-9.0.31\bin> .\startup.bat
Using CATALINA_BASE:   "C:\app\apex\apache-tomcat-9.0.31"
Using CATALINA_HOME:   "C:\app\apex\apache-tomcat-9.0.31"
Using CATALINA_TMPDIR: "C:\app\apex\apache-tomcat-9.0.31\temp"
Using JRE_HOME:        "C:\app\apex\jdk-13.0.2"
Using CLASSPATH:       "C:\app\apex\apache-tomcat-9.0.31\bin\bootstrap.jar;C:\app\apex\apache-tomcat-9.0.31\bin\tomcat-juli.jar"

输入地址: http://localhost:8080/ords 应该可以正常访问

其他配置

Create a network ACE for APEX (this is used when consuming Web services or sending outbound mail)

定义网络权限

declare
            l_acl_path varchar2(4000);
            l_apex_schema varchar2(100);
        begin
            for c1 in (select schema
                         from sys.dba_registry
                        where comp_id = 'APEX') loop
                l_apex_schema := c1.schema;
            end loop;
            sys.dbms_network_acl_admin.append_host_ace(
                host => '*',
                ace => xs$ace_type(privilege_list => xs$name_list('connect'),
                principal_name => l_apex_schema,
                principal_type => xs_acl.ptype_db));
            commit;
        end;
    /

进行汉化

切换到 C:\app\apex\apex\builder\zh-cn 这个路径,

sqlplus  /as sysdba
alter session set container=apexpdb;
alter session set current_schema=apex_190200;
@load_zh-cn.sql

Changing the Number of JOB_QUEUE_PROCESSES

优化:配置进程数

ALTER SYSTEM SET JOB_QUEUE_PROCESSES = <number>

APEX 相关资源

官方:
https://apex.oracle.com/zh-cn/learn/tutorials/

• App Gallery - Sample – Universal Theme Sample Application
https://apex.oracle.com/pls/apex/f?p=42:4000

• API Reference: https://docs.oracle.com/en/database/oracle/application-express/19.2/aeapi/preface.html#GUID-5AE2CC45-D209-4292-AED5-3B7D86D35634

• Oracle Application Express JavaScript API Reference
https://docs.oracle.com/en/database/oracle/application-express/19.2/aexjs/index.html

• APEX Plug-ins

Ø apex.world: https://apex.world/ords/f?p=100:700

Ø Pretius Plugins for Oracle APEX: http://apex.pretius.com/apex/f?p=105
Confidential –

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

贤时间

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值