#1 Deploy Oracle REST Data Service (ORDS)

What is ORDS ? 

ORDS is a Java application that enables developers with SQL and database skills to develop REST APIs for the Oracle Database, the Oracle Database 12c JSON Document store, and the Oracle NoSQL Database. Any application developer can use these APIs from any language environment, without installing and maintaining client drivers, in the same way they access other external services using the most widely used API technology: REST .  ORACLE site

Required Software: 

  1. JDK (download from : https://www.oracle.com/technetwork/java/javaee/downloads/jdk8-downloads-2133151.html )

    • install to c:\Program Files\Java

  1. Oracle REST (download from : https://www.oracle.com/technetwork/developer-tools/rest-data-services/downloads/index.html )
    • extract ords.war  to c:\Oracle\ords\ords.war
  2. Oracle database  12c or later


How to Enable ORDS ? 
  1. Uninstall if exists using :c:\Program Files\Java\jdk1.8.0_152\bin>java -jar c:\Oracle\ords\ords.war uninstall
    • Enter required data like SYS password
  2. Download a fresh copy of ORDS from : 
  3. install using : c:\Program Files\Java\jdk1.8.0_152\bin>java -jar D:\Oracle\ords\ords.war install
    • Enter the location to store configuration data: D:\Oracle\ords\conf
    • Enter the name of the database server [localhost]: localhost
    • Enter the database listen port [1521]: 1521
    • Enter 1 to specify the database service name, or 2 to specify the database SID [1]: 1
    • Enter the database service name : ORCL
    • Enter 1 if you want to verify/install Oracle REST Data Services schema or 2 to skip this step [1]: 1
    • Enter the database password for ORDS_PUBLIC_USER:oracle
    • Confirm password:oracle
    • Enter the administrator username:SYS *
    • Enter the database password for SYS AS SYSDBA:123456
    • Confirm password:123456
    • 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]: 2
    • Enter 1 if you wish to start in standalone mode or 2 to exit [1]: 1
    • Enter 1 if using HTTP or 2 if using HTTPS [1]:1
    • Enter the HTTP port [8080]:8080
IF you get the following message , this means ORDS is running :
2019-04-28 10:07:46.989:INFO:oejs.Server:main: Started @331997ms

 * Important Notice: You can get this error when installing ORDS:
ords_grant_privs.sql Error: ORA-01031: insufficient privileges
This  is a result of lack of current USER Privileges  even if it was GRANTED DBA permission.
SO , it's very recommended to  use SYS  with a DIGIT password as Oracle ORDS has a built-in Bug which cannot identify passwords letters case.
You changed SYS password  using :
ALTER USER SYS IDENTIFIED BY oracle;
To read more about this bug go here:  https://community.oracle.com/thread/4120820

AutoBackup Oracle Forms and Reports 6i

When working on Oracle forms 6i , it crashes and exits suddenly without prompting me.

This caused me to lose hours and hours of work.



Here's a method to solve this using Windows Schedule Task to automatically backup the Forms 6i folder.



1# Assuming You are working on Windows Server 2003

2# Locate the folder Of forms and reports on your hard  (eg: D:\FRMWY-POS )

3# Locate the destination where you want to make the Backup Folder (eg: E:\POS_Backup)

4#Open NOTEPAD and write the following code:

XCopy D:\FRMWY-POS /S /E E:\POS_Backup /R /I /Y



5# Save the file as "Backup.bat"

6#Go to Control Panel , Scheduled Tasks , Add Task

7# After browsing to the bat file open advanced properties for the task

8# Make the task repeat every 2 minutes or any time you want

9# You are done...

Auto Compile Multiple Forms and Reports without opening builder

Here's how to Compile Multiple Forms and Reports  without opening forms builder or report builder .

open  Notepad (or any text editor) , paste the following text:

@ECHO OFF 
 cls 
 Echo libraries compilation.... 
 for %%f IN (*.pll) do ( frmcmp userid=user/pw@srv module=%%f batch=yes module_type=library compile_all=yes window_state=minimize & ECHO %%f )
 ECHO libraries compilation finished ---
 Echo menus compilation.... 
 for %%f IN (*.mmb) do ( frmcmp userid=user/pw@srv module=%%f batch=yes module_type=menu compile_all=yes window_state=minimize & ECHO %%f )
 ECHO menus compilation finished ---
 Echo forms compilation.... 
 for %%f IN (*.fmb) do ( frmcmp userid=user/pw@srv module=%%f batch=yes module_type=form compile_all=yes window_state=minimize & ECHO %%f )
 ECHO forms compilation finished ---
Echo compiling reports  .... 
 for %%f IN (*.rdf) do rwconverter userid=sit/sit@SIT batch=yes source=%%f stype=rdffile DTYPE=REPFILE   compile_all=yes OVERWRITE=yes logfile=log.txt
window_state=minimize & ECHO %%f )
ECHO --------------------------------------------------------------------
ECHO Report Compilation complete

Then save it as "Compile.bat"
# replace userid=user/pw@srv  with your own  credentials
# place this bat file in folder which you need to compile forms in it

Whenever you need to compile forms and reports  run this bat file.

Enjoy and learn others...

UPDATE :
 If the previous batch file does not work try to replace  frmcmp  and rwconverter with the original EXE file in your Oracle folder , in my case it's :
d:\Oracle\Middleware\Oracle_Home\bin\frmcmp 
d:\Oracle\Middleware\Oracle_Home\bin\rwconverter

It should work for all Oracle versions up to 12c

Thanks....