Menu

Installation

Domen Dolar

Installation

1. Pre-requirements

To install RASD environment you have to have Oracle database installed. If you don't have it, you can download one of free copies of Oracle Database Express Edition 11g. New releases are coming - I hope soon.
You can also use Autonomous Transaction Processing database (Oracle Cloud)

The solution uses PL/SQL Web Toolkit. The PL/SQL Web Toolkit is part of the standard installation of the database, so no supplementary installation is necessary.

If you will use embedded gateway then in database you have to have configured XML DB HTTP Listener. The embedded PL/SQL gateway is installed as part of Oracle XML DB. If you are using a preconfigured database created during an installation or by the Database Configuration Assistant (DBCA), then Oracle XML DB is already installed and configured.


Oracle database installation:

Oracle Database Express Edition installation process

  1. Download the latest version of Oracle DB and folow the instructions to install (Oracle Database Express Edition 11g ~ 312MB)
  2. Install (it takes around 2 minutes)
    • Unzip package -> Run Setup -> Next, Next... -> Finish
    • The default instalaltion parameters for Oracle Database Express Edition 11g
      Destination Folder: C:\oraclexe\ 
      Oracle Home: C:\oraclexe\app\oracle\product\11.2.0\server\ 
      Oracle Base:C:\oraclexe\ 
      Port for 'Oracle Database Listener': 1521
      Port for 'Oracle Services for Microsoft Transaction Server': 2030
      Port for 'Oracle HTTP Listener': 8080
      
  3. Start DB
    • In Windows Start -> Oracle Database 11g Express Edition -> Start Database

Autonomous Transaction Processing database in Oracle Cloud installation process is very simple and the free database is prepared in a minutes.


To access Oracle database environment and run SQL scripts below you have to have installed Oracle DB Client (Admin - gives you Utilities, SQLPlus and Network programs). In environment where you have installed Database the client is already there. I recommend to run scripts on that environment where Database is installed.

For installing environment you will need only sqlplus tool. All BLOB, CLOB's are imported with insert statements. You need to configure client to acces your Database (use of instant client). Configure TNS NAME to access Database: Net Configuration Assistance -> Local Net Service Name confuguration -> Add -> Database information.

2. Installing RASD environment

For quick installation of RASD you use prepared script 01_createRASD.sql (step 1), adding "your_application_schema" (step 2) and configuring embeded PL/SQL gateway (step 3: Configuration RASD environment and Configuration of access to RASD environment) you can run [this script]. In script change credentiails based on your environment. If you would like to use one of your schemas where you would like to generate programs then change "your_application_schema" to your existing one.

First you have to download the latest version of RASD and unzip it.

Description of 01_createRASD.sql steps:

1.Creating RASD schema with all objects

conn system/your_pwd@your_db_tns_alias
prompt CREATE RASD ENVIORMENT 
@rasd/00.create_schema_rasd.sql
conn rasd/rwerw32423WERwwe@your_db_tns_alias 
@rasd/01.rasd_objects.sql
@rasd/02.rasd_app_db_data.sql
commit;
conn system/your_pwd@your_db_tns_alias 
@rasd/03.2.create_app_privileges.sql
@rasd/03.3.add_ACL.sql
commit;

2.Now you have to configure user - schema where all applications will be stored - your_app_schema - you can use your own schema HR, SCOTT, ...

If you use your own schema with your own tables (not sample ones) then you run steps:

conn sys/your_pwd@your_db_tns_alias as sysdba  //not mandatory - optional
@your_app_schema/0.create_your_app_schema_sysprvs.sql //not mandatory - optional
conn your_app_schema/pwd@your_db_tns_alias
@your_app_schema/1.rasd_clinet_table_documents.sql
@your_app_schema/4.rasd_client_DOCUMENTS_data.sql
@your_app_schema/5.rasd_client_privileges.sql
commit;

Or you can create sample tables too

prompt CREATE YOUR CLIENT
conn system/your_pwd@your_db_tns_alias
@your_app_schema/0.create_your_app_schema.sql
conn sys/your_pwd@your_db_tns_alias as sysdba
@your_app_schema/0.create_your_app_schema_sysprvs.sql
conn your_app_schema/pwd@your_db_tns_alias
@your_app_schema/1.rasd_clinet_table_documents.sql
@your_app_schema/2.rasd_clinet_table_of_user_scott.sql
@your_app_schema/3.rasd_client_applications.sql
@your_app_schema/4.rasd_client_DOCUMENTS_data.sql
@your_app_schema/5.rasd_client_privileges.sql
commit;

3.*Create access over ORDS or embeded PL/SQL gateway
Described in folowing steps...

3. Configuration RASD environment

You can create different type of architecture. Multi developers, multi / one line of business architectures. All is based on your needs.
Most common topolgys are on this link [RASD Topology].

