Monday, December 23, 2024

Oracle Analytics Default date format in parameter

 A quick reminder to my self:

When creating a parameter and want to use it in filter / calculation, there must be a default. For date default this is the default format: 

DATE '2014-04-12'

For example: 

Val_Date = @parameter("P_DATE")(DATE '2014-04-12')


Wednesday, November 27, 2024

Last occurrence of sub-string in a string - The locate function secret part in Oracle Analytics

 I need to find the last occurrence of a specific character in a string (and using only the part that follows that character). For example in a string 'abc-de-fghi-jklm' I want to locate the last '-' and get the sub-string of 'jklm'. In my cases there is unknown number of '-' characters.

The basic function to locate a sub-string in a string is "Locate". 

While it seems Locate has only 2 parameters (the string we are searching and the full string), actually they are 3 parameters. The third one is optional: start position.

LOCATE(CharacterExpression, CharacterExpression [, StartPosition] ) 

The Start Position can accept negative values as well, meaning search from the end of the string.

So in my case Locate('-', 'abc-de-fghi-jklm', -1) is the solution.

To get the sub-string 'jklm' I will use 

SUBSTRING( 'abc-de-fghi-jklm'

                   FROM  Locate('-', 'abc-de-fghi-jklm', -1)+1)

The SUBSTRING function parameters are:

SUBSTRING(CharacterExpression FROM StartPosition [FOR length]) 










Friday, October 25, 2024

Installing OAS on mobile laptop

Once in a while I install OAS (Oracle Analytics Server) on my laptop. I do it for testing purposes mostly... I don't want anyone but myself to connect to this OAS. Sort of rich man's OA Desktop.

 First of all, don't do it. Even if you want OAS on a laptop, you would better use a VM or Docker. This type of installation is not supported and usually is problematic.

This post is for myself, so I will stop reinventing the wheel each time I do it...

Problem: 

  • OAS is a server that requires a static IP. 
  • My laptop changes the IPs each time I move from one network to another. 
  • During the installation the IP is hard coded in some of the config files.

Work around: 

  • Create a MS loopback adapter with a static IP. Example from Oracle DB 21c documentation is here.
  • Set that IP as Ethernet network on the laptop.
  • Before OAS installation turn of Wi-Fi or any other network, so the installation is forced to use the loopback IP.

Once done remember to stop and start OAS on the same network.

Thursday, October 24, 2024

Oracle OAS 2024 (7.6) October 2024 patch and the missing OPATCH

 Oracle has released the Oracle Analytics Server - OAS 2024 (7.6) October 2024 bundle patch, specifically 09-Oct-2024 patch. You can find it at the regular place: Doc ID 2832967.2 in the OAS tab.



The patch requires upgrade of OPatch,  at least to version 13.9.4.2.13. For some reason I couldn't find the relevant OPatch version at the regular place (https://updates.oracle.com/download/6880880.html) where the FMW patch is described as Obsolete, (correct for 24 Oct. 2024).

You can visit this support note (Patch 28186730: OPATCH 13.9.4.2.17 FOR EM 13.5 AND FMW/WLS 12.2.1.4.0 AND 14.1.1.0.0) to download OPatch 13.9.4.2.17 that should do the trick.