1. Create User: oracle
2. RAM 8 GB, Space 30 GB
======================================================================================================
Following software are installed in the given order for Apex.
1-jdk-16.0.2_linux-x64_bin.tar.gz
2-Oracle Database 19.3.
3-apex_21.1_en.zip
4-apache-tomcat-10.0.10.tar.gz
5-ords-21.2.0.174.1826.zip(ords have a .war file which will be deployed on tomacat to access apex).
======================================================================================================
1-Install Oracle Database
# sudo su
# curl -o oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm
# yum -y localinstall oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm
# mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
# chwon -R oracle:oinstall /u01 /oradata
# chwon -R 775 /u01 /oradata
# cat /etc/hostname
# passwd oracle [set a Pass for oracle user]
# systemctl stop firewalld
# systemctl disable firewalld
#reboot [Login Oracle User]
# cd /u01/
# ls [app, LINUX????.zip]
# cd app/oracle/product/19.0.0/dbhome_1
# mv /u01/LINUX.X64_193000_db_home.zip /u01/app/oracle/product/19.0.0/dbhome_1
# ls -lart
# unzip -oq LINUX.X64_193000_db_home.zip
# vi /u01/app/oracle/product/19.0.0/dbhome_1/cv/admin/cvu_config
[ *** Comment off
CV_ASSUME_DISTID=OEL5
Change to
CV_ASSUME_DISTID=OEL8
]
# /u01/app/oracle/product/19.0.0/dbhome_1/root.sh
# ./runInstaller
–> Create and Configure Single Instance
–> Server Class
–> Enterprise Edition
–> Oracle base[ Leave as default]
–> General Purpose
–> Change database name zidb and “Tick off ” Create as Container database
–> Tick- Enable autometic Memory Management; Tick- Install Sample Schama [ Sample Schema Tab]
[if it error then Tick off Enable Autometic Memory Management]
–> File System [ Leave as default]
–> UnTick Register with…
–> Tick Enable recovery and leave as default
–> Use the same password for all account [apex]
–> Next; Next
–> After finish the installation Copy the URL
# . oraenv
zidb
# sqlplus / as sysdba
SQL> select name, open_mode from v$database;
SQL> exit
# lsnrctl status
============================= Install Java =========================
# sudo dnf install java-1.8.0-openjdk
# java -version
–> With multiple Java versions installed on your system, you can set the default one with the following steps:
# alternatives –config java
================================== Install Apex 21.2=======================================================
[oracle@ifdr /]$ ps -ef|grep pmon
[oracle@ifdr /]$ cd home/software/
[oracle@ifdr software]$ unzip apex_21.2_en.zip -d /app/oracle/
[oracle@ifdr software]$ cd /app/oracle/apex
[oracle@ifdr apex]$ sqlplus / as sysdba
//SQL> create tablespace apextbs datafile ‘+DATA’ size 100M autoextend on next 10M;
SQL> create tablespace apextbs datafile ‘/app/oracle/oradata/orcl/APEX.DBF’ size 100M autoextend on next 10M;
SQL> @apexins.sql apextbs apextbs temp /i/
SYS> exit;
[oracle@ifdr apex]$ sqlplus / as sysdba
SQL> @apxchpwd.sql [For Change Password] admin/007zafar@gmail.com/Z!far1mam
//// Check Port is assigned or no
//////SQL> select dbms_xdb.gethttpport from dual;
////SQL> exec dbms_xdb.sethttpport(8080);
//////SQL> select dbms_xdb.gethttpport from dual;
SQL> @apex_rest_config.sql Z!far1mam/
SQL> exit;
[oracle@ifdr apex]$ cd /
[oracle@ifdr /]$ cd home/software/
[oracle@ifdr software /]$ mkdir -p /app/oracle/ords
[oracle@ifdr software]$ unzip ords-21.4.0.348.1956.zip -d /app/oracle/ords
[oracle@ifdr software /]$ cd /app/oracle/ords
[oracle@ifdr ords /]$ mkdir config
[oracle@ifdr ords /]$ java -jar ords.war install
–> Configuration location data: /app/oracle/ords/config
–> Name of database Server: 202.51.191.30
–> SID name: ifdr [ Admin user: sys Pass: Ideal$13579 ]
–> ords public pass: Z!far1mam
–>
–> oracle Application express: Enter
–> Apex Public user pass: Z!far1mam
–> RESTful services: Enter
–> Apex listener pass: Z!far1mam
–> Rest Public User: Z!far1mam
–> Feature to enable: 1
–> Standalone mode: 1
–> Apex Static Location: /app/oracle/apex
–> HTTP:1
–>
[oracle@ifdr ords /]$ cd /app/oracle/apex
[oracle@ifdr apex /]$ cp -r images/ /app/oracle/ords
[oracle@ifdr apex /]$ cd /app/oracle/ords
[oracle@ifdr ords /]$ java -jar ords.war standalone –port 8888 –apex-images /app/oracle/ords/images
===== Duplicate Session:
[oracle@ifdr ]$ sqlplus / as sysdba
SQL> select username,account_status from dba_users where username like ‘APEX%’;
ALTER USER APEX_LISTENER ACCOUNT UNLOCK identified by Z1far1mam;
ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK identified by Z1far1mam;
ALTER USER APEX_REST_PUBLIC_USER ACCOUNT UNLOCK identified by Z1far1mam;
//ALTER USER APEX_INSTANCE_ADMIN_USER ACCOUNT UNLOCK identified by Z1far1mam;
ALTER USER APEX_210200 ACCOUNT UNLOCK identified by Z1far1mam;
SQL> select username,account_status from dba_users where username like ‘ORDS%’;
ALTER USER ORDS_METADATA ACCOUNT UNLOCK identified by Z1far1mam;
ALTER USER ORDS_PUBLIC_USER ACCOUNT UNLOCK identified by Z1far1mam;
ALTER USER ORDSYS ACCOUNT UNLOCK identified by Z1far1mam;
ALTER USER ANONYMOUS IDENTIFIED BY Z1far1mam ACCOUNT UNLOCK;
ALTER USER XDB IDENTIFIED BY Z1far1mam ACCOUNT UNLOCK;
ALTER USER FLOWS_FILES IDENTIFIED BY Z1far1mam ACCOUNT UNLOCK;
[Optional] SYS> EXEC dbms_xdb.sethttpport(0);
202.51.191.30:8080/ords
==================== Tomcat================================
[oracle@ifdr /]$ tar -xvf apache-tomcat-9.0.27.tar.gz
[oracle@ifdr /]$ vi tomcat.env
export JAVA_HOME=/home/oracle/apex21.2/jdk-17.0.1
export CATALINA_HOME=/home/oracle/apex21.2/apache-tomcat-9.0.27
export CATALINA_BASE=$CATALINA_HOME
[oracle@ifdr /]$ $CATALINA_HOME/bin/startup.sh
Check: System IP – http://202.51.191.30:8080
========================================================
sqlplus / as sysdba
[oracle@ifdr apex /]$ cd /app/oracle/ords
Standalone mode: java -jar ords.war standalone –port 8080 –apex-images /app/oracle/ords/images/
https://www.youtube.com/watch?v=ejXGGMcohAY
1. Run Script: SELECT ‘ALTER TABLE ‘||TABLE_NAME||’ ALLOCATE EXTENT;’ FROM USER_TABLES WHERE SEGMENT_CREATED =’NO’;
-> if you find any table unallocated then copy the table and run the command
2. Tools –> Database Export ->
-> Connection: Select User -> Check OFF -> Show Schema-> Check ON -> Drops
Save as Payroll_DataBackup.sql
3. Goto Application
ex: Application 101 –> Export/Import –> Save as: Payroll_Apex_Backup.sql
4. Enter to SQL Plus
Enter user-name: sys as sysdba
Pass: zafims@123
SQL> grant dba to ifdr identified by zafims@123;
SQL> conn ifdr/zafims@123
SQL> show user
SQL> select table_name from user_tables;
5. Login As: Apex admin
6. Create Workspace –> Workspace: ifdr; Reuse Existing: YES; Schema Name: ifdr Authentication with admin user
7. Login : Workspace: ifdr user: admin pass: zafims@123
8. SQL Workshop –> SQL Script –> Upload -> Choose File –> Payroll_DataDBackup.sql –> run
9. Application Builder –> Import –> Payroll_Apex_Backup.sql
SQL> select username,account_status from dba_users where username like ‘APEX%’
SQL> col USERNAME for a20
SQL> /
SQL> alter user APEX_PUBLIC_USER account unlock;
SQL> select username,account_status from dba_users where username like ‘ORDS%’
======================= run Oracle ==========================
# sqlplus / as sysdba
select ords. installed_version from dual;
# su – oracle
# lsnrctl status;
# lsnrctl start;
cd /opt
cd oracle/
./runOracle.sh
========================================================
If your ADMIN users password is missing then login to the database as sys users and execute following script from your APEX folder,
SQL> @apxchpwd.sql
================================================================================
This script can be used to change the password of an Application Express
instance administrator. If the user does not yet exist, a user record will be
created.
================================================================================
Enter the administrator’s username [ADMIN] << Here hit enter
User “ADMIN” exists.
Enter ADMIN’s email [info@erpstuff.com] << Here hit enter
Enter ADMIN’s password []
Changed password of instance administrator ADMIN. << Provide a new password
SQL> commit;
Now login as admin in INTERNAL workspace.
Another possibility is if your ADMIN account is locked then try the following,
BEGIN
apex_util.set_security_group_id(p_security_group_id => 10);
apex_util.unlock_account(p_user_name => ‘ADMIN’);
END;
/
COMMIT;
========================================================
>>>>>>>>>>>> Resize Oracle Apex Database<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$ sqlplus
SQL> sys/oracle@orcl as sysdba
SQL> select file_id,file_name,tablespace_name,bytes/1024/1024 “in mb” from dba_data_files;
SQL> alter database datafile ‘/u01/app/oracle/oradata/ORCLCDB/orcl/APEX_1291597703607401.dbf’ resize 900m;
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
====================== Reset Ubuntu password if forgotten ===================================
–> When boot Press Shift Key
→ Advanced option for ubuntu
→ Ubuntu with Linux ( Recovery Mode)
–> Choose Root Drop to root shell prompt
–> Enter
–> ls /home
:imam
–> passwd imam
–> “Enter New password”
Or
passwd root
–> “Enter New password”
→ For writable user: mount -o remount,rw /
→ for checking user: cat /etc/passwd
Ref
Oracle : https://www.youtube.com/watch?v=jnnej5NrDB4
Apex: https://www.youtube.com/watch?v=nhPDHdLTr-U