Upgrade Oracle Apex from 4.2.x to 5.0 on CentOS

Here is a tutorial of how to upgrade APEX from version 4.2.x to version 4.2.5.

1. Download the latest version of Application Express from the Oracle Technology Network and Unzip the downloaded file:
#unzip files to /tmp folder
unzip apex_5.0_en.zip -d /tmp
#change the working directory to unzip folder
cd /tmp/apex
2. Start SQL*Plus and connect to the Oracle XE database:
sqlplus / as sysdba 
3. Install Application Express:
SQL> @apexins SYSAUX SYSAUX TEMP /i/
4. Updating the images directory
@apex_epg_config.sql /tmp
5. If you are using ORDS, copy images to your application server. I am using Tomcat,
sudo cp /tmp/apex/images/* /var/lib/tomcat6/webapps/i/
6. Prepare two new database accounts for ORDS
@apex_rest_config.sql
when prompted enter password for these two accounts:
APEX_LISTENER: APEXLISTENER
APEX_REST_PUBLIC_USER:APEXREST
7. Modify account profiles for APEX_PUBLIC_USER,APEX_LISTENER,APEX_REST_PUBLIC_USER to disable password expire:
# UNLIMITED_PASSWORD_LIFETIMEhas been created
alter USER APEX_PUBLIC_USER PROFILE UNLIMITED_PASSWORD_LIFETIME;
alter USER APEX_LISTENER PROFILE UNLIMITED_PASSWORD_LIFETIME;
alter USER APEX_REST_PUBLIC_USER PROFILE UNLIMITED_PASSWORD_LIFETIME;
8. Modify instance admin password if you wish. Old password is preserved and carried over.
SQL> @apxchpwd
Enter password for Application Express ADMIN account.
9. In a Web browser, navigate to the Oracle Application Express Administration Services application:
http://127.0.0.1:8080/apex/apex_admin
In Username, enter ADMIN
In Password, enter the password entered in (Step 8.)

Problems and Solution:
1. Q.There is a problem with your environment because the Application Exress files have not been loaded....

A. Copy files in /tmp/apex/images/* to your web application folder, see step (5.)

2. Q. There are issues with the configuration of the Static Files in your environment. Please ...

A. Have you run @apex_rest_config.sql to preapre the accounts required for ORDS? Step (6.)

Set Column Data No-Wrap for Oracle Apex Interactive Report

To set column data no wrap for Oracle Apex Interactive report, copy the following line into page css set up inline box:
table.apexir_WORKSHEET_DATA td {white-space:nowrap;}

Left Align Oracle Apex (Sub-)regions

How to left align Oracle sub-regions

Create more than one sub-regions, for example 3 of them, namely query1, query2 and query3. Modify grid layout and region attributes for each of sub-regions.
Query 1:
Start New Grid: NO
Start new Row: NO
Column: 1
Column Span: Automatic
Column Attributes: style="width:420px;"
Region Attributes: style="width:400px;height:150px;background-color:#DEE9E8;"

Query 2:
Start New Grid: NO
Start new Row: NO
Column: 2
Column Span: Automatic
Column Attributes: style="width:420px;"
Region Attributes: style="width:400px;height:150px;background-color:#F9FDD9;"
Query 3:
Start New Grid: NO
Start new Row: NO
Column: 3
Column Span: Automatic
Column Attributes: (left blank)
Region Attributes: style="width:400px;height:150px;background-color:#CEF6CE;"
In this example column width (420px) is larger than the region width (400px), therefore there are spaces between two regions. Column attributes for the last sub-region is left blank, to make the 100% table width.

Add another schema to Oracle Apex application

Case One
The following procedure is good if you have admin account for Internal workspace.
1. Log into Internal workspace with admin account.
2. Go to Manage Workspace

3. Choose "Manage Workspace to Schema Assignments" under "Workspace Actions"
 
4. Add Schema >> Existing >> Select the workspace, to which you are adding schema >> choose the schema you want to add

Case Two
If you have Apex application admin account
1. Go to the application, to which you want to add schema.
2. Click administration
3. Choose manage service

4. Make a service request
 
5. Request Schema >> fill in the content accordingly Wait for Apex administration to approve your request.


Now, we have added the schema to Apex application, there is two more things we need to do:
1) granting select previlege to your application PARSING_SCHEMA. The parsing schema is the schema you defined when creating or importing an Apex application. An internal workspace administrator could find it for you if you do not know.
connect / as sysdba
grant select on schema_name.table_name to PARSING_SCHEMA;
2) make sure you use fully qualified table names, i.e. prefix the object name with the schema name, when querying tables from non-parsing_schema.

Forwarding Host Ports to Guest Running in VAWARE Player

In this case both host and guest are running Linux machine. And the gust's network setting is NAT. 1. grap guest ip address, showing 192.168.64.132 in my case.
ip add
2. Modify section
[incomingtcp]
of
 /etc/vmware/vmnet8/nat/nat.conf 
file in host operation system, by adding the following line to the file:
#forward port 8080 of host machine to port 8080 of virtual machine
8080 = 192.168.64.132:8080 
3. save and restart Vmware network
vmware-networks --stop
vmware-networks --start
4. check and make sure that the forwarding port in guest system is open.
sudo vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...