Tuesday, 3 August 2021

OUAF C2M 2.8.0.0 installation on Windows64

This blog is for anyone looking to install Oracle C2M 2.8.0.0.

In this blog I have mainly tried to highlight the areas where there are differences between the installation steps for C2M 2.8 and C2M 2.7. For more detailed steps for installation refer my earlier blog for C2M 2.7.0.3 installation.

http://myouafworld.blogspot.com/2020/06/ouaf-c2m-2703-installation-on-windows64.html


Database installation steps:

For C2M 2.8.0.0, use Oracle 19c database. Please check that the database version is different from the one used in C2m 2.7.0.3.

Add Listener:








Create Database:





Login to database as sys as SYSDBA

Run below db statements.

CREATE TABLESPACE CISTS_01 LOGGING DATAFILE 'C:/c2m/database/c2m2800/oradata/C2M2800/cists01.dbf' SIZE 1024M REUSE AUTOEXTEND ON NEXT 8192K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;


CREATE ROLE CIS_USER;

CREATE ROLE CIS_READ;

GRANT CREATE SYNONYM to CIS_USER;

GRANT CREATE SYNONYM to CIS_READ;


CREATE USER CISADM IDENTIFIED BY CISADM DEFAULT TABLESPACE CISTS_01 TEMPORARY TABLESPACE TEMP PROFILE DEFAULT;

GRANT UNLIMITED TABLESPACE TO CISADM WITH ADMIN OPTION;

GRANT SELECT ANY TABLE TO CISADM;

GRANT CREATE DATABASE LINK TO CISADM;

GRANT CONNECT TO CISADM;

GRANT RESOURCE TO CISADM;

GRANT DBA TO CISADM WITH ADMIN OPTION;

GRANT CREATE ANY SYNONYM TO CISADM;

GRANT SELECT ANY DICTIONARY TO CISADM;

CREATE USER CISUSER PROFILE DEFAULT IDENTIFIED BY CISUSER DEFAULT TABLESPACE CISTS_01 TEMPORARY TABLESPACE TEMP;

GRANT SELECT ANY TABLE TO CISUSER;

GRANT CIS_USER TO CISUSER;

GRANT CIS_READ TO CISUSER;

GRANT CONNECT TO CISUSER;

CREATE USER CISOPR PROFILE DEFAULT IDENTIFIED BY OPRPLUS DEFAULT TABLESPACE CISTS_01 TEMPORARY TABLESPACE TEMP;

GRANT CONNECT, RESOURCE, EXP_FULL_DATABASE TO CISOPR;

CREATE USER CISREAD IDENTIFIED BY CISREAD DEFAULT TABLESPACE CISTS_01 TEMPORARY TABLESPACE TEMP;

GRANT SELECT ANY TABLE TO CISREAD;

GRANT CIS_READ TO CISREAD;

GRANT CONNECT TO CISREAD;




Extending String Size:

This is the first change for C2M 2.8, the database needs to be updated for extending the string size for VarChar. Refer below steps for doing the same.



SHOW PARAMETER max_string_size;


NAME            TYPE   VALUE    

--------------- ------ -------- 

max_string_size string STANDARD


Refer below oracle link for more details:

MAX_STRING_SIZE (oracle.com)


Increasing the Maximum Size of VARCHAR2, NVARCHAR2, and RAW Columns in a Non-CDB

To increase the maximum size of VARCHAR2NVARCHAR2, and RAW columns in a non-CDB:

  1. Shut down the database.

  2. Restart the database in UPGRADE mode.

  3. Change the setting of MAX_STRING_SIZE to EXTENDED.

  4. Run the rdbms/admin/utl32k.sql script. You must be connected AS SYSDBA to run the script.

  5. Restart the database in NORMAL mode.

Note:

The utl32k.sql script increases the maximum size of the VARCHAR2NVARCHAR2, and RAW columns for the views where this is required. The script does not increase the maximum size of the VARCHAR2NVARCHAR2, and RAW columns in some views because of the way the SQL for those views is written.

  1. Run the rdbms/admin/utlrp.sql script to recompile invalid objects. You must be connected AS SYSDBA to run the script.

SQLplus commands for updating database to EXTENDED

Connect to sqlplus

Connect using sys as sysdba


Shutdown database

SHUTDOWN NORMAL


Start database in upgrade mode

STARTUP UPGRADE


Update value to EXTENDED

alter system set max_string_size='EXTENDED';


Run script

@C:/myfolder/OracleDownloads/OracleDatabase/Oracle19c/V982656-01/rdbms/admin/utl32k.sql


Restart DB in Normal Mode

SHUTDOWN

STARTUP


Run script

@C:/myfolder/OracleDownloads/OracleDatabase/Oracle19c/V982656-01/rdbms/admin/utlrp.sql



SQLPlus Output Log for reference

SQL*Plus: Release 19.0.0.0.0 - Production on Sat May 29 01:40:37 2021

Version 19.3.0.0.0


Copyright (c) 1982, 2019, Oracle.  All rights reserved.




Enter user-name: sys as sysdba

Enter password:


Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0


SQL> SHUTDOWN NORMAL

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> STARTUP UPGRADE

ORACLE instance started.


Total System Global Area 3841981992 bytes

