Connect to APEX Newly Created Oracle Schema with Toad

Here is a tutorial of creating apex workspace, schema and import application.
1. Go to apex site and log into internal space use admin/password.
From manage workspace>> create workspace >> name workspace as "DASH01" and go to next step.


2.  Make sure you choose 'NO' for Re-use existing schema. Fill in the rest required filed. Here Schema name and schema password will be used to connect to this schema from Toad.

3. Fill in Admin user name, password and email as required. Click create workspace in the next step.

4.  Start Toad, create new connection
User/Schema: DASH01
password: where you provided as in step 2
In Dire Tab, provide Host/Port/SID.


5.  Go to old APEX application site as regular user.
Go to Home>>SQL Workshop>> Utilities>>Generate DDL and click create script. In the "Object Type" step, check Table. Select "Check All" in "Object Name" step.






6. The generated script will be at SQL Workshop>> SQL Scripts
Open and execute the script in Toad will create all the tables in new APEX.

7. Connect to old APEX schema in Toad. Choose Database>>Schema Browser
Select all tables and>>choose "copy data to another schema" from right click.



Upgrade APEX from 4.02 to 4.2.5 on Ubuntu

The version of APEX installed along with Oracle 11g R2 Express Edition is V4.0.2 which is not the latest version. Here is a tutorial of how to upgrade APEX from version 4.0.2 to version 4.2.5.

1. Download the latest version of Application Express from the Oracle Technology Network and Unzip the downloadloaded zip file:
unzip apex_4.2.5_en.zip
#change the working directory to unzip folder
cd apex
2. Start SQL*Plus and connect to the Oracle XE database:
sqlplus /nolog
SQL> CONNECT SYS as SYSDBA
Enter Password: 
SYS_Password
3. Install Application Express:
SQL> @apexins SYSAUX SYSAUX TEMP /i/
4. Copy images folder from apex/images to a different location to prevent failure of loading images in the next step
mkdir -p /tmp/apex/images/
cp -r imges/* /tmp/apex/images

5. Log back into SQL*Plus (as above) and load images:
SQL> @apxldimg.sql /tmp
6. Upgrade Application Express password:
SQL> @apxchpwd
Enter password for Application Express ADMIN account.
7. 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 6

Allow outside Connectino to Server Running in VMWare Player on Ubuntu

Here is a tutorial of how to enable other computer than your host computer connect to web server running in VMWare Player.
1. Modify nat.conf file
sudo vim /etc/vmware/vmnet8/nat/nat.conf
locate incomingtcp section modify accordingly.
[incomingtcp]

# Use these with care - anyone can enter into your VM through these...
# The format and example are as follows:
#<external port number> = <VM's IP address>:<VM's port number>
8080 = 192.168.64.131:8080

2. close VMWare Player application and restart vmware to make the configuration take effect.
sudo service vmware restart

Modify a python package installed as a single EGG file

Sometimes, you want to modify a python package installed in your python library. How about if you see the package youjust installed is a single .egg file? You could still open it with your favorite decompress program, such as 7zip, since we know .egg file is just a ZIP file. After decompress you get folders which contain regular.py and .pyc file for you to work on. Then you can put the decompressed folder into your site-package directory keeping the same name (use original .egg name as directory name).

Make post request using m2urllib2 from M2Crypto

I was debugging a POST request initiated by m2urllib2.urlopen(req) without success. All I got are GET request. Till this morning I realized one parameter has been causing problems.

Old request (GET request)

req = m2urllib2.Request('https://openam.example.com:8445/openam/json/piv/authenticate','None', headers)
res = m2urllib2.urlopen(req)

Revised request (POST request)

req = m2urllib2.Request('https://openam.example.com:8445/openam/json/piv/authenticate','', headers)
res = m2urllib2.urlopen(req)
Pay attention to the second parameter in m2urllib2.Request, if I use 'None', it would be GET request; if I use '', it would be POST request. I could not find out why.

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...