Recently, after setting up APEX for the nth time, I wanted to give the stack a try. I’ve been developing around Oracle technologies for more than 20 years and I felt it was the time. After some serious searches, I came across an Oracle blog that was discussing about migrating from Oracle Forms & APEX, which I was looking for.
[Forms to APEX] Creating a Migration Project (oracle.com)
By the end of the article, author had given a link to the sample application “Summit” that was directly migrated from Oracle Forms. Currently, APEX doesn’t support direct migrations from anymore. Regardless, the example project was truly informative. I suggest you to create a document using the explanations provide with the blog, which could help you with many details later.
Throughout this post, I will be explaining how to setup the Summit sample database, so that once you import the sample application, you can experience it better. By the beginning of the blog, it clearly states that the sample application was directly migrated from “Summit forms application” and the latest version of the sample was 10g. So, your initial goal is to get a copy of “summit” sample database & don’t be surprised! You can still download the whole 10g summit sample from this link! (or you can download a fixed app+db copy from my blog, link is provided by the end of the article)
If you are going to use the source downloaded from Oracle, extract the archive and you will find “summit.dmp”. We need just few tables from this export file. I suggest that you define a new schema for the sample database. Please follow the standard practices whenever your applying these to PRODUCTION environments. Everything I explain here are only for TEST environments.
CREATE USER SUMMIT IDENTIFIED BY SUMMITDEFAULT TABLESPACE EXAMPLETEMPORARY TABLESPACE TEMP/GRANT DBA TO SUMMIT/GRANT CONNECT TO SUMMIT/GRANT RESOURCE TO SUMMIT/
Newly created “Summit” schema prior the demo application installation.
We just need few tables from this summit database for the APEX application and we are going to achieve our requirement in a pretty awkward manner.
Once you created the schema, add it to your APEX workspace and import the APEX sample application that you downloaded. It is a pretty straight forward thing and when the installer asks you to install the additional components, proceed.
Do not forget to change the Parsing Schema incase if your workspace is associated with multiple schemas.
Proceed with the installation. It takes just few seconds and must install the supporting Objects (that are tables, procedures, sequences, functions etc)
Click “Install Support Objects”
Before running the application, let us see what table objects were created by the installation process. We need to import ONLY those tables from the summit.dmp that we extracted from the 10g sample application archive.
Let’s run the application and see how it looks before importing the table objects. All the blocks says “No data to display”.
Let us drop all the tables from the schema. I am doing the below activity as system user.
DROP TABLE SUMMIT.S_CUSTOMER CASCADE CONSTRAINTS PURGE/DROP TABLE SUMMIT.S_DEPT CASCADE CONSTRAINTS PURGE/DROP TABLE SUMMIT.S_EMP CASCADE CONSTRAINTS PURGE/DROP TABLE SUMMIT.S_IMAGE CASCADE CONSTRAINTS PURGE/DROP TABLE SUMMIT.S_INVENTORY CASCADE CONSTRAINTS PURGE/DROP TABLE SUMMIT.S_ITEM CASCADE CONSTRAINTS PURGE/DROP TABLE SUMMIT.S_LONGTEXT CASCADE CONSTRAINTS PURGE/DROP TABLE SUMMIT.S_ORD CASCADE CONSTRAINTS PURGE/DROP TABLE SUMMIT.S_PRODUCT CASCADE CONSTRAINTS PURGE/DROP TABLE SUMMIT.S_REGION CASCADE CONSTRAINTS PURGE/DROP TABLE SUMMIT.S_TITLE CASCADE CONSTRAINTS PURGE/DROP TABLE SUMMIT.S_WAREHOUSE CASCADE CONSTRAINTS PURGE/
From an elevated command prompt, switch to the folder where you have the dump file and execute the below command. Adjust the parameters based on your environment.
imp userid=SUMMIT/SUMMIT@ORCL FROMUSER=SUMMIT TOUSER=SUMMIT file="D:\summit10g\summit.dmp" TABLES=(S_CUSTOMER, S_DEPT, S_EMP, S_IMAGE,S_INVENTORY,S_ITEM, S_LONGTEXT, S_ORD, S_PRODUCT, S_REGION, S_TITLE, S_WAREHOUSE) log="D:\summit10g\IMPORT.log"
Check the warning, and IMPORT_sys.sql should be empty. You can proceed now. Refresh the APEX application now. You should able to see the beautiful dashboard now.
Well, there are few more issues we should fix before calling it a day.
As soon as you will start with interacting the application, Orders will start showing an error, that will be shown on all Orders related forms.
It looks like the blogger has modified one of the tables. After some dwelling, I realized that the error was due to a missing column “ID” in the table S_ITEM that stores order items details, which might have added to meet some specific requirements by the developer. I added a new column “ID” with S_ITEM table and errors went away.
That’s it. The application stopped throwing exceptions and I was able to move around without additional issues. I fixed another error with saving a new customer record, that was due to the ID column not being assigned with an existing sequence. That’s for another time!
Download the fixed application along with sample database (customer record fix available)