Fixed Size                  9035304 bytes

Variable Size             738197504 bytes

Database Buffers         3087007744 bytes

Redo Buffers                7741440 bytes

Database mounted.

Database opened.

SQL> alter system set max_string_size='EXTENDED';


System altered.


SQL> @C:/myfolder/OracleDownloads/OracleDatabase/Oracle19c/V982656-01/rdbms/admin/utl32k.sql


Session altered.



Session altered.


DOC>#######################################################################

DOC>#######################################################################

DOC>   The following statement will cause an "ORA-01722: invalid number"

DOC>   error if the database has not been opened for UPGRADE.

DOC>

DOC>   Perform a "SHUTDOWN ABORT"  and

DOC>   restart using UPGRADE.

DOC>#######################################################################

DOC>#######################################################################

DOC>#


no rows selected


DOC>#######################################################################

DOC>#######################################################################

DOC>   The following statement will cause an "ORA-01722: invalid number"

DOC>   error if the database does not have compatible >= 12.0.0

DOC>

DOC>   Set compatible >= 12.0.0 and retry.

DOC>#######################################################################

DOC>#######################################################################

DOC>#


PL/SQL procedure successfully completed.



Session altered.



0 rows updated.



Commit complete.



System altered.



PL/SQL procedure successfully completed.



Commit complete.



System altered.



Session altered.



Session altered.



Table created.



Table created.



Table created.



Table truncated.



0 rows created.



PL/SQL procedure successfully completed.



STARTTIME

--------------------------------------------------------------------------------

05/29/2021 01:53:38.240000000



PL/SQL procedure successfully completed.


No errors.


PL/SQL procedure successfully completed.



Session altered.



Session altered.



0 rows created.



no rows selected



no rows selected


DOC>#######################################################################

DOC>#######################################################################

DOC>   The following statement will cause an "ORA-01722: invalid number"

DOC>   error if we encountered an error while modifying a column to

DOC>   account for data type length change as a result of enabling or

DOC>   disabling 32k types.

DOC>

DOC>   Contact Oracle support for assistance.

DOC>#######################################################################

DOC>#######################################################################

DOC>#


PL/SQL procedure successfully completed.



PL/SQL procedure successfully completed.



Commit complete.



Package altered.



Package altered.



Session altered.


SQL> SHUTDOWN

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> STARTUP

ORACLE instance started.


Total System Global Area 3841981992 bytes

Fixed Size                  9035304 bytes

Variable Size             738197504 bytes

Database Buffers         3087007744 bytes

Redo Buffers                7741440 bytes

Database mounted.

Database opened.


SQL> @C:/myfolder/OracleDownloads/OracleDatabase/Oracle19c/V982656-01/rdbms/admin/utlrp.sql


Session altered.



TIMESTAMP

--------------------------------------------------------------------------------

COMP_TIMESTAMP UTLRP_BGN              2021-05-29 01:59:41


DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid

DOC>   objects in the database. Recompilation time is proportional to the

DOC>   number of invalid objects in the database, so this command may take

DOC>   a long time to execute on a database with a large number of invalid

DOC>   objects.

DOC>

DOC>   Use the following queries to track recompilation progress:

DOC>

DOC>   1. Query returning the number of invalid objects remaining. This

DOC>      number should decrease with time.

DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);

DOC>

DOC>   2. Query returning the number of objects compiled so far. This number

DOC>      should increase with time.

DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;

DOC>

DOC>   This script automatically chooses serial or parallel recompilation

DOC>   based on the number of CPUs available (parameter cpu_count) multiplied

DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).

DOC>   On RAC, this number is added across all RAC nodes.

DOC>

DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel

DOC>   recompilation. Jobs are created without instance affinity so that they

DOC>   can migrate across RAC nodes. Use the following queries to verify

DOC>   whether UTL_RECOMP jobs are being created and run correctly:

DOC>

DOC>   1. Query showing jobs created by UTL_RECOMP

DOC>         SELECT job_name FROM dba_scheduler_jobs

DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';

DOC>

DOC>   2. Query showing UTL_RECOMP jobs that are running

DOC>         SELECT job_name FROM dba_scheduler_running_jobs

DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';

DOC>#


PL/SQL procedure successfully completed.



TIMESTAMP

--------------------------------------------------------------------------------

COMP_TIMESTAMP UTLRP_END              2021-05-29 02:00:02


DOC> The following query reports the number of invalid objects.

DOC>

DOC> If the number is higher than expected, please examine the error

DOC> messages reported with each object (using SHOW ERRORS) to see if they

DOC> point to system misconfiguration or resource constraints that must be

DOC> fixed before attempting to recompile these objects.

DOC>#


OBJECTS WITH ERRORS

-------------------

                  0


DOC> The following query reports the number of exceptions caught during

DOC> recompilation. If this number is non-zero, please query the error

DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors

DOC> are due to misconfiguration or resource constraints that must be

DOC> fixed before objects can compile successfully.

DOC> Note: Typical compilation errors (due to coding errors) are not

DOC>       logged into this table: they go into DBA_ERRORS instead.

DOC>#


ERRORS DURING RECOMPILATION

---------------------------

                          0



Function created.



PL/SQL procedure successfully completed.



