Oracle Indexes | the way of my understanding

To be quite frank, when it comes to Oracle Indexes and Joins I am as good as with Oracle Analytical functions. Much fly above my head & every time I have to go back to my notes to “learn” for the tasks in hand!

Recently, I took some interests in understanding the “index usage” once after reading about V$OBJECT_USAGE & realized to my shock that more than 50% of my indexes were never used! I wanted to know why & I kept reading for days without finding much that felt like a true answer.

Hence I made a decision to understand how the indexes work by example. Our Oracle EBS environment has more than half dozen custom applications integrated and few of them are with millions of rows, sufficing “large” table requirements to test the effectiveness of indexing. From the layman perspectives, please note, I am not an Indexing expert, I can’t explain why your Indexes are not being used “even after following everything step by step”. For me, what I did work, giving me an understanding about how should I plan my next Indexes. So let us see how I came to my understandings

We’ve bio-metric devices that are used for attendances purposes. These devices offload the data to a Microsoft SQL database instance and using transactional SQL, we register them with our Oracle database. The technical part of it. The table that stores the fingerprints has 2.3 Million rows as on date and I used the same table to understand how the indexing works.

There was one Index on this table (Yes, I created it), that I dropped before experimenting as the Index was never used! The logic behind the query is:

I should get the first punch in time for the employee, identified by type “0” and last punch out for the employee, identified by type “1”, the machine name on which the employee has registered in and out punches. Each employee might use the bio-metric devices at different locations for door accesses or other purposes like a proof of visiting another office. Without the Index on this table, let us see how Oracle plans the execution.

This table has just few columns and sought data is usually the punch time against the employee.

Regardless, the cost for the execution didn’t look appealing. So, I created an Index that has all the four columns referred in the main and inline queries.

This time the cost looked far better, however, I could see that the base table still being used when there were no additional columns from the base table referred.

Here comes the thumb rule for indexes (I think). Indexes are not used unless a condition is used against one of the indexed columns! Let us see, whether this makes any sense.

I created a view against the above query to be more certain.

After creating the view, I did a simple select * against the view and the execution plan brought me the same results discussed above. Wherever the predicates were used, query used the existing Index and for the rest, did the base table scan.

So I went ahead against my “understanding” and added a condition to Select * from query and did another Explain plan.

This time, the cardinality, ie the total number of rows fetched came down to just a four digit number, base table was not referred and the cost was dirt cheap compared to the earlier situations.

Let’s summarize everything now.

  1. Indexes are mostly effective about large tables
  2. Oracle will use indexes only when one of the columns used in the index is used against a predicate. Said, I created a view against our dear Scott.Emp table and “Select * from emp;” used that index. I don’t know why and I don’t care!
  3. Add up IS NOT NULL against all your index columns in your query to make sure that your Index is used instead of base table.

Now, I needed to understand further. Hence, I went back to the HR sample schema and chose the table “Employees” this time for my continued experiments. As I said Scott.Emp, the results were the same.

HR.EMPLOYEES tables have many Indexes defined.

For the first query as seen with the image below, I didn’t include a predicate. Regardless, Oracle used the Index for the column

Then I tried another query with multiple columns and without predicate. Oracle used the Index this time as well.

Apparently, this gives me an idea like, for larger tables the Indexes are opted when predicates are available against indexed columns and for tables like HR.EMPLOYEES which has only 107 rows, if there is an index exist against the queried column exist, it is used by Oracle.

Cheers friends, it was fun learning something, once again my own way. Hope this helps few others out there who were breaking their heads to understand this horrible thing. Merry Christmas and a very Happy New Year to everyone out there.

Oracle Inventory | Cost manager not picking up transactions for a new organization

Quite recently we defined one new inventory organization while extending our retailing. After the setup, noticed that none of the transactions were getting costed and there were no error or messages in the lines.

After some dwelling we realized that initial settings for the organization sets the cost cutoff date for the organization to a date that looks somewhere closer to the application installation date. All we needed was to empty the column and relaunch the cost manager.

Navigation. INV Super User -> Setup -> Organization -> Parameters -> Costing tab & reset the cost cutoff date.

Hope this helps few out there! Merry Christmas & Happy New Year 2024 to everyone!

How to copy code/scripts from blogspot?

There are many free blogspot sites that don’t allow copying sample codes from their pages. I believe, most of the bloggers are selfless, sharing their knowledge and sample scripts expecting the visitors benefit the maximum from such efforts many of them are not aware of this situation as they don’t try to copy code/scripts from their own posts. As I didn’t use blogspot much, I am not sure whether copying from their posts are disabled by default.