In multi DB user environment (multi user one LOB) all developers have their own DB account. All generated programs are stored in their own DB schema. All generated programs have same design look. All users use one RASD_CLIENT package! In single DB user environment (multi user multi LOB) all developers access RASD environment through one DB account. Based on that you can divide different line of bushinesses. All users has their own RASD_CLIENT package!
To create access you have to create connection in one of the gateways (in ORDS xml settings in conf folder and url-mapping.xml). You can specify as many of them you would like. With connection, you specify URL where your application will run, schema where it will be connected and many other thinks.
If you have many line of businesses in your organization and each of them have separate applications (separate design) you have to create for each its own connection (multi user, multi LOB). If all uses the same environment then can be set just one.
And there are other options. Look at the picture.

The minimum settings you have to set:

  • your_application - the name of your application or environment (sample: Finance) - url-mapping.xml
  • your_application_url - the URL where your app. will be accessed (sample: myFinance the call will then look like http(s)://ORDS or DB:port/ords/myFinance) - url-mapping.xml
  • your_app_schema + password - where all programs will be stored - your_application .xml in conf folder

4. Access to RASD environment

To access PL/SQL applications with web browser through an HTTP listener you must configure gateway. You can use.

You can configure:

  1. ORDS - Oracle REST Data Services - This is Java program that can be run embeded or in one of Java servers. How to configure it and download it is on this page. ORDS release 3.0 . You can see settings of using ORDS for prepared RASD Docker image here - [Docker steps].

  2. Embedded PL/SQL Gateway - The Embedded PL/SQL Gateway (EPG) runs in the Oracle XML DB Protocal Server within the Oracle database and includes the core features of mod_plsql. Licensing for the Embedded PL/SQL Gateway is included with the Oracle Database license. more for Oracle 11g

  3. Oracle HTTP Server (DEPRECATED)- The Oracle HTTP Server (Apache) with mod_plsql plugin can be placed on the same physical machine as the database, or on a separate physical machine.
    Note: If installed on the same physical machine as the database then the Oracle HTTP Server is included as part of the limited-use license included with the Oracle Database license - otherwise the Oracle HTTP Server will need to be licensed. more for Oracle 11g, download page

Setting Embedded PL/SQL Gateway

Here are basic settings to set gateway. More details you have here (for Oracle 11g). For other databases the story is the same.

>     /*
     // Log on to the database as an XML DB administrator, that is, a user with the XDBADMIN role assigned.
     */ 
     begin
       DBMS_EPG.create_dad('your_application', '/your_application_url/*');  
       DBMS_EPG.set_dad_attribute('your_application','authentication-mode' ,'Basic');     
       DBMS_EPG.set_dad_attribute('your_application','database-username'   ,'your_app_schema');
       DBMS_EPG.set_dad_attribute('your_application','document-path'       ,'docs');     
       DBMS_EPG.set_dad_attribute('your_application','document-procedure'  ,'documents_api.download'); 
       DBMS_EPG.set_dad_attribute('your_application','document-table-name' ,'DOCUMENTS');  
       DBMS_EPG.set_dad_attribute('your_application','default-page'        ,'welcome.page');
       DBMS_EPG.set_dad_attribute('your_application','nls-language'        ,'nls-language-settings'); 
       DBMS_EPG.AUTHORIZE_DAD('your_application', 'your_app_schema');
     end;

Setting ORDS

First you have to set url-mapping in file url-mapping.xml:

<?xml version="1.0" encoding="UTF-8"?>
<pool-config xmlns="http://xmlns.oracle.com/apex/pool-config">
 <pool name="your_app_schema" base-path="/yas" updated="2016-06-13T08:47:53.59Z"/>
 </pool-config>

then you put xml named your_app_schema.xml with database credentials. If you have all thi settings in defaults.xml then you yust specify schema (username).

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Saved on Mon May 23 13:48:51 CEST 2016</comment>
<entry key="db.password">pwd</entry>
<entry key="db.username">YOUR_APP_SCHEMA</entry>
<entry key="db.hostname">database host</entry>
<entry key="db.port">port</entry>
<entry key="db.servicename">sn</entry>
</properties>

or you can do this executing commnads where ORDS is running

-- mapping URL
$ java -jar ords.war map-url --type base-path /yas your_app_schema 
-- set db connection
$java -jar ords.war setup --database YOUR_APP_SCHEMA

Disable security.requestValidationFunction setting in defaults.xml.

For using RASD you have to comment security.requestValidationFunction setting. In RASD this functionality is set in RASD_CLIENT. More in [Customization].

The result in defaults.xml should be:

<!-- <entry key="security.requestValidationFunction">wwv_flow_epg_include_modules.authorize</entry> -->

or you can use RASD prepared authorization function rasdc_security.wwv_flow_epg_include_mod_local

An the result in defaults.xml should be:

<entry key="security.requestValidationFunction">rasdc_security.wwv_flow_epg_include_mod_local</entry>

5. Testing

To test that environment is set OK you have to test URL:

http://your_ords_location:port/ords/your_application_url/welcome.page

or

http://your_database_location_if_you_set_embedded_gw:port/your_application_url/welcome.page

To see client credentials you can open program

http://your_ords_location:port/ords/your_application_url/test_dad_comm?GUID=123

The result you should see

welcome page

Video not available

Go back to [Welcome]


Related

Wiki: Customization
Wiki: Docker steps
Wiki: RASD Topology
Wiki: Welcome
Wiki: this script

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.