Function dropped.



PL/SQL procedure successfully completed.


SQL>




Import Demo Database:


Check datapump dir location:

SELECT directory_name, directory_path FROM dba_directories where directory_name = 'DATA_PUMP_DIR';


DATA_PUMP_DIR C:\c2m\dbadmin\app\admin\c2m2800\dpdump/


Extract dmp file and place it in data pump directory




Before running import statement,

Login to sql developer with sys as sysdba and run below statement.

grant execute on dbms_rls to CISADM with grant option;




impdp directory=data_pump_dir dumpfile=exp_demo.dmp logfile=exp_demo.log schemas=CISADM








If you didn’t run the access statement for dbms_rls earlier before import, you will see that the Procedure W1_APPLY_VPD_POLICY has compilation errors as seen above. To resolve, do below steps,


Login to sql developer with sys as sysdba and run below statement.

grant execute on dbms_rls to CISADM with grant option;

Recompile the Procedure W1_APPLY_VPD_POLICY in error.



Creating Synonyms for CISUSER and CISREAD:

Extract the files in V1006660-01


C:\myfolder\OracleDownloads\C2M_2.8.0.0\V1006660-01\jarfiles



SET CLASSPATH=C:\myfolder\OracleDownloads\C2M_2.8.0.0\V1006660-01\jarfiles\*


"%JAVA_HOME%"\bin\java -Xmx1500M com.oracle.ouaf.oem.install.OraGenSec -d CISADM,CISADM,jdbc:oracle:thin:@localhost:1523/C2M2800 -u CISUSER,CISREAD -r CIS_USER,CIS_READ -a A -p CISUSER,CISREAD -l output.log






Weblogic Installation:


Download steps:

Ensure you download version 12.2.1.4 or above of weblogic


Only below file ‘V983368-01.zip’ is needed for installation.



Installation steps:



Open command prompt, navigate to above location

Run below command


C:\c2m\java\jdk\bin\java –jar fmw_12.2.1.4.0_infrastructure.jar


Below screen opens up, follow the steps shown below.










Weblogic Installation completed.



Application Installation:


Below are the steps for C2M Application installation:

  1. Install Oracle Utilities Application Framework V4.4.0.3.0
  2. Update Keystore
  3. Install Oracle Utilities Application Framework V4.4.0.3.0 Prerequisite Single Fixes
  4. Install Oracle Utilities Customer Care and Billing V2.8.0.0.0
  5. Install Oracle Utilities Customer Care and Billing V2.8.0.0.0 Post-release Patches
  6. Install Oracle Utilities Meter Data Management V2.4.0.0.0
  7. Install Oracle Utilities Operational Device Management V2.3.0.0.0
  8. Install Oracle Utilities Customer To Meter V2.8.0.0.0
  9. Install Oracle Utilities Customer To Meter V2.8.0.0.0 Post-release Patches


Framework installation:


C:\myfolder\OracleDownloads\C2M_2.8.0.0\V1006661-01.zip



Copy the file FW-V4.4.0.3.0-MultiPlatform.jar from the delivered package to the

<TEMPDIR>

cd <TEMPDIR>


jar -xvf FW-V4.4.0.3.0-MultiPlatform.jar

Update the configuration values as shown below. You can modify the port number as needed.



************************************

* Environment Installation Options *

************************************


 1. Environment ID, Roles, Third Party Software Configuration

       Environment ID:                                    10432182

       Server Roles:                                      batch,online

       Oracle Client Home Directory:                      C:\myfolder\OracleDownloads\OracleDatabase\Oracle19c\V982656...

       Web Java Home Directory:                           C:\c2m\java\jdk

       Hibernate JAR Directory:                           C:\c2m\hibernate

       ONS JAR Directory:

       Web Application Server Home Directory:             C:/c2m/weblogic/12.2.1.4.0/Oracle/Middleware/Oracle_Home/wls...

       Additional JAR Directory:


 2. Keystore Options

       Import Keystore Directory:


50. Environment Installation Options

       Environment Mount Point:                           C:/c2m/ouaf

       Log Files Mount Point:                             C:/c2m/ouaf/sploutput

       Environment Name:                                  C2M2800

       Install Application Viewer Module:                 true

       Install Sample CM Source Code:                     true


Please Note*: Below highlighted config value for JNDI password has to be same when you enter the password for system user in native weblogic configuration.

Also set Deploy application viewer to false in case you don't need it. This reduces the ear build time during installation. You can set it to true later if you need it.




*************************************

* Environment Configuration C2M2800 *

