apex也可以算作是oracle的一个组件,它的功能就是使oracle数据库具有web开发的功能。那么当oracle数据库在初始创建的时候没有安装apex组件,当需要使用的时候,就有两种选择了,一是使用自带的默认版本,二是安装升级官网最新版本.
web开发工具
低代码
基于oracle数据库
参考资料:apex oracle
本文基于第一种方法安装,使用自带的组件安装,non-cdb
安装
安装前检查
SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
Session altered.
SQL> col username for a30
SQL> set pages 1000 lines 1000
SQL> select username,USER_ID,ACCOUNT_STATUS,CREATED from dba_users order by created desc;
USERNAME USER_ID ACCOUNT_STATUS CREATED
------------------------------ ---------- -------------------------------- -------------------
HR 100 EXPIRED & LOCKED 2019-10-01 17:08:30
MDDATA 98 LOCKED 2019-10-01 17:01:20
OLAPSYS 95 LOCKED 2019-10-01 17:01:08
SI_INFORMTN_SCHEMA 91 LOCKED 2019-10-01 16:58:10
ORDSYS 88 LOCKED 2019-10-01 16:58:10
ORDDATA 89 LOCKED 2019-10-01 16:58:10
ORDPLUGINS 90 LOCKED 2019-10-01 16:58:10
MDSYS 92 LOCKED 2019-10-01 16:58:10
CTXSYS 86 EXPIRED & LOCKED 2019-10-01 16:57:38
OJVMSYS 84 LOCKED 2019-10-01 16:55:31
WMSYS 75 LOCKED 2019-10-01 16:54:31
ANONYMOUS 66 EXPIRED & LOCKED 2019-10-01 16:49:31
XDB 65 LOCKED 2019-10-01 16:49:31
GGSYS 63 LOCKED 2019-10-01 16:48:21
GSMCATUSER 62 LOCKED 2019-10-01 16:48:19
APPQOSSYS 58 LOCKED 2019-10-01 16:48:05
DBSNMP 57 LOCKED 2019-10-01 16:48:04
SYS$UMF 49 LOCKED 2019-10-01 16:44:25
ORACLE_OCM 40 LOCKED 2019-10-01 16:39:14
DBSFWUSER 36 LOCKED 2019-10-01 16:38:25
REMOTE_SCHEDULER_AGENT 35 LOCKED 2019-10-01 16:38:24
XS$NULL 2147483638 EXPIRED & LOCKED 2019-10-01 16:38:18
DIP 24 LOCKED 2019-10-01 16:37:58
GSMUSER 23 LOCKED 2019-10-01 16:37:47
GSMADMIN_INTERNAL 22 LOCKED 2019-10-01 16:37:46
OUTLN 13 LOCKED 2019-10-01 16:36:03
SYSDG 2147483618 LOCKED 2019-10-01 16:36:02
SYSKM 2147483619 LOCKED 2019-10-01 16:36:02
AUDSYS 8 LOCKED 2019-10-01 16:36:02
SYSRAC 2147483620 LOCKED 2019-10-01 16:36:02
SYSBACKUP 2147483617 LOCKED 2019-10-01 16:36:02
SYS 0 OPEN 2019-10-01 16:36:02
SYSTEM 9 OPEN 2019-10-01 16:36:02
33 rows selected.
SQL> col COMP_NAME for a40
SQL> select comp_name,VERSION,STATUS from dba_registry;
COMP_NAME VERSION STATUS
---------------------------------------- ------------------------------ ----------------------
Oracle Database Catalog Views 19.0.0.0.0 VALID
Oracle Database Packages and Types 19.0.0.0.0 VALID
Oracle Real Application Clusters 19.0.0.0.0 OPTION OFF
JServer JAVA Virtual Machine 19.0.0.0.0 VALID
Oracle XDK 19.0.0.0.0 VALID
Oracle Database Java Packages 19.0.0.0.0 VALID
OLAP Analytic Workspace 19.0.0.0.0 VALID
Oracle XML Database 19.0.0.0.0 VALID
Oracle Workspace Manager 19.0.0.0.0 VALID
Oracle Text 19.0.0.0.0 VALID
Oracle Multimedia 19.0.0.0.0 VALID
Spatial 19.0.0.0.0 LOADING
Oracle OLAP API 19.0.0.0.0 VALID
13 rows selected.
SQL> select comp_name,VERSION,STATUS from dba_registry where COMP_ID='APEX';
no rows selected
无组件,无apex相关用户和组件
安装
- 创建必要的表空间
su - oracle
cd $ORACLE_HOME/apex
ll apexins.sql
为了方便管理,给apex单独创建一个表空间,
sqlplus / as sysdba
CREATE TABLESPACE APEX DATAFILE '/home/oracle/apex_01.dbf'
SIZE 200M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE 1000M LOGGING
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO;
- 安装apex
安装APEX,指定默认表空间和静态文件别名
@apexins.sql tablespace_apex tablespace_files tablespace_temp images
tablespace_apex是Application Express application user的表空间
tablespace_files是Application Express files user的表空间
tablespace_temp是临时表空间
images是图片路径
@apexins APEX APEX TEMP /i/
省略
当出现如下“PL/SQL procedure successfully completed.”,表示安装成功。
查询结果:
SYS> col username for a30
SYS> select username,USER_ID,ACCOUNT_STATUS,CREATED from dba_users order by created desc;
USERNAME USER_ID ACCOUNT_STATUS CREATED
------------------------------ ---------- -------------------------------- ---------
APEX_INSTANCE_ADMIN_USER 107 OPEN 07-APR-21
APEX_PUBLIC_USER 103 LOCKED 07-APR-21
FLOWS_FILES 102 LOCKED 07-APR-21
APEX_180200 101 LOCKED 07-APR-21
HR 100 EXPIRED & LOCKED 01-OCT-19
MDDATA 98 LOCKED 01-OCT-19
OLAPSYS 95 LOCKED 01-OCT-19
SI_INFORMTN_SCHEMA 91 LOCKED 01-OCT-19
ORDPLUGINS 90 LOCKED 01-OCT-19
ORDDATA 89 LOCKED 01-OCT-19
ORDSYS 88 LOCKED 01-OCT-19
MDSYS 92 LOCKED 01-OCT-19
CTXSYS 86 EXPIRED & LOCKED 01-OCT-19
OJVMSYS 84 LOCKED 01-OCT-19
WMSYS 75 LOCKED 01-OCT-19
XDB 65 LOCKED 01-OCT-19
ANONYMOUS 66 EXPIRED & LOCKED 01-OCT-19
GGSYS 63 LOCKED 01-OCT-19
GSMCATUSER 62 LOCKED 01-OCT-19
APPQOSSYS 58 LOCKED 01-OCT-19
DBSNMP 57 LOCKED 01-OCT-19
SYS$UMF 49 LOCKED 01-OCT-19
ORACLE_OCM 40 LOCKED 01-OCT-19
DBSFWUSER 36 LOCKED 01-OCT-19
REMOTE_SCHEDULER_AGENT 35 LOCKED 01-OCT-19
XS$NULL 2147483638 EXPIRED & LOCKED 01-OCT-19
DIP 24 LOCKED 01-OCT-19
GSMUSER 23 LOCKED 01-OCT-19
GSMADMIN_INTERNAL 22 LOCKED 01-OCT-19
OUTLN 13 LOCKED 01-OCT-19
SYSKM 2147483619 LOCKED 01-OCT-19
SYSRAC 2147483620 LOCKED 01-OCT-19
SYSBACKUP 2147483617 LOCKED 01-OCT-19
SYSTEM 9 OPEN 01-OCT-19
SYSDG 2147483618 LOCKED 01-OCT-19
AUDSYS 8 LOCKED 01-OCT-19
SYS 0 OPEN 01-OCT-19
37 rows selected.
SYS> col COMP_NAME for a40
SYS> select comp_name,VERSION,STATUS from dba_registry;
COMP_NAME VERSION STATUS
---------------------------------------- ------------------------------ ----------------------
Oracle Database Catalog Views 19.0.0.0.0 VALID
Oracle Database Packages and Types 19.0.0.0.0 VALID
Oracle Real Application Clusters 19.0.0.0.0 OPTION OFF
JServer JAVA Virtual Machine 19.0.0.0.0 VALID
Oracle XDK 19.0.0.0.0 VALID
Oracle Database Java Packages 19.0.0.0.0 VALID
OLAP Analytic Workspace 19.0.0.0.0 VALID
Oracle XML Database 19.0.0.0.0 VALID
Oracle Workspace Manager 19.0.0.0.0 VALID
Oracle Text 19.0.0.0.0 VALID
Oracle Multimedia 19.0.0.0.0 VALID
Spatial 19.0.0.0.0 LOADING
Oracle OLAP API 19.0.0.0.0 VALID
Oracle Application Express 18.2.0.00.12 VALID
14 rows selected.
SYS> select comp_name,VERSION,STATUS from dba_registry where COMP_ID='APEX';
COMP_NAME VERSION STATUS
---------------------------------------- ------------------------------ ----------------------
Oracle Application Express 18.2.0.00.12 VALID
1 row selected.
已经出现apex相关配置用户和组件了,表示安装成功。
- 配置apex
创建APEX实例管理员(Instance Administration)及密码,这个密码必须包含特殊符号,否则设置不上。这个密码很重要,是管理APEX平台的账号密码,以后创建新的应用schema、解锁账号等都靠它,第一次登录APEX时也要用到。
SQL> @apxchpwd.sql
Enter the administrator’s username [ADMIN] --enter
Enter ADMIN’s email [ADMIN] --enter
Enter ADMIN’s password [] --eg:Huawei12#$
- 配置RESTful Services服务
SQL> @apex_rest_config.sql --该命令让你创建APEX_LISTENER和APEX_REST_PUBLIC_USER用户并设置密码)
Enter a password for the APEX_LISTENER user [] --oracle
Enter a password for the APEX_REST_PUBLIC_USER user [] --oracle
SQL> select username,USER_ID,ACCOUNT_STATUS,CREATED from dba_users order by created desc;
USERNAME USER_ID ACCOUNT_STATUS CREATED
------------------------------ ---------- -------------------------------- -------------------
APEX_REST_PUBLIC_USER 109 OPEN 2021-04-07 11:05:24
APEX_LISTENER 108 OPEN 2021-04-07 11:05:23
APEX_INSTANCE_ADMIN_USER 107 OPEN 2021-04-07 10:57:09
FLOWS_FILES 102 LOCKED 2021-04-07 10:55:23
APEX_PUBLIC_USER 103 LOCKED 2021-04-07 10:55:23
APEX_180200 101 LOCKED 2021-04-07 10:55:21
HR 100 EXPIRED & LOCKED 2019-10-01 17:08:30
MDDATA 98 LOCKED 2019-10-01 17:01:20
OLAPSYS 95 LOCKED 2019-10-01 17:01:08
ORDDATA 89 LOCKED 2019-10-01 16:58:10
ORDPLUGINS 90 LOCKED 2019-10-01 16:58:10
ORDSYS 88 LOCKED 2019-10-01 16:58:10
SI_INFORMTN_SCHEMA 91 LOCKED 2019-10-01 16:58:10
MDSYS 92 LOCKED 2019-10-01 16:58:10
CTXSYS 86 EXPIRED & LOCKED 2019-10-01 16:57:38
OJVMSYS 84 LOCKED 2019-10-01 16:55:31
WMSYS 75 LOCKED 2019-10-01 16:54:31
ANONYMOUS 66 EXPIRED & LOCKED 2019-10-01 16:49:31
XDB 65 LOCKED 2019-10-01 16:49:31
GGSYS 63 LOCKED 2019-10-01 16:48:21
GSMCATUSER 62 LOCKED 2019-10-01 16:48:19
APPQOSSYS 58 LOCKED 2019-10-01 16:48:05
DBSNMP 57 LOCKED 2019-10-01 16:48:04
SYS$UMF 49 LOCKED 2019-10-01 16:44:25
ORACLE_OCM 40 LOCKED 2019-10-01 16:39:14
DBSFWUSER 36 LOCKED 2019-10-01 16:38:25
REMOTE_SCHEDULER_AGENT 35 LOCKED 2019-10-01 16:38:24
XS$NULL 2147483638 EXPIRED & LOCKED 2019-10-01 16:38:18
DIP 24 LOCKED 2019-10-01 16:37:58
GSMUSER 23 LOCKED 2019-10-01 16:37:47
GSMADMIN_INTERNAL 22 LOCKED 2019-10-01 16:37:46
OUTLN 13 LOCKED 2019-10-01 16:36:03
AUDSYS 8 LOCKED 2019-10-01 16:36:02
SYSTEM 9 OPEN 2019-10-01 16:36:02
SYSRAC 2147483620 LOCKED 2019-10-01 16:36:02
SYSDG 2147483618 LOCKED 2019-10-01 16:36:02
SYSBACKUP 2147483617 LOCKED 2019-10-01 16:36:02
SYS 0 OPEN 2019-10-01 16:36:02
SYSKM 2147483619 LOCKED 2019-10-01 16:36:02
39 rows selected.
可以看到,多了两个用户APEX_REST_PUBLIC_USER 和APEX_LISTENER。
在Oracle Application Express中配置RESTful服务时,它将创建两个新的数据库帐户。
APEX_LISTENER -用于查询存储在Oracle Application Express中的RESTful服务定义的帐户。
APEX_REST_PUBLIC_USER -调用存储在Oracle Application Express中的RESTful服务定义时使用的帐户。
- 禁用数据库内置的PL/SQL网关
SQL> exec dbms_xdb.sethttpport(0);
SQL> exec dbms_xdb.setftpport(0);
- 解锁ORDS用户账号.解锁更改APEX_PUBLIC_USER的密码
SQL> alter user apex_public_user account unlock;
SQL> alter user apex_public_user identified by “your password”;
- 安装后检查
SQL> select username,USER_ID,ACCOUNT_STATUS,CREATED from dba_users order by created desc;
USERNAME USER_ID ACCOUNT_STATUS CREATED
------------------------------ ---------- -------------------------------- -------------------
APEX_REST_PUBLIC_USER 109 OPEN 2021-04-07 11:05:24
APEX_LISTENER 108 OPEN 2021-04-07 11:05:23
APEX_INSTANCE_ADMIN_USER 107 OPEN 2021-04-07 10:57:09
FLOWS_FILES 102 LOCKED 2021-04-07 10:55:23
APEX_PUBLIC_USER 103 OPEN 2021-04-07 10:55:23
APEX_180200 101 LOCKED 2021-04-07 10:55:21
HR 100 EXPIRED & LOCKED 2019-10-01 17:08:30
MDDATA 98 LOCKED 2019-10-01 17:01:20
OLAPSYS 95 LOCKED 2019-10-01 17:01:08
ORDDATA 89 LOCKED 2019-10-01 16:58:10
ORDPLUGINS 90 LOCKED 2019-10-01 16:58:10
ORDSYS 88 LOCKED 2019-10-01 16:58:10
SI_INFORMTN_SCHEMA 91 LOCKED 2019-10-01 16:58:10
MDSYS 92 LOCKED 2019-10-01 16:58:10
CTXSYS 86 EXPIRED & LOCKED 2019-10-01 16:57:38
OJVMSYS 84 LOCKED 2019-10-01 16:55:31
WMSYS 75 LOCKED 2019-10-01 16:54:31
ANONYMOUS 66 EXPIRED & LOCKED 2019-10-01 16:49:31
XDB 65 LOCKED 2019-10-01 16:49:31
GGSYS 63 LOCKED 2019-10-01 16:48:21
GSMCATUSER 62 LOCKED 2019-10-01 16:48:19
APPQOSSYS 58 LOCKED 2019-10-01 16:48:05
DBSNMP 57 LOCKED 2019-10-01 16:48:04
SYS$UMF 49 LOCKED 2019-10-01 16:44:25
ORACLE_OCM 40 LOCKED 2019-10-01 16:39:14
DBSFWUSER 36 LOCKED 2019-10-01 16:38:25
REMOTE_SCHEDULER_AGENT 35 LOCKED 2019-10-01 16:38:24
XS$NULL 2147483638 EXPIRED & LOCKED 2019-10-01 16:38:18
DIP 24 LOCKED 2019-10-01 16:37:58
GSMUSER 23 LOCKED 2019-10-01 16:37:47
GSMADMIN_INTERNAL 22 LOCKED 2019-10-01 16:37:46
OUTLN 13 LOCKED 2019-10-01 16:36:03
AUDSYS 8 LOCKED 2019-10-01 16:36:02
SYSTEM 9 OPEN 2019-10-01 16:36:02
SYSRAC 2147483620 LOCKED 2019-10-01 16:36:02
SYSDG 2147483618 LOCKED 2019-10-01 16:36:02
SYSBACKUP 2147483617 LOCKED 2019-10-01 16:36:02
SYS 0 OPEN 2019-10-01 16:36:02
SYSKM 2147483619 LOCKED 2019-10-01 16:36:02
39 rows selected.
SQL> col COMP_NAME for a40
SQL> select comp_name,VERSION,STATUS from dba_registry where COMP_ID='APEX';
COMP_NAME VERSION STATUS
---------------------------------------- ------------------------------ ----------------------
Oracle Application Express 18.2.0.00.12 VALID
apex组件已经安装,apex相关用户已经创建,相关用户也已经解锁。
访问apex
需要先安装ORDS服务。如果有 TOMCAT 这些WEB 服务,就不需要安装ords服务了,此处我们没有,需要先安装ords服务。
安装过程需要jdk,所以先手动安装jdk软件:
[root@oracle19c oracle]# rpm -ivh jdk-8u281-linux-x64.rpm
warning: jdk-8u281-linux-x64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:jdk1.8-2000:1.8.0_281-fcs ################################# [100%]
Unpacking JAR files...
tools.jar...
plugin.jar...
javaws.jar...
deploy.jar...
rt.jar...
jsse.jar...
charsets.jar...
localedata.jar...
[root@oracle19c oracle]# find / -name ords.war
/u01/app/oracle/product/19.3.0/dbhome_1/ords/ords.war
[root@oracle19c oracle]# cd /usr/java/
default/ jdk1.8.0_281-amd64/ latest/
[root@oracle19c oracle]# cd /usr/java/jdk1.8.0_281-amd64/bin/
[root@oracle19c bin]# /usr/java/jdk1.8.0_281-amd64/bin/java -jar /u01/app/oracle/product/19.3.0/dbhome_1/ords/ords.war install advanced
–卸载,就是java -jar ords.war uninstall
下面使具体过程输出:
This Oracle REST Data Services instance has not yet been configured.
Please complete the following prompts
Enter the location to store configuration data:/home/oracle/config <<< ords配置文件路径,手动配置在/home/oracle/config
Enter the name of the database server [localhost]:10.1.11.10 <<<oracle服务器地址
Enter the database listen port [1521]: <<<监听端口号,默认1521,我这里直接enter
Enter 1 to specify the database service name, or 2 to specify the database SID [1]: <<<enter
Enter the database service name:orcl <<<配置oracle数据库service name:orcl
Enter 1 if you want to verify/install Oracle REST Data Services schema or 2 to skip this step [1]: <<<enter
Enter the database password for ORDS_PUBLIC_USER: <<<设置用户ORDS_PUBLIC_USER密码,随便设置,此处我设置为"oracle"
Confirm password: <<<在输入密码一次
Requires SYS AS SYSDBA to verify Oracle REST Data Services schema.
Enter the database password for SYS AS SYSDBA: <<<oracle数据库sys用户密码,此处输入oracle
Confirm password: <<<再输入一次密码
Retrieving information.
Enter the default tablespace for ORDS_METADATA [SYSAUX]: ---<<<enter
Enter the temporary tablespace for ORDS_METADATA [TEMP]: ---<<<enter
Enter the default tablespace for ORDS_PUBLIC_USER [USERS]: ---<<<enter
Enter the temporary tablespace for ORDS_PUBLIC_USER [TEMP]: ---<<<enter
Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step.
If using Oracle Application Express or migrating from mod_plsql then you must enter 1 [1]: ---<<<enter
Enter the PL/SQL Gateway database user name [APEX_PUBLIC_USER]:
Enter the database password for APEX_PUBLIC_USER: <<<输入上面解锁的APEX_PUBLIC_USER用户的密码,此处输入"oracle"
Confirm password: <<<在输入一次密码
Enter 1 to specify passwords for Application Express RESTful Services database users (APEX_LISTENER, APEX_REST_PUBLIC_USER) or 2 to skip this step [1]: <<<enter
Enter the database password for APEX_LISTENER: <<<输入上面创建APEX_LISTENER用户的密码,此处输入"oracle"
Confirm password: <<<在输入一次密码
Enter the database password for APEX_REST_PUBLIC_USER: <<<输入上面创建APEX_REST_PUBLIC_USER用户的密码,此处输入"oracle"
Confirm password: <<<在输入一次密码
Apr 07, 2021 1:55:11 PM
INFO: reloaded pools: []
Installing Oracle REST Data Services version 18.4.0.r3541002
... Log file written to /root/ords_install_core_2021-04-07_135512_00580.log
... Verified database prerequisites
... Created Oracle REST Data Services schema
... Created Oracle REST Data Services proxy user
... Granted privileges to Oracle REST Data Services
... Created Oracle REST Data Services database objects
... Log file written to /root/ords_install_datamodel_2021-04-07_135527_00667.log
... Log file written to /root/ords_install_apex_2021-04-07_135529_00578.log
Completed installation for Oracle REST Data Services version 18.4.0.r3541002. Elapsed time: 00:00:19.95
Enter 1 if you wish to start in standalone mode or 2 to exit [1]: <<<enter
Enter the APEX static resources location: <<<enter,此处应该输入image的路径,我直接回车了,所以后面登录有点问题
Enter 1 if using HTTP or 2 if using HTTPS [1]: <<<enter
Enter the HTTP port [8080]: <<<设置端口号,默认8080,如果有占用,就要修改,重新设置一个端口号,此处直接enter
2021-04-07 13:55:54.858:INFO::main: Logging initialized @116801ms to org.eclipse.jetty.util.log.StdErrLog
Apr 07, 2021 1:55:54 PM
INFO: HTTP and HTTP/2 cleartext listening on port: 8080
Apr 07, 2021 1:55:54 PM
INFO: Disabling document root because the specified folder does not exist: /home/oracle/config/ords/standalone/doc_root
2021-04-07 13:55:55.380:INFO:oejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 1.8.0_281-b09
2021-04-07 13:55:55.423:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2021-04-07 13:55:55.423:INFO:oejs.session:main: No SessionScavenger set, using defaults
2021-04-07 13:55:55.423:INFO:oejs.session:main: node0 Scavenging every 600000ms
Apr 07, 2021 1:55:59 PM
INFO: Configuration properties for: |apex|al|
db.hostname=10.1.11.10
db.password=******
db.port=1521
db.servicename=orcl
db.username=APEX_LISTENER
resource.templates.enabled=true
security.requestValidationFunction=wwv_flow_epg_include_modules.authorize
security.validationFunctionType=plsql
Apr 07, 2021 1:55:59 PM
WARNING: *** jdbc.MaxLimit in configuration |apex|al| is using a value of 10, this setting may not be sized adequately for a production environment ***
Apr 07, 2021 1:55:59 PM
WARNING: *** jdbc.InitialLimit in configuration |apex|al| is using a value of 3, this setting may not be sized adequately for a production environment ***
Apr 07, 2021 1:56:04 PM
INFO: Configuration properties for: |apex|pu|
db.hostname=10.1.11.10
db.password=******
db.port=1521
db.servicename=orcl
db.username=ORDS_PUBLIC_USER
resource.templates.enabled=true
security.requestValidationFunction=wwv_flow_epg_include_modules.authorize
security.validationFunctionType=plsql
Apr 07, 2021 1:56:04 PM
WARNING: *** jdbc.MaxLimit in configuration |apex|pu| is using a value of 10, this setting may not be sized adequately for a production environment ***
Apr 07, 2021 1:56:04 PM
WARNING: *** jdbc.InitialLimit in configuration |apex|pu| is using a value of 3, this setting may not be sized adequately for a production environment ***
Apr 07, 2021 1:56:07 PM
INFO: Configuration properties for: |apex|rt|
db.hostname=10.1.11.10
db.password=******
db.port=1521
db.servicename=orcl
db.username=APEX_REST_PUBLIC_USER
resource.templates.enabled=true
security.requestValidationFunction=wwv_flow_epg_include_modules.authorize
security.validationFunctionType=plsql
Apr 07, 2021 1:56:07 PM
WARNING: *** jdbc.MaxLimit in configuration |apex|rt| is using a value of 10, this setting may not be sized adequately for a production environment ***
Apr 07, 2021 1:56:07 PM
WARNING: *** jdbc.InitialLimit in configuration |apex|rt| is using a value of 3, this setting may not be sized adequately for a production environment ***
Apr 07, 2021 1:56:10 PM
INFO: Configuration properties for: |apex||
db.hostname=10.1.11.10
db.password=******
db.port=1521
db.servicename=orcl
db.username=APEX_PUBLIC_USER
resource.templates.enabled=true
security.requestValidationFunction=wwv_flow_epg_include_modules.authorize
security.validationFunctionType=plsql
Apr 07, 2021 1:56:10 PM
WARNING: *** jdbc.MaxLimit in configuration |apex|| is using a value of 10, this setting may not be sized adequately for a production environment ***
Apr 07, 2021 1:56:10 PM
WARNING: *** jdbc.InitialLimit in configuration |apex|| is using a value of 3, this setting may not be sized adequately for a production environment ***
Apr 07, 2021 1:56:12 PM
INFO: Oracle REST Data Services initialized
Oracle REST Data Services version : 18.4.0.r3541002
Oracle REST Data Services server info: jetty/9.4.z-SNAPSHOT
2021-04-07 13:56:12.742:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@1ea9f6af{/ords,null,AVAILABLE}
2021-04-07 13:56:12.762:INFO:oejs.AbstractConnector:main: Started ServerConnector@f381794{HTTP/1.1,[http/1.1, h2c]}{0.0.0.0:8080}
2021-04-07 13:56:12.764:INFO:oejs.Server:main: Started @134707ms
2021-04-07 13:57:27.015:WARN:oejh.HttpParser:qtp501187768-20: Illegal character 0x16 in state=START for buffer HeapByteBuffer@6fb70d11[p=1,l=517,c=8192,r=516]={\x16<<<\x03\x01\x02\x00\x01\x00\x01\xFc\x03\x03\x98\xEa%\nk\x13R...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
2021-04-07 13:57:27.015:WARN:oejh.HttpParser:qtp501187768-16: Illegal character 0x16 in state=START for buffer HeapByteBuffer@5eb02c51[p=1,l=517,c=8192,r=516]={\x16<<<\x03\x01\x02\x00\x01\x00\x01\xFc\x03\x03\xC1\xE5\xA9\xFc\xE6\xDf\xAa...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
2021-04-07 13:57:27.031:WARN:oejh.HttpParser:qtp501187768-14: Illegal character 0x16 in state=START for buffer HeapByteBuffer@6d84221[p=1,l=517,c=8192,r=516]={\x16<<<\x03\x01\x02\x00\x01\x00\x01\xFc\x03\x03\x02\xEf?\xFe\xD0>\xF2...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
2021-04-07 13:57:27.032:WARN:oejh.HttpParser:qtp501187768-14: Illegal character 0x16 in state=START for buffer HeapByteBuffer@6d84221[p=1,l=517,c=8192,r=516]={\x16<<<\x03\x01\x02\x00\x01\x00\x01\xFc\x03\x03\n\xB0\xEc\xB4\xC1\xEe\xBc...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
Apr 07, 2021 1:59:31 PM
WARNING:
** Request had db ELAPSED time of :5068ms **
安装ords中出现的问题:
第一个错误:
此处是设置用户密码,所以不存在密码验证,但是连接数据库失败,连接串失败,拿连接串手动连接,也会报错,原来是监听没启动,启动后,恢复正常。
第二个错误:
由于前面配置8080端口的时候,直接回车,而服务器上面的8080已经被别的进程占用,所以ords启动的时候,就会报错,应该换一个端口,如8081.
登录:
第一次登录用:http://10.1.11.10:8080/ords/apex_admin
的工作区是 INTERNAL 工作区
后面创建工作区后: hhttp://10.1.11.10:8080/ords
如下:由于没有设置image,所以登录页面有点异常。
卸载
卸载apex:脚本:SQL> @apxremov
[oracle@oracle19c dbhome_1]$ cd apex/
[oracle@oracle19c apex]$ ls -ltr apxremov.sql
-rw-r--r--. 1 oracle oinstall 2972 Jan 20 2018 apxremov.sql
[oracle@oracle19c apex]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Apr 7 11:39:15 2021
Version 19.4.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
SQL> @apxremov
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
...Removing Application Express
...set_appun.sql
Session altered.
PL/SQL procedure successfully completed.
...set_ufrom_and_upgrade.sql
PL/SQL procedure successfully completed.
Session altered.
PL/SQL procedure successfully completed.
...set_appun.sql
Session altered.
PL/SQL procedure successfully completed.
...set_ufrom_and_upgrade.sql
PL/SQL procedure successfully completed.
User dropped.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
Package dropped.
PL/SQL procedure successfully completed.
...Application Express Removed
********************************************************************
** You must exit this SQL*Plus session before running apexins.sql **
********************************************************************
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
查看卸载结果
SQL> col username for a30
SQL> set pages 1000 lines 1000
SQL> select username,USER_ID,ACCOUNT_STATUS,CREATED from dba_users order by created desc;
USERNAME USER_ID ACCOUNT_STATUS CREATED
------------------------------ ---------- -------------------------------- ---------
ORDS_METADATA 113 EXPIRED & LOCKED 07-APR-21
ORDS_PUBLIC_USER 114 OPEN 07-APR-21
HR 100 EXPIRED & LOCKED 01-OCT-19
MDDATA 98 LOCKED 01-OCT-19
OLAPSYS 95 LOCKED 01-OCT-19
ORDPLUGINS 90 LOCKED 01-OCT-19
ORDDATA 89 LOCKED 01-OCT-19
ORDSYS 88 LOCKED 01-OCT-19
SI_INFORMTN_SCHEMA 91 LOCKED 01-OCT-19
MDSYS 92 LOCKED 01-OCT-19
CTXSYS 86 EXPIRED & LOCKED 01-OCT-19
OJVMSYS 84 LOCKED 01-OCT-19
WMSYS 75 LOCKED 01-OCT-19
ANONYMOUS 66 EXPIRED 01-OCT-19
XDB 65 LOCKED 01-OCT-19
GGSYS 63 LOCKED 01-OCT-19
GSMCATUSER 62 LOCKED 01-OCT-19
APPQOSSYS 58 LOCKED 01-OCT-19
DBSNMP 57 LOCKED 01-OCT-19
SYS$UMF 49 LOCKED 01-OCT-19
ORACLE_OCM 40 LOCKED 01-OCT-19
DBSFWUSER 36 LOCKED 01-OCT-19
REMOTE_SCHEDULER_AGENT 35 LOCKED 01-OCT-19
XS$NULL 2147483638 EXPIRED & LOCKED 01-OCT-19
DIP 24 LOCKED 01-OCT-19
GSMUSER 23 LOCKED 01-OCT-19
GSMADMIN_INTERNAL 22 LOCKED 01-OCT-19
OUTLN 13 LOCKED 01-OCT-19
SYSDG 2147483618 LOCKED 01-OCT-19
SYSKM 2147483619 LOCKED 01-OCT-19
AUDSYS 8 LOCKED 01-OCT-19
SYSRAC 2147483620 LOCKED 01-OCT-19
SYSBACKUP 2147483617 LOCKED 01-OCT-19
SYS 0 OPEN 01-OCT-19
SYSTEM 9 EXPIRED(GRACE) 01-OCT-19
35 rows selected.
SQL>
SQL> col COMP_NAME for a40
SQL> select comp_name,VERSION,STATUS from dba_registry;
select comp_name,VERSION,STATUS from dba_registry where COMP_ID='APEX';
COMP_NAME VERSION STATUS
---------------------------------------- ------------------------------ ----------------------
Oracle Database Catalog Views 19.0.0.0.0 VALID
Oracle Database Packages and Types 19.0.0.0.0 VALID
Oracle Real Application Clusters 19.0.0.0.0 OPTION OFF
JServer JAVA Virtual Machine 19.0.0.0.0 VALID
Oracle XDK 19.0.0.0.0 VALID
Oracle Database Java Packages 19.0.0.0.0 VALID
OLAP Analytic Workspace 19.0.0.0.0 VALID
Oracle XML Database 19.0.0.0.0 VALID
Oracle Workspace Manager 19.0.0.0.0 VALID
Oracle Text 19.0.0.0.0 VALID
Oracle Multimedia 19.0.0.0.0 VALID
Spatial 19.0.0.0.0 LOADING
Oracle OLAP API 19.0.0.0.0 VALID
13 rows selected.
SQL>
no rows selected
可以看到,apex相关用户和组件已经卸载。卸载成功。
卸载ords:
[root@oracle19c ~]# /usr/java/jdk1.8.0_281-amd64/bin/java -jar /u01/app/oracle/product/19.3.0/dbhome_1/ords/ords.war uninstall advanced
Enter the name of the database server [10.1.11.10]:
Enter the database listen port [1521]:
Enter 1 to specify the database service name, or 2 to specify the database SID [1]:
Enter the database service name [orcl]:
Requires SYS AS SYSDBA to verify Oracle REST Data Services schema.
Enter the database password for SYS AS SYSDBA:
Confirm password:
Retrieving information.
Uninstalling Oracle REST Data Services
... Log file written to /root/ords_uninstall_core_2021-04-07_150423_00075.log
Completed uninstall for Oracle REST Data Services. Elapsed time: 00:00:00.837
卸载可能报错:
1、卸载apex的时候,执行SQL> @apxremov脚本,可能会报如下错:
其实跟卸载ords的时候报错差不多:
都是当前用户在登录,不能删除,那我们尝试手动删除:
SQL> set pages 1000 lines 1000
SQL> col username for a30
SQL> select username,USER_ID,ACCOUNT_STATUS,CREATED from dba_users order by created desc;
USERNAME USER_ID ACCOUNT_STATUS CREATED
------------------------------ ---------- -------------------------------- ---------
ORDS_PUBLIC_USER 111 OPEN 07-APR-21
APEX_LISTENER 108 OPEN 07-APR-21
APEX_REST_PUBLIC_USER 109 OPEN 07-APR-21
APEX_PUBLIC_USER 103 OPEN 07-APR-21
HR 100 EXPIRED & LOCKED 01-OCT-19
MDDATA 98 LOCKED 01-OCT-19
OLAPSYS 95 LOCKED 01-OCT-19
。。。。。。。。。
就是前面4个用户。
SQL> drop user APEX_LISTENER cascade;
drop user APEX_LISTENER cascade
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected
SQL> drop user APEX_REST_PUBLIC_USER cascade;
drop user APEX_REST_PUBLIC_USER cascade
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected
SQL> select username,sid,serial# from v$session where username='APEX_LISTENER';
USERNAME SID SERIAL#
------------------------------ ---------- ----------
APEX_LISTENER 17 60993
APEX_LISTENER 275 3937
SQL> select username,sid,serial# from v$session where username='APEX_REST_PUBLIC_USER';
USERNAME SID SERIAL#
------------------------------ ---------- ----------
APEX_REST_PUBLIC_USER 62 37254
APEX_REST_PUBLIC_USER 294 29291
SQL> select username,sid,serial# from v$session where username='APEX_PUBLIC_USER';
USERNAME SID SERIAL#
------------------------------ ---------- ----------
APEX_PUBLIC_USER 63 9100
APEX_PUBLIC_USER 64 39381
SQL> select username,sid,serial# from v$session where username='ORDS_PUBLIC_USER';
USERNAME SID SERIAL#
------------------------------ ---------- ----------
ORDS_PUBLIC_USER 61 33878
ORDS_PUBLIC_USER 293 25030
SQL> ALTER SYSTEM DISCONNECT SESSION '17,60993' IMMEDIATE;
System altered.
SQL> ALTER SYSTEM DISCONNECT SESSION '275,3937' IMMEDIATE;
System altered.
SQL> ALTER SYSTEM DISCONNECT SESSION '62,37254' IMMEDIATE;
System altered.
SQL> ALTER SYSTEM DISCONNECT SESSION '294,29291' IMMEDIATE;
System altered.
SQL> ALTER SYSTEM DISCONNECT SESSION '63,9100' IMMEDIATE;
System altered.
SQL> ALTER SYSTEM DISCONNECT SESSION '64,39381' IMMEDIATE;
System altered.
SQL> ALTER SYSTEM DISCONNECT SESSION '61,33878' IMMEDIATE;
System altered.
SQL> ALTER SYSTEM DISCONNECT SESSION '293,25030' IMMEDIATE;
System altered.
语句:
select username,sid,serial# from v$session where username=‘ORDS_PUBLIC_USER’;
ALTER SYSTEM DISCONNECT SESSION ‘17,60993’ IMMEDIATE;
然后再卸载apex和ords。
SQL> @apxremov
都会卸载成功。