Well, there is always a way and all you need is a browser like Mozilla Firefox (The easiest to my knowledge)

Step# 1 Open Firefox and enter “about:config” in the address bar (Image was modified for better view)

Accept the risk and continue! Search for “javascript” in the search area and double click “javascript.enabled” to toggle true to “false

Open a new tab in the same session with the page from which you want to copy the code/scripts. Get your stuff, go back to the about:config & toggle “javascript.enabled” back to “true“. Forgetting might cost you dearly ;)

Windows 11 23H2 | Download error – 0x80246019

I’ve received it 3 days back at home & at work WSUS server is yet to recognize this update! So, I removed my box from WSUS & tried to get the same using Windows Update. Once after restarting my domain joined computer, I was presented the 23H2 update, however, will not download and always ended up throwing the error “0x80246019”

A quick search landed me on multiple threads and the one worked for me was, disabling the “Get the latest updates as soon as they’re available”. Once after turning it off, downloaded completed successfully and within 3-4 minutes my box was upgraded to 23H2.

(Based on organization policy, you may find this switch not enabled for domain joined computers)

Installing Gaming Services failed with error: 0x80310000

(The above image was doctored to show the error)

If you ever receive this error on #Windows 11, it means the XBox gaming services are toasted and you need to reinstall them. Usually after a fresh installation of Windows10/11, I always removed the bundled apps using PowerShell & later installed only the software that I need. I did install XBox and associated last time, as I constantly use XBox gaming bar screen recording. Looks like the Gaming Services were not fixed by re-installing XBox and components.

I landed on a working solution that is Microsoft answers thread. The working solution is copied below.

  1. Open Terminal as Administrator & enter the below commands one after another
  2. get-appxpackage Microsoft.GamingServices | remove-AppxPackage -allusers
  3. start ms-windows-store://pdp/?productid=9MWPM2CQNLHN

The second command “start…” will open a fresh instance of Microsoft Store app and you can install the gaming services. Restart the box and you are all set to go.

Hope this helps few out there.

Oracle EBS R12 Vision Instance

Did you ever wish for having your own copy of Oracle EBS R12? Well, Oracle provides a copy that is all yours called VISION instance. The below post is one of the best I came across, explaining how to setup your own VISION instance on Oracle VirtualBox

I hope, it was an easy ride. Oracle’s virtual appliance is perfectly sized for moderate hardware, without GUI out of the box. We’ll see how to install GUI, configure the appliance for network access etcetera in this post.

Basically you get Oracle Linux 7.9 OS, EBS R12 12.2.10 with Oracle database 19.9 in this appliance. You must update the OS to latest before installing GUI. So, let us setup the environment for the update now.

Stop the running application and database instances.

su - oracle
cd /u01/install/APPS/scripts
./stopapps.sh
./stopdb.sh

Oracle has the appliance set to start the database and application instances automatically during every reboot. I strongly suggest you to disable the automatic start of these instances. Oracle starts “ebscdb” and “apps” services every time when the box restarts. We can disable these services using chkconfig command

chkconfig apps off
chkconfig ebscdb off

That’s it. Now, when you restart the box, Oracle services will not start automatically.

Shutdown the server. Change the network configuration for the sever like seen in the below image.

This means, your server will start sharing the host’s active connection(s). If your host machine has an active internet connection, your EBS server will able to access internet this way from it’s environment.

Start the EBS server and complete the OS update. This should be around 2.2GB total downloads and minimum 30-40 minutes, depending upon the hardware resources you have allocated for the virtual machine.

Once the box is update, proceed with “Server with GUI” group installation.

yum groupinstall "Server with GUI"

Restart the server after GUI installed. You can temporarily switch to graphical run level by issuing the command

systemctl isolate graphical.target

and to make the graphical interface as default, issue the below command as root

systemctl set-default graphical.target

Please note, your box doesn’t have VirtualBox extensions yet, which is a MUST for proper mouse integration and more. Prior installing the VirtualBox extensions, make sure to install kernel devel package. Issue the following command

yum install kernel-uek-devel

Additionally install the packages gcc, make & perl (pre-installed usually)

yum install gcc make perl -y

Reboot the server & install the VirtualBox extensions.

If you remember, we changed the network settings earlier for the update & if you try to start the database and application, this may not work. Depending upon how you want to access the VISION instance, you have to configure additional networking now. I suggest to leave the NAT configuration as it is and to configure an additional Network adapter for the intended connectivity.

For example, if you want to share the VISION instance with your teammates within a Class C network, do the following.