*************************************


 1. Environment Description

       Environment Description:                           c2m2800


 2. Business Application Server Configuration

       Business Server Host:                              localhost

       Business Server Application Name:                  SPLService


 3. Web Application Server Configuration

       Web Server Host:                                   localhost

       WebLogic SSL Port Number:                          6701

       WebLogic Console Port Number:                      6700

       Web Context Root:                                  ouaf

       WebLogic JNDI User ID:                             system

       WebLogic JNDI Password:                            ENCKS(****)

       WebLogic Server Name:                              c2m2800server

       Web Server Application Name:                       SPLWeb

       Deploy Application Viewer Module:                  true

       Enable The Unsecured Health Check Service:         false

       MDB RunAs User ID:                                 SYSUSER

       Super User Ids:


 4. Database Configuration

       Application Server Database User ID:               CISADM

       Application Server Database Password:              ENCKS(****)

       XAI Database User ID:                              CISADM

       XAI Database Password:                             ENCKS(****)

       Batch Database User ID:                            CISADM

       Batch Database Password:                           ENCKS(****)

       Web JDBC DataSource Name:

       Database Name:                                     C2M2800

       Database Server:                                   localhost

       Database Port:                                     1523

       ONS Server Configuration:

       Database Override Connection String:

       Character Based Database:                          false

       Oracle Client Character Set NLS_LANG:              AMERICAN_AMERICA.AL32UTF8


 5. General Configuration Options

       Batch RMI Port:                                    6740

       RMI Port number for JMX Business:                  6750

       RMI Port number for JMX Web:                       6770

       JMX Enablement System User ID:                     system

       JMX Enablement System Password:                    ENCKS(****)

       Coherence Cluster Name:                            mycluster

       Coherence Cluster Address:                         localhost

       Coherence Cluster Port:                            6903

       Coherence Cluster Mode:                            dev


 6. OUAF TrustStore Options

       Import TrustStore Directory:


Each item in the above list should be configured for a successful install.


Choose option (1,2,3,4,5,6, <P> Process, <X> Exit):



Updating keystore:


Verify keystore files are present under ks folder





1. Using configureEnv.cmd, re-enter the menu passwords to encrypt the data.

2. Run initialSetup.cmd to update property files with the encrypted data.


Next navigate to %SPLEBASE%/bin folder


Run splenviron.cmd -e C2M2703


Navigate back to bin folder

Run following commands


perl run_java_standalone.plx com.splwg.shared.common.ResetCryptographyKey


invokeDBUpdatePatch.cmd


Verify that both commands ran successfully.

This completes the configuration of OUAF keystore part of the installation



Installing Oracle Utilities Application Framework V4.4.0.3.0 Prerequisite Single Fixes:


C:\myfolder\OracleDownloads\C2M_2.8.0.0\V1008706-01.zip




Copy the file to temporary location

jar -xvf C2M-V28000-FW-PREREQ-MultiPlatform.jar


$SPLEBASE\bin\splenviron.cmd -e %SPLENVIRON%

Navigate to the <temp location>/FW-V4.4.0.3.0-Rollup/Application folder.

installSFgroup.cmd



Installing the Oracle Utilities Customer Care and Billing Application Component:

C:\myfolder\OracleDownloads\C2M_2.8.0.0\V1008715-01.zip




Copy the file CCB-V2.8.0.0.0-MultiPlatform.jar in the delivered package to a <TEMPDIR>.


cd <TEMPDIR>


jar -xvf CCB-V2.8.0.0.0-MultiPlatform.jar



$SPLEBASE\bin\splenviron.cmd -e %SPLENVIRON%


Change to the <TEMPDIR>/CCB.V2.8.0.0.0 directory.


install.cmd


Options will come up. Enter ‘P’ and click on enter. 



Installing Oracle Utilities Customer Care and Billing V2.8.0.0.0 Post-release Patches:


C:\myfolder\OracleDownloads\C2M_2.8.0.0\V1008718-01.zip



Copy the CCB-V28000-Rollup-MultiPlatform.jar file in the delivered package to a <TEMPDIR>.

2. Unjar the file.


jar -xvf CCB-V28080-Rollup-MultiPlatform.jar



$SPLEBASE\bin\splenviron.cmd -e %SPLENVIRON%


Navigate to the <temp location>/CCB-V2.8.0.0.0-Rollup/Application folder.


installSFgroup.cmd



Installing Oracle Utilities Meter Data Management V2.4.0.0.0:


C:\myfolder\OracleDownloads\C2M_2.8.0.0\V1008725-01.zip



Copy the MDM-V2.4.0.0.0-MultiPlatform.jar file in the delivered package to a <TEMPDIR>.

2. Unjar the file.



jar -xvf MDM-V2.4.0.0.0-MultiPlatform.jar


$SPLEBASE\bin\splenviron.cmd -e <ENV NAME>


Navigate to the <temp location>/MDM.V2.4.0.0.0 folder.


install.cmd


Choose option P to proceed with the installation.



Installing Oracle Utilities Operational Device Management V2.3.0.0.0:


C:\myfolder\OracleDownloads\C2M_2.8.0.0\V1008727-01.zip






Copy the WAM-V2.3.0.0.0-Multiplatform.jar file in the delivered package to a

<TEMPDIR> on your host server.

cd <TEMPDIR>

jar -xvf WAM-V2.3.0.0.0-Multiplatform.jar



splenviron.cmd -e <ENV NAME>

4. Change to the <TEMPDIR>/W1.V2.3.0.0.0 directory 


splenviron.cmd -e <ENV NAME>

install.cmd

Choose option P to proceed with the installation.




Installing Oracle Utilities Customer To Meter V2.8.0.0.0:

C:\myfolder\OracleDownloads\C2M_2.8.0.0\V1008730-01.zip


Copy the C2M.V2.8.0.0.0-MultiPlatform.jar file in the delivered package to a

