Search This Blog

Monday, February 1, 2016

How to install Apex5 in windows and configure Oracle REST Data Services as web listener


Installing Apex5

Before installing apex 5 you should determine which Web listener you would like to use. Available options include the followings -
  • Oracle REST Data Services
  • Embedded PL/SQL Gateway
  • Oracle HTTP Server and mod_plsql
In all of these options Apex installation procedure is same and configuring Embedded PL/SQL Gateway is simpler. Embedded PL/SQL gateway provides the equivalent core features of Oracle HTTP Server and MOD_PLSQL. In this article I’ll install apex 5 and configure the Oracle REST Data Services with tomcat server. In this case I've used
  • Oracle Database 11gR2 (11.2.0) 64-bit
  • Oracle apex 5.0
  • Toad 12.8 64-bit
  • Windows 7 64-bit
N.B. I’ve discussed on Apex 4.2 installation with Embedded PL/SQL Gateway configuration here
Remember I’ll not discus about installing database. I assume that you have a database already installed and you have the administrative privileges on the database. Also assume that you have downloaded apex. If not so, you may get a copy of Oracle Apex 5.0 on OTN

Steps to install Oracle Apex 5

Step 1: Login to database and create a table space (e.g.TS_APEX). Table space creating command is as below

Step 2: Unzip the apex folder. (Right click on folder then choose extract here) you will find a folder named apex. Copy this folder anywhere on your hard drive you wish. In my case I’ve put it in H:\SoftWare\Apex\apex.
Step 3: Open Command Prompt (cmd). Change your working directory to apex where you put the unzipped apex folder (in my case it is H:\SoftWare\Apex\apex). Below images showing the command

</ br>
Step 4: Now open SQL*Plus with nolog option by executing the command H:\SoftWare\Apex\apex> sqlplus /nolog Then SQL> conn sys as sysdba (To connect to database with sysdba privileges) When password require enter sys user’s password.
Step 5: Now you need to run apex installation file named apexins.sql. in command prompt enter the command like below SQL> @apexins.sql ts_apex ts_apex temp /i/ [Here APEXINS.SQL is the apex main installation file. TS_APEX is the table space name which we creates at first step for apex user,temp is also a table space for apex temporary file. /i/ is a virtual drive for images. ] It may take 20/30 minutes and may be disconnect from database. Remember whenever you disconnect from database every time you must follow the step (3, 4) to connect again. When Oracle Application Express installed, it creates three new database accounts:
  • APEX_05000 - The account that owns the Oracle Application Express schema and metadata
  • FLOWS_FILES - The account that owns the Oracle Application Express uploaded files
  • APEX_PUBLIC_USER - The minimally privileged account used for Oracle
When installation is finished it shows message like flowing image
In a new installation of Oracle Application Express, you must change the password of the internal ADMIN account. To changes password connect to database again and run the flowing command SQL> @apxchpwd When prompted enter a password for the ADMIN account. It should be complex password like abcd#1234 Also you need to unlock APEX_PUBLIC_USER. To unlock account execute the following command


Configuring Restful Services

To configure oracle restful service connect to the database as sysdba and enter the following command SQL> @apex_rest_config.sql
Enter a password for the APEX_LISTENER user              []
Enter a password for the APEX_REST_PUBLIC_USER user              []

Installing and Configuring Oracle Rest Data Services

a. Download the file ”” from the Oracle REST Data Services download page
b. Unzip the downloaded zip file into a directory (folder) of your choice. I put it in E:\ords. Actually there is nothing to install, that means your installation is done. Now you need to configure the Rest Data Service.
I. By default, the context roots for accessing Oracle Application Express through Oracle REST Data Services is …/ords. If you wish to have a context root of … /apex for accessing Oracle Application Express, rename the file ords.war (E:\ords.\ords.war) to apex.war before installing Oracle Rest Data Service. If you change the ords.war to apex.war then change the file Open the file (location E:\ords.\params) enter the line as it is here:
II. Create a folder named config in the rest data service folder (E:\ords.\config) to store rest data service configuration data. Later this location will be needed during configuration. Remember you can provide any location in your hard drive. To keep it in one place I've create this folder in ords. folder
c. following are the Installation/configuration options-
  • Simple Installation/configuration Using a Parameter File
  • Advanced Installation/configuration Using Command-Line Prompts
  • Manual Installation/configuration (If You Do Not Have SYSDBA Privileges)
We will Choose 'Advanced Installation/configuration Using Command-Line Prompts' from these options

