趁春节快结束前,安装了一把APEX ,到目前为此,APEX最新版本为23.2,23.2和21版本有一些变化,只是用于验证,我
是使用的单独模式,没有安装TOMAT,下面列一下安装过程:
1.环境
ORACLE LINUX 9.3
GI 19.22
ORACLE 19.22
CDB
APEX 23.2
2.使用PDB用于 APEX
当然,NON-CDB 也是可以的
sql> alter system set db_create_file_dest='+data';
sql> create pluggable database pdbapex admin user pdbapex identified by oracle_4U;
sql>alter pluggable database pdbapex open;
sql>alter pluggable database pdbapex save state;
3.为APEX和ORDS创建单独的表空间
sql>alter session set container=pdbapex;
sql>create tablespace tsp_apex datafile size 1g autoextend on;
sql>create tablespace tsp_ords datafile size 100m autoextend on;
4.指定APEX安装目录
APEX包含APEX和ORDS安装
APEX安装于 /u01/app/apex
ords 安装于 /u01/app/ords
# mkdir -p /u01/app/{apex,ords}
# chown -R oracle:dba /u01/app/{apex,ords}
# chmod -R 775 /u01/app/{apex,ords}
5.下载apex和ords的安装文件
https://download.oracle.com/otn_software/apex/apex_23.2.zip --选择多语言版本
https://download.oracle.com/otn_ ... 23.4.0.346.1619.zip
6.解压APEX
[oracle@dbserver app]$ pwd
/u01/app
[oracle@dbserver app]$ unzip apex/apex_23.2.zip .
[oracle@dbserver apex]$ ls
apex_23.2.zip apexins_nocdb.sql appins.sql apxdvins_cdb.sql apxpatch.sql apxrtins1.sql apxsilentins.sql coreins5.sql install2024-02-16_15-42-38.log
apexins1.sql apexins.sql apxappcon.sql apxdvins_nocdb.sql apxremov1.sql apxrtins2.sql builder coreins.sql LICENSE.txt
apexins2.sql apex_rest_config_cdb.sql apxchpwd.sql apxdvins.sql apxremov2.sql apxrtins3.sql core dbcsconf.sql load_trans.sql
apexins3.sql apex_rest_config_core.sql apxdevrm_cdb.sql apxdwngrd.sql apxremov_cdb.sql apxrtins_cdb.sql coreins2.sql dbcsins.sql ords
apexins_adb.sql apex_rest_config_nocdb.sql apxdevrm_nocdb.sql apxpatch_cdb.sql apxremov_nocdb.sql apxrtins_nocdb.sql coreins3.sql devins.sql utilities
apexins_cdb.sql apex_rest_config.sql apxdevrm.sql apxpatch_nocdb.sql apxremov.sql apxrtins.sql coreins4.sql images
[oracle@dbserver ords]$ cd ords
[oracle@dbserver ords]$ pwd
/u01/app/ords
[oracle@dbserver ords]$
[oracle@dbserver ords]$ ls -l ords-23.4.0.346.1619.zip
-rw-r--r-- 1 root root 114754880 Feb 16 11:55 ords-23.4.0.346.1619.zip
[oracle@dbserver ords]$ unzip ords-23.4.0.346.1619.zip
[oracle@dbserver ords]$ ls -ltr
total 222144
drwxr-xr-x 4 oracle oinstall 38 Mar 27 2023 scripts
drwxr-xr-x 7 oracle oinstall 93 Mar 27 2023 examples
drwxr-xr-x 3 oracle oinstall 17 Nov 24 17:50 lib
drwxr-xr-x 2 oracle oinstall 28 Nov 24 17:50 icons
-rw-r--r-- 1 oracle oinstall 365 Dec 12 05:35 THIRD-PARTY-LICENSES.txt
-rw-r--r-- 1 oracle oinstall 210 Dec 12 05:35 NOTICE.txt
-rw-r--r-- 1 oracle oinstall 5996 Dec 12 05:35 LICENSE.txt
-rw-r--r-- 1 oracle oinstall 112653905 Dec 12 16:36 ords.war
drwxr-xr-x 3 oracle oinstall 86 Dec 12 16:36 linux-support
drwxr-xr-x 3 oracle oinstall 21 Dec 12 16:36 docs
drwxr-xr-x 2 oracle oinstall 34 Dec 12 16:36 bin
-rw-r--r-- 1 root root 114754880 Feb 16 11:55 ords-23.4.0.346.1619.zip
drwxr-xr-x 29 oracle oinstall 28672 Feb 16 14:27 images
drwxr-xr-x 2 oracle oinstall 102 Feb 16 16:03 logs
[oracle@dbserver ords]$
7.安装APEX
cd /u01/app/apex
sqlplus / as sysdba
sql>alter session set container=pdbapex;
sql>@apexins.sql tsp_apex tsp_apex temp /i/
8.修改apex管理员密码
密码设置为oracle_4U
SQL> @apxchpwd.sql
...set_appun.sql
================================================================================
This script can be used to change the password of an Oracle APEX
instance administrator. If the user does not yet exist, a user record will be
created.
================================================================================
Enter the administrator's username [ADMIN]
User "ADMIN" does not yet exist and will be created.
Enter ADMIN's email [ADMIN] [email protected]
Enter ADMIN's password [] -- oracle_4U
Created instance administrator ADMIN.
9.解锁APEX_PUBLIC_USER账号及密码
alter user APEX_REST_PUBLIC_USER identified by oracle_4U account unlock;
10.启用rest
SQL> @apex_rest_config.sql
Enter a password for the APEX_LISTENER user [] --密码统一为oracle_4U
Enter a password for the APEX_REST_PUBLIC_USER user [] --密码统一为oracle_4U
...set_appun.sql
...setting session environment
...create APEX_LISTENER and APEX_REST_PUBLIC_USER users
...grants for APEX_LISTENER and ORDS_METADATA user
SYS>
以上执行完,在dba_users中,多了以上两个用户
11.安装中文语音包 (apex_230200)
cd /u01/app/apex/builder/zh-cn
sqlplus / as sysdba
sql>alter session set container=pdbapex;
sql>@load_zh-cn.sql
12.配置网络策略
sql>alter session set container=pdbapex;
BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
host => '*',
ace => xs$ace_type(privilege_list => xs$name_list('connect'),
principal_name => 'APEX_230200',
principal_type => xs_acl.ptype_db));
END;
13.设置环境变量
# mkdir -p /work/dbtools-dev/config
# chown -R oracle:dba /work/dbtools-dev/config
# chmod -R 775 /work/dbtools-dev/config
# mkdir -p /etc/ords/config
# chown -R oracle:dba /etc/ords/config
# chmod -R 775 /etc/ords/config
su - oracle
echo -e 'export PATH="$PATH:/u01/app/ords/bin"' >> ~/.bash_profile
source ~/.bash_profile
export ORDS_CONFIG=/etc/ords/config
export JDK_JAVA_OPTIONS=-Dconfig.url=/work/dbtools-dev/config/
14.安装 ords
[oracle@dbserver ords]$ ords install
NOTE: Picked up JDK_JAVA_OPTIONS: -Dconfig.url=/work/dbtools-dev/config/
ORDS: Release 23.4 Production on Fri Feb 16 05:34:13 2024
Copyright (c) 2010, 2024, Oracle.
Configuration:
/etc/ords/config/
The configuration folder /etc/ords/config does not contain any configuration files.
Oracle REST Data Services - Interactive Install
Enter a number to select the type of installation
[1] Install or upgrade ORDS in the database only
[2] Create or update a database pool and install/upgrade ORDS in the database
[3] Create or update a database pool only
Choose [2]: --直接回车选择2
Enter a number to select the database connection type to use
[1] Basic (host name, port, service name)
[2] TNS (TNS alias, TNS directory)
[3] Custom database URL
Choose [1]: --直接回车,选择1
Enter the database host name [localhost]:
Enter the database listen port [1521]:
Enter the database service name [orclcdb]: pdbapex --按实际输入
Provide database user name with administrator privileges.
Enter the administrator username: sys --sys用户
Enter the database password for SYS AS SYSDBA: --sys的密码
Connecting to database user: SYS AS SYSDBA url: jdbc:oracle:thin:@//localhost:1521/pdbapex
Retrieving information.
Enter the default tablespace for ORDS_METADATA and ORDS_PUBLIC_USER [SYSAUX]: tsp_ords
Enter the temporary tablespace for ORDS_METADATA and ORDS_PUBLIC_USER [TEMP]: temp
Enter a number to select additional feature(s) to enable:
[1] Database Actions (Enables all features)
[2] REST Enabled SQL and Database API
[3] REST Enabled SQL
[4] Database API
[5] None
Choose [1]: --直接回车,启用所有功能
Enter a number to configure and start ORDS in standalone mode
[1] Configure and start ORDS in standalone mode
[2] Skip
Choose [1]: --我这里是直接选择的独立模式,1
Enter a number to select the protocol
[1] HTTP
[2] HTTPS
Choose [1]:
Enter the HTTP port [8080]: --直接回车
Enter the APEX static resources location: /u01/app/apex/images --这个注意选择实际图片的位置,如果选择错误,后面进入APEX会报错
The setting named: db.connectionType was set to: basic in configuration: default
The setting named: db.hostname was set to: localhost in configuration: default
The setting named: db.port was set to: 1521 in configuration: default
The setting named: db.servicename was set to: pdbapex in configuration: default
The setting named: plsql.gateway.mode was set to: proxied in configuration: default
The setting named: db.username was set to: ORDS_PUBLIC_USER in configuration: default
The setting named: db.password was set to: ****** in configuration: default
The setting named: feature.sdw was set to: true in configuration: default
The global setting named: database.api.enabled was set to: true
The setting named: restEnabledSql.active was set to: true in configuration: default
The setting named: security.requestValidationFunction was set to: ords_util.authorize_plsql_gateway in configuration: default
The global setting named: standalone.http.port was set to: 8080
The global setting named: standalone.static.path was set to: /u01/app/apex/ords/images/
The global setting named: standalone.static.context.path was set to: /i
The global setting named: standalone.context.path was set to: /ords
The global setting named: standalone.doc.root was set to: /etc/ords/config/global/doc_root
2024-02-16T05:38:27.316Z INFO Created folder /u01/app/ords/logs
2024-02-16T05:38:27.317Z INFO The log file is defaulted to the current working directory located at /u01/app/ords/logs
2024-02-16T05:38:27.401Z INFO Installing Oracle REST Data Services version 23.4.0.r3461619 in PDBAPEX
2024-02-16T05:38:29.366Z INFO ... Verified database prerequisites
2024-02-16T05:38:29.986Z INFO ... Created Oracle REST Data Services proxy user
2024-02-16T05:38:31.158Z INFO ... Created Oracle REST Data Services schema
2024-02-16T05:38:32.130Z INFO ... Granted privileges to Oracle REST Data Services
2024-02-16T05:38:35.984Z INFO ... Created Oracle REST Data Services database objects
2024-02-16T05:38:51.981Z INFO Completed installation for Oracle REST Data Services version 23.4.0.r3461619. Elapsed time: 00:00:24.541
2024-02-16T05:38:52.103Z INFO Completed configuring PL/SQL gateway user for Oracle REST Data Services version 23.4.0.r3461619. Elapsed time: 00:00:00.116
2024-02-16T05:38:52.103Z INFO Log file written to /u01/app/ords/logs/ords_install_2024-02-16_053827_31798.log
2024-02-16T05:38:52.352Z INFO HTTP and HTTP/2 cleartext listening on host: 0.0.0.0 port: 8080
2024-02-16T05:38:52.407Z INFO Disabling document root because the specified folder does not exist: /etc/ords/config/global/doc_root
2024-02-16T05:38:52.408Z INFO Default forwarding from / to contextRoot configured.
2024-02-16T05:38:56.989Z INFO Configuration properties for: |default|lo|
db.servicename=pdbapex
standalone.context.path=/ords
db.hostname=localhost
db.password=******
conf.use.wallet=true
security.requestValidationFunction=ords_util.authorize_plsql_gateway
standalone.static.context.path=/i
database.api.enabled=true
db.username=ORDS_PUBLIC_USER
standalone.http.port=8080
standalone.static.path=/u01/app/apex/ords/images/
restEnabledSql.active=true
resource.templates.enabled=false
plsql.gateway.mode=proxied
db.port=1521
feature.sdw=true
config.required=true
db.connectionType=basic
standalone.doc.root=/etc/ords/config/global/doc_root
2024-02-16T05:38:56.990Z WARNING *** jdbc.MaxLimit in configuration |default|lo| is using a value of 20, this setting may not be sized adequately for a production environment ***
2024-02-16T05:38:56.991Z WARNING *** jdbc.InitialLimit in configuration |default|lo| is using a value of 3, this setting may not be sized adequately for a production environment ***
2024-02-16T05:39:01.635Z INFO
Mapped local pools from /etc/ords/config/databases:
/ords/ => default => VALID
2024-02-16T05:39:01.850Z INFO Oracle REST Data Services initialized
Oracle REST Data Services version : 23.4.0.r3461619
Oracle REST Data Services server info: jetty/10.0.18
Oracle REST Data Services java info: OpenJDK 64-Bit Server VM 11.0.22+7-LTS
针对前面的选择,可以使用 ords config list 列出设置
[oracle@dbserver ~]$ ords config list
ORDS: Release 23.4 Production on Fri Feb 16 06:07:02 2024
Copyright (c) 2010, 2024, Oracle.
Configuration:
/etc/ords/config/
Database pool: default
Setting Value Source
---------------------------------- --------------------------------- -----------
database.api.enabled true Global
db.connectionType basic Pool
db.hostname localhost Pool
db.password ****** Pool Wallet
15.卸载APEX
如果安装出现了问题,可以卸载
卸载 apex
cd /u01/app/apex
sql>conn / as sysdba;
sql>alter session set container=pdbapex;
sql> @apxremov.sql
卸载 ords
$ ords uninstall --回车即可卸载
16.拷贝Apex的静态文件到ords目录
cp -r /u01/app/apex/images /u01/app/ords
17.设置开机自启动
# cat > /etc/systemd/system/ords.service << EOF
[Unit]
Description=Start Oracle REST Data Services
After=oracle_has.service
[Service]
User=oracle
Environment=ORDS_CONFIG='/etc/ords/config'
Environment=JDK_JAVA_OPTIONS='-Dconfig.url=/work/dbtools-dev/config/'
ExecStart=/u01/app/ords/bin/ords serve --apex-images /u01/app/apex/images
StandardOutput=syslog
SyslogIdentifier=ords
[Install]
WantedBy=multi-user.target
EOF
18. 访问APEX
http://192.168.133.120:8080
点击右下角的下箭头按钮,以管理员权限登录;不用工作区登录,之后,可以创建自己的工作区等等。
到此,APEX23.2 安装完毕,可以尽情去使用低代码平台吧。