<TEMPDIR> on your application server


cd <TEMPDIR>


jar -xvf C2M-V2.8.0.0.0-MultiPlatform.jar

splenviron.cmd -e <ENV NAME>

Change to the <TEMPDIR>/C2M.V2.8.0.0.0 directory.

install.cmd


Installing Oracle Utilities Customer To Meter V2.8.0.0.0 Post-release Patches:

C:\myfolder\OracleDownloads\C2M_2.8.0.0\V1008732-01.zip


Copy the C2M-V28000-Rollup-MultiPlatform.jar file in the delivered package to a

<TEMPDIR>.

Navigate to C:\temp2\C2M-V2.8.0.0.0-Rollup\Application

2. Unjar the file.

jar -xvf C2M-V28080-Rollup-MultiPlatform.jar


$SPLEBASE\bin\splenviron.cmd -e %SPLENVIRON%


Navigate to the <temp location>/C2M-V2.8.0.0.0-Rollup/Application folder.


installSFgroup.cmd

This completes the installation of C2M application.



Native installation of C2M 2.8.0.0 on Weblogic:

(Kindly also refer my latest blog for using WLST to do native installation on weblogic. It helps to reduce the time taken as well as reduces any errors. Link to blog: Native installation using WLST)

Refer below steps for deploying the C2M application on Weblogic in native mode

Ensure Oracle Restricted JRF is selected. This is need for help link to work on application.












For deploying the application on weblogic, refer the steps in my earlier blog for deploying SPLService, SPLWeb and ohelp ear files. Below is blog link for reference.

http://myouafworld.blogspot.com/2020/06/ouaf-c2m-2703-installation-on-windows64_5.html

One difference for the class path on 'Server Start' tab of c2m2800 server in weblogic admin fron end:

C:\c2m\ouaf\C2M2800\splapp\standalone\lib\antlr-2.7.7.jar;C:\c2m\weblogic\12.2.1.4.0\Oracle\Middleware\Oracle_Home\wlserver\server\lib\weblogic_sp.jar;C:\c2m\weblogic\12.2.1.4.0\Oracle\Middleware\Oracle_Home\wlserver\server\lib\weblogic.jar


Before deployment of ear files, ensure you do the below changes, the size of deployment files has increased in V2.8.0.0. Some configuration changes are needed before proceeding with deployment of SPLService and SPLWeb.



Navigate to 'C:\c2m\weblogic\12.2.1.4.0\Oracle\Middleware\Oracle_Home\user_projects\domains\c2m2800_domain\bin'

Open below file

startWebLogic.cmd

Add below line in file. Refer screenshot below for location to update.

set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.deploy.MaxPostSize="2000000000"


(Max value allowed in this option is 21474836480 or 2GB)


If you don’t do above step, you might see below error when deploying SPLWeb ear file


<BEA-290076> <Total size of transferred files is "1.146" GB and it exceeded configured limit "1.074" GB.>

java.io.IOException: Posted content exceeds max post size





Also increase the heap size to 3 GB in same file.

set USER_MEM_ARGS=-Xms3072m -Xmx3072m -XX:PermSize=512m


After initial installation, you can move the heap size setting to setUserOverrides.cmd file. This is so that the heap size is applied only on the C2M server and not the weblogic admin server.

Below is step for it.

Add this file ‘setUserOverrides.cmd’ in “C:\c2m\weblogic\12.2.1.4.0\Oracle\Middleware\Oracle_Home\user_projects\domains\c2m2800_domain\bin” location.

The sample file for ‘setUserOverrides.cmd’ is available in following location “C:\c2m\ouaf\C2M2800\tools\examples\bin”

setUserOverrides.cmd content for reference

@echo off

REM

REM This is a WebLogic domain customized domain overide utility to ensure the appropriate environmental values are set for the domain startup

REM

REM


echo %SPLEBASE%


if "%SERVER_NAME%"=="c2m2800server" (

set SPLEBASE=C:\c2m\ouaf\C2M2800

set USER_MEM_ARGS=-Xms3072m -Xmx3072m -XX:PermSize=512m

set JAVA_OPTIONS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7758 %JAVA_OPTIONS%

)



if "%SPLEBASE%" == "" (

   echo SPLEBASE needs to be set in environment

   exit /b 0

)


if "%TRUST_TYPE%" == "DEMO" (

   set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.security.TrustKeyStore=DemoTrust

)


if "%USER_MEM_ARGS%" == "" (

   set USER_MEM_ARGS=-Xms1024m -Xmx2048m

)


set JAVA_OPTIONS=-XX:CompileThreshold=8000 -Djava.security.auth.login.config=%SPLEBASE%\splapp\config\java.login.config -Dfile.encoding=UTF8 -Djavax.xml.soap.MessageFactory=com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl -Djavax.xml.soap.SOAPConnectionFactory=weblogic.wsee.saaj.SOAPConnectionFactoryImpl -Dcom.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace=false -Dcom.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0 -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -Dweblogic.security.SSL.ignoreHostnameVerification=true -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=C:\temp -Djava.net.preferIPv4Stack=true %JAVA_OPTIONS%


REM set OUAF_DEBUG_PORT (E.g. set OUAF_DEBUG_PORT=6599) prior to starting to enable server debugging 