Now open cmd and change your working directory to the directory or folder containing the ords.war file (in my case it is E:\ords. you don't have rename ords.war to apex.war then enter the following command E:\ords.> java -jar ords.war install advanced
if you have rename ords.war to apex.war then enter the following command E:\ords.> java -jar apex.war install advanced It will prompt you for some configuration information. Here I’ve showed the full prompt and what I selected.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>cd E:\ords.


E:\ords.>java -jar apex.war install advanced
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\azad>cd D:\Oracle\RestDataService\ords.


D:\Oracle\RestDataService\ords.>java -jar apex.war install advanced
This Oracle REST Data Services instance has not yet been configured.
Please complete the following prompts

Enter the location to store configuration data:D:\Oracle\RestDataService\ords.\config
Enter the name of the database server [localhost]:bh
Enter the database listen port [1521]:
Enter 1 to specify the database service name, or 2 to specify the database SID [1]:2
Enter the database SID [xe]:erp
Enter 1 if you want to verify/install Oracle REST Data Services schema or 2 to skip this step [1]:
Enter the database password for ORDS_PUBLIC_USER:
Confirm password:

Please login with SYSDBA privileges to verify Oracle REST Data Services schema. Installation may be

Enter the username with SYSDBA privileges to verify the installation [SYS]:
Enter the database password for SYS:
Confirm password:
Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step.
If using Oracle Application Express or migrating from mod_plsql then you must enter 1 [1]:
Enter the PL/SQL Gateway database user name [APEX_PUBLIC_USER]:
Enter the database password for APEX_PUBLIC_USER:
Confirm password:
Enter 1 to specify passwords for Application Express RESTful Services database users 
 or 2 to skip this step [1]:
Enter the database password for APEX_LISTENER:
Confirm password:
Enter the database password for APEX_REST_PUBLIC_USER:
Confirm password:
Feb 07, 2016 5:48:05 PM oracle.dbtools.common.config.file.ConfigurationFilesBase update
INFO: Updated configurations: defaults, apex, apex_pu, apex_al, apex_rt
... Log file written to 
Feb 07, 2016 5:48:06 PM oracle.dbtools.installer.Installer upgradeORDS
INFO: Upgrading Oracle REST Data Services schema to version
... Log file written to 
Feb 07, 2016 5:48:07 PM oracle.dbtools.installer.Installer upgradeORDS
INFO: Upgrading Oracle REST Data Services schema to version
... Log file written to 
Feb 07, 2016 5:48:11 PM oracle.dbtools.installer.Installer upgradeORDS
INFO: Upgrading Oracle REST Data Services schema to version
... Log file written to 
Feb 07, 2016 5:48:12 PM oracle.dbtools.installer.Installer upgradeORDS
INFO: Upgrading Oracle REST Data Services schema to version
... Log file written to 
Feb 07, 2016 5:48:12 PM oracle.dbtools.installer.Installer upgradeORDS
INFO: Upgrading Oracle REST Data Services schema to version
... Log file written to 
... Log file written to 
Feb 07, 2016 5:48:13 PM oracle.dbtools.installer.Installer upgradeORDS
INFO: Completed upgrade for Oracle REST Data Services version  
Elapsed time: 00:00:08.175

Enter 1 if you wish to start in standalone mode or 2 to exit [1]:2


Installing Apache Tomcat Application Server

To download tomcat go to tomcat site. From left side click on your desired version number. On the next page click on 32-bit/64-bit windows service installer it will download the tomcat .exe for windows. Now install tomcat by running downloaded (.exe) file

1. Deploying to Apache Tomcat

To configure Oracle Application Express Images on Apache Tomcat: Create a folder into /webapps (in my case it is E:\Tomcat 9.0\webapps) named i. Copy the contents from the /images folder (in my case it is H:\SoftWare\Apex\apex\images) to /webapps/i/.

Installing the Apache Tomcat Deployment

Move the ords.war or apex.war file from rest data service into tomcat’s webapps folder (/webapps) folder where Apache Tomcat is installed Access Oracle Application Express by typing the following URL in your web browser: http://hostname:port/ords/ or http://hostname:port/apex/

Saturday, January 16, 2016

How to configure YUM Server in Linux(RHEL 6)

YUM stand for Yellowdog Updater Modified which is developed to maintain an RPM-based system. By default YUM server use online repository but it can be configured for local repository. In this tutorial we will configure yum server in RHEL 6.2 with local repository. The process of configuring yum server in RHEL 6.0 is same as RHEL 6.2. Main xml file name is different in this two version. Another different named file is server.repo in 6.0 and rhel-source.repo in 6.2.
The step what is done during configuring yum server is as bellow :
  • step 1: I've created a directory named yum_repo.
  • step 2: Directly copy Packages folder to yum_repo directory from linux dvd.
  • step 3: Directly copy main xml file (8afad1febf2d8844a235a9ab1aa5f15c9cec1219b9d01060d4794435cf59dffe-comps-rhel6-Server.xml) to yum_repo directory from linux dvd. Then rename the file as comps-rhel6-Server.xml for ease of use. you can rename it as you like.
  • step 4: Install Three RPM which are required for YUM Server- deltarpm, python-deltarpm and createrepo. To do so, change your working directory to Packages
    then enter the following command
    now you can Verify that the RPM is installed successfully by following command
  • step 5: Generate local repository files using main xml file (yum_repo/comps-rhel6-Server.xml) command is as bellow createrepo -g /yum_repo/comps-rhel6-Server.xml . N.B. After file path(/yum_repo/comps-rhel6-Server.xml) a space and a dot is required. this dot tel Linux to create repository to current directory(yum_repo/Packages)
  • step 6: Now it is needed to create new entry in rhel-source.repo(server.repo in 6.0) file. File location is /etc/yum.repos.d/rhel-source.repo to Create new entry in rhel-source.repo file open the file with vi editor. Command for opening the file vi /etc/yum.repos.d/rhel-source.repo after opening the file press i from your keyboard to go to insert mode. Now make the entry as bellow images.
    Press esc button to exit insert mode. press :wq to save and exit vi editor.
  • step 7: During this configuration process yum creates a cache of metadata and packages. This cache can take up a lot of space. yum clean all command allows you to clean up these files.
  • step 8: To download and make usable all the metadata for the currently enabled yum repository use the following command yum makecache
  • step 9: To list all packages and package group from all the repositories configured use the command yum list all and yum grouplist.
  • step 10: Test Yum server by installing any RMP from newly configured yum server. you can install binutils [This RPM is required for Oracle server] open a new terminal and enter the following command
  • DONE!! Enjoy YUM Server!!
If you have any query, please let me know through comment. -Thank You.