본문 바로가기
5. 개발 플랫폼 Low Code

APEX 수동설치 on DBCS

by MY잭슨 2023. 6. 21.

ADB와 APEX 서비스에 자동으로 설치된 것을 사용하는 것이 아닌 수동으로 APEX와 ORDS를 DBCS (Database Cloud Service)에 설치하여 활용

 

사전준비

2022.07.21 - [7. 실습 Hands-on Lab] - 나도한다 시리즈N - OCI 기본 실습 DBCS (생성, 연결)

 

기존 설치 삭제

sudo su -
su - oracle
cd $ORACLE_HOME/apex
sqlplus "/ as sysdba"
SQL> @apxremov_cdb.sql
SQL> exit
exit

 

APEX 다운로드 (v23.1)

root>>
sudo su -
cd /tmp
wget https://download.oracle.com/otn_software/apex/apex-latest.zip
unzip apex-latest.zip -d /u01/app
rm apex-latest.zip
cd /u01/app
chown -R oracle:oinstall apex

 

APEX 설치

oracle>>
su - oracle
cd /u01/app/apex
sqlplus "/as sysdba"
SQL> show pdbs;
SQL> alter session set container=DB06202_PDB1;
SQL> create tablespace APEX datafile size 100m autoextend on next 1m;
SQL> @apexins.sql APEX APEX TEMP /i/

SQL> @apxchpwd.sql
SQL> @apex_rest_config.sql
SQL> alter user APEX_PUBLIC_USER identified by "PassW0rd##11" account unlock;
SQL> create profile PASSWORD_UNLIMITED limit password_life_time unlimited;
SQL> alter user APEX_PUBLIC_USER profile PASSWORD_UNLIMITED;
SQL> exit

 

패스워드 재확인

sqlplus "/as sysdba"
SQL> alter user SYS identified by "PassW0rd##11" account unlock;
SQL> alter user SYSTEM identified by "PassW0rd##11" account unlock;
SQL> alter session set container=DB06202_PDB1;
SQL> alter user APEX_LISTENER identified by "PassW0rd##11" account unlock;
SQL> alter user APEX_PUBLIC_USER identified by "PassW0rd##11" account unlock;
SQL> alter user APEX_REST_PUBLIC_USER identified by "PassW0rd##11" account unlock;
SQL> exit

 

ORDS 다운로드 (v23.1.4)

root>>
sudo su -
adduser ordsuser
cd /tmp
wget https://download.oracle.com/otn_software/java/ords/ords-latest.zip
mkdir /u01/app/ords
mv /tmp/ords-latest.zip /u01/app/ords/
chown -R ordsuser:ordsuser /u01/app/ords
cd /u01/app/ords
ls -ltr
su ordsuser
unzip ords-latest.zip
rm ords-latest.zip
exit

 

DB시스템 방화벽 오픈 및 VCN Security List 오픈 포트 8080

root>>
iptables -I INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
service iptables save
service iptables reload

 

ORDS 설치 및 실행 (java 11 설치)

root>> 
yum install -y java-11-openjdk
find / -name *jdk-11*

su - oracle
sqlplus "/as sysdba"
SQL> alter session set container=DB06202_PDB1;
SQL> select limit from dba_profiles where profile='DEFAULT' and resource_name='PASSWORD_VERIFY_FUNCTION'; --ORA12C_STRONG_VERIFY_FUNCTION
SQL> alter profile default limit password_verify_function null;
SQL> exit

from root>>
su - ordsuser
echo -e 'export PATH="$PATH:///u01/app/ords/bin"' >> ~/.bash_profile
export ORDS_HOME=/u01/app/ords
export ORDS_CONFIG=$ORDS_HOME/conf
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.0.1.el7_9.x86_64
$JAVA_HOME/bin/java -version
export PATH=$JAVA_HOME/bin:$PATH
cd $ORDS_HOME/bin

./ords --config /u01/app/ords/conf install

 

[ordsuser@jkm2 bin]$ echo -e 'export PATH="$PATH:///u01/app/ords/bin"' >> ~/.bash_profile
[ordsuser@jkm2 bin]$ export ORDS_HOME=/u01/app/ords
[ordsuser@jkm2 bin]$ export ORDS_CONFIG=$ORDS_HOME/conf
[ordsuser@jkm2 bin]$ export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.0.1.el7_9.x86_64
[ordsuser@jkm2 bin]$ $JAVA_HOME/bin/java -version
openjdk version "11.0.19" 2023-04-18 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.19.0.7-1.0.1.el7_9) (build 11.0.19+7-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.19.0.7-1.0.1.el7_9) (build 11.0.19+7-LTS, mixed mode, sharing)
[ordsuser@jkm2 bin]$ export PATH=$JAVA_HOME/bin:$PATH
[ordsuser@jkm2 bin]$ cd $ORDS_HOME/bin
[ordsuser@jkm2 bin]$
[ordsuser@jkm2 bin]$ ./ords --config /u01/app/ords/conf install
2023-06-21T14:17:07.115Z INFO        Your configuration folder /u01/app/ords/conf is located in ORDS product folder.  Oracle recommends to use a different configuration folder.

ORDS: Release 23.1 Production on Wed Jun 21 14:17:07 2023

Copyright (c) 2010, 2023, Oracle.

Configuration:
  /u01/app/ords/conf/

The configuration folder /u01/app/ords/conf 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]: 10.0.1.137
  Enter the database listen port [1521]: 1521
  Enter the database service name [orcl]: DB06202_pdb1.usagejkm.usagejkm.oraclevcn.com
  Provide database user name with administrator privileges.
    Enter the administrator username: sys as sysdba
  Enter the database password for sys as sysdba:
Connecting to database user: sys as sysdba url: jdbc:oracle:thin:@//10.0.1.137:1521/DB06202_pdb1.usagejkm.usagejkm.oraclevcn.com

Retrieving information.
  Enter the default tablespace for ORDS_METADATA and ORDS_PUBLIC_USER [SYSAUX]:
  Enter the temporary tablespace for ORDS_METADATA and ORDS_PUBLIC_USER [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]: 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]: 1
  Enter the HTTP port [8080]: 8080
  Enter the APEX static resources location: /u01/app/apex/images/
optional to set back>>
sqlplus "/as sysdba"
SQL> alter session set container=DB06202_PDB1;
SQL> alter profile default limit password_verify_function ORA12C_STRONG_VERIFY_FUNCTION;
SQL> exit

 

확인

http://<Your Public IP>:8080

http://193.122.138.150:8080

 

 

 

 

 

 

참고

https://videohub.oracle.com/media/Manual+Installation+of+APEX+on+DBCS/1_9ldlzoc3

https://videohub.oracle.com/media/Manual+Installation+of+APEX+on+DBCS+-+ORDS+Versions+22.1+and+above/1_8ymvglf5

https://oracle-base.com/articles/misc/oracle-rest-data-services-ords-standalone-mode-22-onward

댓글