if DEFINED OUAF_DEBUG_PORT (

   set JAVA_OPTIONS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=%OUAF_DEBUG_PORT% %JAVA_OPTIONS%

)


echo SPLEBASE %SPLEBASE%

echo SERVER_NAME %SERVER_NAME%


This completes the steps to deploy the C2M application. You can start the C2M server and verify that it is running. Refer my earlier blog for the steps.


IWS Deployment

Added the steps for IWS deployment in weblogic native mode

Admin server and C2M server should be up and running.

In below command, 7010 port number is weblogic admin port number. Update the port number in the command with the port number configured in your system.

Connect to oracle database

Login as SYS user.
2. On the SQL prompt, run:
@?/rdbms/admin/userlock.sql
3. Grant permission.
grant execute on USER_LOCK to public;


Go to command prompt

Go to $WeblogicHome\oracle_common\common\bin

Run below commands

wlst.cmd
connect("weblogicuser","password","t3://localhost:weblogicAdminconsoleport")
storeUserConfig('$SPLBASE/etc/.wlsuserconfig',' $SPLBASE/etc/.wlsuserkey')


connect("weblogic","password","t3://localhost:7010")

storeUserConfig('C:/c2m/ouaf/C2M2800/etc/.wlsuserconfig','C:/c2m/ouaf/C2M2800/etc/.wlsuserkey')

Navigate to etc folder as shown below, you can see that the .wlsuserconfg and .wlsuserkey files have got created.



Navigate to “C:\c2m\ouaf\C2M2800\splapp\iws” and update below file

iws-build-WLS.xml

  <property name="web.admin.url"         value="t3://localhost:7010" />


Navigate to below file and do the highlighted updates for Heap size

iws-build-common.xml


  <target name="generate" depends="clean">

    <echo message="Running IWS generator. Please wait..." />

    <property name="logprop" value="${gen.home.dir}/config/log4j2.properties" />

    <echo file="${logprop}" append="false" message="status=error${nl}" />

    <echo file="${logprop}" append="true" message="name=PropertiesConfig${nl}" />

    <echo file="${logprop}" append="true" message="appender.A1.type=Console${nl}" />

    <echo file="${logprop}" append="true" message="appender.A1.name=A1${nl}" />

<echo file="${logprop}" append="true" message="appender.A1.layout.type=PatternLayout${nl}" />

<echo file="${logprop}" append="true" message="appender.A1.layout.pattern=%X{userId} - %X{transactionId} %d [%t] %-5p (%c{3}) %m%n${nl}" />

    <java classname="com.oracle.ouaf.ws.tools.artifactgen.InboundWebserviceGenerator" fork="true" failonerror="true">

      <jvmarg value="-Xmx2048m" />

      <jvmarg value="-Xms2048m" />


splenviron.cmd -e <ENV NAME>

Execute the following command in %SPLEBASE%\bin. Make sure the application

server is up and running.


iwsdeploy.cmd

Command should run successfully without any errors.

Next login to weblogic admin and go to deployments, you should see Webservice.ear fiel deployed and Active.


Testing Webservice with SOAPUI.

Refer below steps for testing webservice is working after deployment

Open below OOB webservice and open its wsdl

Click on the WSDL link and open below WSDL. Copy the WSDL url

https://localhost:6701/ouaf/webservices/D1-DeviceEventSeeder?WSDL


Open SOAP UI, open new SOAP project. Copy the WSDL url here.

Navigate to Request 1

Update the Request1 with below request xml

Sample xml below for reference

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:d1="http://ouaf.oracle.com/webservices/d1/D1-DeviceEventSeeder">

   <soapenv:Header/>

   <soapenv:Body>

      <d1:D1-DeviceEventSeeder>

         <d1:externalSenderId>SENSUS</d1:externalSenderId>

         <d1:deviceEventType>DEVICELOWBATTERY</d1:deviceEventType>

         <d1:eventDateTime>2020-05-29T10:20:15</d1:eventDateTime>

         <d1:deviceId>272059640649</d1:deviceId>

      </d1:D1-DeviceEventSeeder>

   </soapenv:Body>

</soapenv:Envelope>


Update the username and password in the request properties. Set WSS-Password Type to ‘PasswordText’ and set WSS TimeToLive to ‘72’


Now run the request, if the webservice deployment is proper, you should see a successful response as seen below.


Monday, 14 June 2021

REST based webservices in OUAF framework

Rest based web services is a relatively new feature added in the OUAF framework. It is a new addition and still a lot of changes are coming up continuously in newer versions of the framework. It will take some time for the changes to stabilize.

Depending on which version of the OUAF framework, there may be variations in how you access REST web service.

This blog is targeted at providing some insight into how to access REST based web services in the OUAF framework.


Accessing REST Web services

Framework version 4.4.0.2 - FW V4.4.0.2.0 (C2M V2.7.0.3.0)

This is the old way of accessing REST web services. This has changed in recent version. Documenting this in case anyone is trying to access REST web services in old versions of the product.

There are three steps you need to follow to access a REST web service in this version.

  1. Authentication:

This is done by invoking j_security_check and passing the username and password of C2M login user in j_username and j_password parameters respectively.

  1. Get Rest Token:

This is done by invoking ‘/restSecurityToken’ url. You will get the Rest security token in the response header with the key ‘OUAF-Security-Token’.

  1. Invoke Rest WebService (Set Token in Header in this request):

Set the token received in the earlier request in the header for the session. Call the actual REST api that you want to invoke.

Am using python to demonstrate accessing of REST web service. Alternatively you can use POSTMAN or SOAPUI also.

Using requests module in python for accessing web service.

import requests


headers = {'Accept':'application/json'}

session = requests.Session()

session.headers.update(headers)


#authenticate session

authResponse = session.post('http://localhost:6600/ouaf/j_security_check?j_username=username&j_password=password')


#Fetch Token

tokenResponse = session.post('http://localhost:6600/ouaf/restSecurityToken')


# Set Token in header

tokenHeader = {'OUAF-Security-Token': tokenResponse.headers['OUAF-Security-Token']}

session.headers.update(tokenHeader)


session.headers.update({'Content-Type': 'application/json'})


# Call Rest API

tranResponse = session.get('http://localhost:6600/ouaf/rest/apis/cm/customers/demo/satypes')


json_formatted_str = json.dumps(tranResponse.json(), indent=4)


print(json_formatted_str)


Run the python file using command “python retrieveSAtypesold.py”


As seen below the output of the rest call is displayed



Framework version 4.4.0.3 - FW V4.4.0.3.0 (C2M V2.8.0.0.0)

In this framework version, the Rest module has been moved to a separate web container (rest.war) having target URL as ‘ouaf/rest’. Hence it can have its own authentication separate from the main web container having target URL ‘/ouaf’.

Hence the steps for accessing REST web service is different.

You no longer need to authenticate by calling ‘j_security_check’ now. (If you hit ‘j_security_check’ you will get authentication error and will be logged out, as cis.jsp has been modified to not allow direct access to j_security_check.)

You can specify the authentication to use for the REST web container. This would be different from the authentication specified for the root web container.

By default the framework provides you Oracle Web Services Manager (OWSM) option. You can enable that by setting below parameter to true in ENVIRON.INI file

OWSM_PROTECTION_FOR_REST_SERVICES=true

Will provide more details for accessing REST web service using OWSM later. OWSM provides support for token based security also.

Currently I am setting the authentication to ‘BASIC’, for the rest web container, for demo purposes.

You can do this by modifying “web.xml.rest.template” file in the folder ‘$SPLEBASE/templates’ folder.

Add the following snippet to the file

<login-config>

        <auth-method>BASIC</auth-method>

</login-config>



You can use any valid authentication allowed by weblogic for the web container.

Accessing REST Web service:

Am using python to demonstrate accessing of REST web service. Alternatively you can use POSTMAN or SOAPUI also.

Have created a new REST inbound web service in C2M. Am accessing an out of box business service ‘C1-ALL-SATYP’ in the operation. Have set the URI component of IWS to ‘/demo’. Have set the URI component of IWS to ‘satypes’.

Have set resource category to ‘Customer Information’

As seen below the IWS is created.

Click on ‘View Specification’ to view details of REST webservice in open API format

Expand the service and execute it. You will see the result below.

You can access the REST URL in the ‘Request URL’ window below for quick access.

The URL of the REST webservices is composed of the following parts:

http://server:port/ouaf/rest/apis/{Owner URI component}/{resource Category URI component}/{IWS URI component}/{Operation URI component}

Sample URL: http://localhost:6700/ouaf/rest/apis/cm/customers/demo/satypes

Extendable lookup for Resource category Extendable lookup (F1-RESTResourceCategory)


As seen below the URI component for resource category ‘Customer information’ is ‘/customers’


Extendable lookup - Owner Configuration for REST Services (F1-RESTOwnerURLComponent)

Similarly for owner uri component the value is ‘/cm’

Using requests module in python for accessing web service.

First set following headers – ‘Accept’ and ‘Content-Type’ to ‘application/json’

Also as authentication is set to BASIC, use HTTPBasicAuth for providing authentication as shown below. Set the username and password for C2M application in that.

import requests

from requests.auth import HTTPBasicAuth

import json


headers = {'Accept':'application/json', 'Content-Type': 'application/json'}


response = requests.get('http://localhost:6700/ouaf/rest/apis/cm/customers/demo/satypes', auth=HTTPBasicAuth('username', 'password'), headers=headers)


json_formatted_str = json.dumps(response.json(), indent=4)


print(json_formatted_str)


Run the python file using command “python retrieveSAtypes.py”

As seen below the output of the web service is displayed on the command prompt.


Saturday, 26 September 2020