Use “Bridged Adapter” & select the adaptor that is connected to the network under “Name”. Recent computers have multiple network and WiFi adapters & selecting the correct adapter is very important for client connectivity. Make sure to setup “Promiscous Mode” to “Allow All”.

Find one free IP address and set up the same for your EBS VISION box. You will have to setup this information at multiple places.

For example, change the hosts file (most important)

Network settings. My box have NAT as first Network Adapter and Host Only network as 2nd Network Adapter. Hence my configurations are like below

For the NAT (Connection #1) I have the following setup

and for the Host Only network (Connection #2)

By having the NAT as first adapter, my box is able to connect to internet, shared from the host and my host can access the EBS instance from the virtual machine using the host only network.

That’s all folks.

Install Oracle Forms & Reports 12.2.1.19 on Windows

No post should look good, started with a statement asking the visitor to move on because “There is nothing much to see here”. Trust me, if you already referred my previous post(s) for Oracle Forms & Reports 12.2.1.4, then there is nothing new I have for you in this post. As I don’t have much to offer other than what I have already did through my previous post, let us see how we can insure your fresh attempt to get this whole complex stack installed & configured successfully on your computer.

Are you excited? Don’t be. Oracle has released the much waited Windows version for their Oracle Forms & Reports couple of days back and I must say, I was super excited based on the promises given about the IDE improvements. For improvements what I could see what line numbers inside PL/SQL editor.

Software Requirements

Side note before anything else. Please note, you must install software from the same architecture. Said, if you install JDK 32-Bit and expect your 64-Bit Weblogic to work properly, that is not going to happen. Hence insure all the software you download and install belong to the same architecture.

Microsoft Visual C++ Redistributable packages (Specific to Weblogic 12.2)

and for Oracle Forms 12.2.1.19, you have to install Visual Studio 2017 VC++ compoments.

Oracle JDK

Weblogic Server Software

Oracle Forms & Reports 12.2.1.19

Before you start the installation, let’s do a checklist

  • Is your Windows machine updated with latest patches for OS and .Net?
  • Do you have a static IP address for your computer/laptop?
  • What is the name of your computer? does it looks like some random letters?
  • Have your read the installation document? :) nobody does it right?

Legal, cracked, pirated… OS comes in different flavors & nothing can stop it. However, keeping your box up to date is your responsibility. Oracle is a very complex technology, that depends upon many OS elements. A broken box will not get you anywhere.

Static IP address is 2nd most important element when you are installing a server software, that is WebLogic in our case. As this server has to be identified and reached by clients, a fixed IP address is a must, however not always possible when a user has limited infrastructure. Microsoft has provided “Microsoft Loopback” interface for such requirements. Please Google and find more about setting it up, if you are one of those users. Microsoft Loopback helps you to setup a static IP address, please note other computers in your network cannot reach your computer using this IP address or setup!

Name of your computer or HOST name. Much of the Computer/Laptop that you buy with Windows preinstalled come with some whacky names. You should change such names to something more meaningful like “JOHN-PC”,”XYZ” etecetra.

I didn’t either read installation manuals until recent times. I realized that, I could avoid hours or sometimes days long Googling merely by reading the instruction manuals.

Once you are done with Microsoft Visual Studio C++ redistributable package(s) installations, we can proceed. Please follow the below post that should take you through installation and setting up a classic weblogic domain, report server instance etc. I hope you will have least issues installating and configuring Oracle Forms & Reports following my post 🙏(Don’t get discouraged by the title of the referred post, as I stated in the beginning, there is nothing new HERE!). The one thing I want to warn you about the time that your computer might take to bring up the UI for the Oracle Forms & Reports installer. This could be nothing less that 7-8 minutes, much more depending upon your hardware resources.

All the best and if you are still stuck, do let me through comments!

Deprecated: The PSR-0 Requests_… class names in the Request library are deprecated

Came across this error after WordPress update? Well, the first time I dealt with one of same nature was when we upgraded our business WordPress to latest version. I have posted about it here & strangely, that is the single post of mine ever got more than couple of likes :)

We are using Elementor and, the stack was the main culprit that was generating maximum errors against the outdated PHP. Having both PHP and Elementor upgraded fixed our issues last time & I didn’t expect anything different this time either.

This time, as soon as I came across the errors once after WordPress upgrade, I asked our hosting partner to upgrade PHP (7.4 => 8.x) for WordPress 6.2.2 and updated Elementor afterwards. That has taken care of the annoying “Deprecated” error messages those were appearing in the admin console (mostly). Please note, while Elementor could be the primary culprit, any other plugin that makes the function calls listed could be the reason for these errors. Update each one of them and see whether the issues persist.