Oracle C2M - A product review (Developer's View)

This blog is aimed at sharing my views on the C2M product of Oracle. This is not highlight any shortcomings of the product or to discredit the product in anyways. It is just an opinion on what is good and what could be better in the product. 

I recently had the experience of completing an end to end C2M implementation project. Got good experience and working knowledge of C2M product. On completion of the project, did an evaluation of the product from an implementor/developer point of view and have shared my views of the same. 

 For people who do not have an idea of working with C2M, this new product of Oracle is a combination of different existing products of Oracle Utilities. These existing products include CC&B (Customer care and Billing), MDM (Meter Data Management), SOA (Service Order Management), ODM (Operational Device Management) and SGG (Smart Grid Gateway). A new layer of C2M has been built over these products to help these different underlying products interact seamlessly with each other. 

Technically speaking this integration of different products has been done by adding new algorithms on Audit plugin spots, synchronization objects and building common UI for common entities across products. Just to give an example, service point is common in CC&B, MDM and ODM. In C2M, on the backend, the database tables for service point is different corresponding to each product (CCB – CI_SP, MDM – D1_SP, ODM – W1_NODE). All tables are populated with the same data of a service point even if it increases redundant data. Algorithms are attached on Maintenance object audit spot to update the corresponding data in other product’s table whenever the data in one table is updated. Synchronization objects are also created to aid in this data synchronization across tables. Only one common UI map is made accessible to the user for service point. Any updates made on the UI map are synced to all the tables in the backend.

Things I was happy with in the new C2M product:
  • I have worked on both CC&B and MDM before. So my learning curve was less for C2M. I can easily pop into working directly on C2M knowing the underlying working of each product. So I would say someone who has worked before in CC&B or MDM would not face much difficulty in learning corresponding module in C2M as the underlying functionality is same. 
  • Reduction in synchronization integration and usage (bill determinant) integration points. These points generally involve a middleware to convert the requests, configuration of JMS queues and lot of testing to ensure the entire integration is working properly. Lot of integration  and testing effort was reduced in this area as CC&B and MDM are present in the same product. 
  • New products/modules like SOA (Field work management) and ODM (Operational device or Asset management) were easy to pick up and work on as they were based on OUAF Business lifecycle objects and not Cobol to Java converted Service programs like in CC&B. The learning curve is less if you have worked on pure OUAF java products like MDM, MWM etc. People coming from a pure CC&B side might face some difficulty here if they did not have much exposure on the OUAF java framework. 

Things I wish were better in the product: 
  • Too much redundant data present on the system. Merging of all these products by just adding a new layer on the top of multiple products has the big disadvantage of adding on redundant data in the system. Might be better if Oracle integrates these products at a database level instead of just adding an application layer at the top. This would improve performance of the system and also enable the system to scale up for an implementation having a large customer base.
  • Lot off unnecessary synchronization calls happening in the system just to sync of the data between different products. This increase the load on the system and creates lot of unnecessary algorithm calls in the system. 
  • Synchronization errors cause data to be just updated in one module and not in the other. E.g. Field activity got created in CC&B but did not get created in SOA due to some synchronization error. But took some time to identify that corresponding counterpart object in other module was not getting updated. This is not a one off error. Have seen this kind of synchronization errors coming up on multiple modules. These kind of errors are not easily identifiable as on the front end we see updated data. This is another disadvantage of having multiple synchronization happening in the system, just for updating an entity. One way to identify issues would be to monitor all synchronization objects getting created in the system and monitor any sync objects going to error status. Since there are lot of synchronization objects getting created, this would also be a cumbersome task. 
  • There are some unexpected errors coming up during working of the product primarily because these are different products stitched up to work together rather than one coherent product built from scratch. 
  • One thing I would like to see is replacement of entire Cobol to Java converted code in CC&B module to pure Java code. Even though oracle has removed the entire Cobol runtime from the framework, lot of out of box code are Cobol2Java converted codes. These codes are more like machine converted code and is not readable for a developer after decompiling. On the other hand, if it was just new Java code (not converted from Cobol) created from scratch it would be easier for a developer to understand how the out of box code works. This would need Oracle to completely rebuild the CC&B part of the product from scratch in Java and has a good chance of introducing new defects in the product. But I feel it would be advantageous in the long run. 
  • Redesign the entire CC&B part of the product and convert all plugins to business object lifecycle plugins like other newer modules. Currently there are lot of plugin spots which are just present at adhoc locations on the product. Only someone with a lot of experience in CC&B would have knowledge of all plugin spots. For a new person, this increases the learning curve as you need to go through Oracle documentation to understand functionality of each plugin spot. Also CC&B has lot of objects which cannot be converted into business objects as they support only legacy services for update. This causes lot of difficulty in extending the product. Due to no business object layer, customizations generally go down to Java changehandler for out of box entities. Also changes to front end is very difficult as they don't utilize UI maps. This puts restrictions on the developer for customizing the product. 

I understand that Oracle would have some limitations and reasons for the ways the product has been designed currently. These might be business reasons and also practical reasons for avoiding drastic changes in product from existing products that might prevent someone invested in CC&B for a long time in going for a new product. 

Possibly Oracle can think of redesigning the whole C2M product as a new product built purely in OUAF framework instead of it being an extension of existing products. This might impact existing CC&B developers who have vast experience in the CC&B product. But in the longer run, it would be better for everyone. The learning curve would be faster even if it is for a new product as it would be based on pure OUAF framework guidelines. This would also help it in adding new features to the product that might be limited by current legacy code.

OUAF Oracle Utilities WAM / ODM 2.4.0.0 installation on Windows

  This blog is for anyone looking to install Oracle Utilities WAM or ODM 2.4.0.0 (Oracle Utilities Workflow and Asset Management) or (Orac...