Oracle workflow builder can’t load (or register) custom control wfnvg20.ocx

Oracle workflow developer for Oracle Applications (EBS) R12 version 2.6.3.x has total 33k downloads. That gives us an idea how scarcely this software is used. Oracle sucks at one place the most, that is fixing their legacy software for new operating systems. For example, Oracle EBS R12 release 12.2 is expected to be supported until 2031, while the development tools for the same were supported till Windows XP OS. Then once in a while they boast about releasing another version of legacy tool, expected to work on later operating systems.

Oracle Workflow builder is not different. Their documentation misses one of the vital point about why one should install the software in a brand new Oracle home! Yes, if you have multiple Oracle products already installed on your computer, Workflow builder installer will pickup the first Oracle home it could read from the Windows registry and default it for the installation, which is the core of all problems you will face while & after the installation.

So, let us do a proper installation of Oracle workflow builder 2.6.3 this time.

Download the installer, which might need a valid Oracle support (Please note, this particular post might only satisfy this particular version of Oracle workflow builder). Extract the archive, go to Disk1 folder and change the property of Setup.exe as seen in the below image.

Setup the compatibility and Running this program as administrator are mandatory for a successful installation.

Now, before starting the software installation, take a backup of your PATH environment variable. Please read my other post explaining how to make a backup for the PATH and later restoring it after the Workflow builder installation.

This is not mandatory, however advisable based on the number of software that you have already installed on your computer.

Once the setup starts make sure you will setup a fresh home for “Workflow builder”

If you made a correct decision for a fresh home, then installation must complete without issues. Please check the below images for additional details. If you try to install the workflow builder in one of the existing Oracle homes, you will comes across installation error(s)

If you ignored the errors and continued with the installation, you will not be presented with net configuration wizard or other post installation steps & you will not able to start Workflow builder, throwing a run-time error.

Leave the prompts to their defaults unless necessary.

At the last phase of the installation, Net configuration assistant starts.

Well, there is no guarantee that the network configuration setup will complete successfully. My development machine has many Oracle products installed and has multiple JAVA runtimes, I think that should be one of the reasons why the configuration tool always failed to complete the setup successfully. Your case may differ.

Please note, you can Oracle XML Gateway Message Designer is also a part of the installation package, you can proceed to install the product if you want at this stage.

Once the installation(s) over, open Oracle Workflow Builder as administrator always, without which the software cannot read Windows Registry keys.

That’s all. Please note, you are installing a software that was made for Windows XP and hardly received much love from Oracle afterwards. Oracle is keeping it only to support legacy software like Oracle E-Business Suite, which Oracle dearly wants to the pull the plugs off, so that they could force the half cooked cloud based Fusion software & squeeze the customers further through subscriptions. Hence don’t expect Oracle fixing these installation ever, EVER!

Windows 11 | Snipping tool “Recording stopped”

Updated on 20th December 2023. Yesterday, I came across Intel forum discussion, about a particular decoder issue strongly tied to Intel UHD. It was quite a discussion and I noticed that the user was able to get stuffs work when he was using “Microsoft Basic Display Adapter” instead of Intel UHD drivers. So, I wanted to see whether it is the case with Snipping tool recording also. I kept removing the display drivers until the device manager shown “Microsoft Basic Display Adapter” for me. I started the screen recording and, yes, it worked! Let us check out a small video now, that was captured using Snipping Tool. Unfortunately, as soon the drivers were reinstalled, I lost this privilege and the only solution “working” for me was as discussed below.

Updated on 3rd December 2023. It looks like, many people were able to get the snipping tool working finally by setting graphics to High Performance GPU. For me, the only option that works as on date is disabling the Intel UHD from devices panel. I think, it is a device specific issue & not many others are affected the way I am. Anyway, cheers guys. We have a working workaround now!

Disable the Intel Graphics. Snipping tool works, or worked for me through multiple hot and cold restarts after this hack.

If it fails, will update this thread with further information.

I will keep this as an open thread as, while the above hack works every time it has some adverse effects. Once I disable the Intel UHD graphics, my box cannot “Project” anymore! That means my multiple monitors setup goes for a toast. To get it back, I must enable the Intel UHD graphics once after the screen recording, feels awkward.

My HP laptop is more than 4 years old & the BIOS does not support selecting NVIDIA as default GPU, instead it is either the low power or hybrid mode. NVidia control panel is not of much help as Windows 11 handles such settings itself.

So for the time being, whenever you want to record screen using snipping tool, just disable the Intel UHD graphics and turn it on immediately after that in order to get back the multiple monitors support. If you are not using multiple monitors, then you can leave the changes as it is.