Archive for February, 2023

Retrieve Forgotten Apps Password in Oracle EBS R12

February 20th, 2023, posted in Oracle Queries
I am going to share steps to retrieve the password in Oracle Apps.
But no guarantee that it will work on all EBS version. It was tested on R12.2.3.


1: log in to the database server with sys user
 sqlplus / as sysdba
2: Create Function to decrypt the encrypted password
SQL> create FUNCTION apps.decrypt_pin_func(in_chr_key IN VARCHAR2,in_chr_encrypted_pin IN VARCHAR2)
return java.lang.String’;
3 : Query for Encrypted password


 ——————————————————————————–  ZG37E123746712BDB2D99E048FE44AE662F2713E2EDB443391BABA0414CADDB7A2E6DD45BBAFA7270A663E5EEBA837F5548A
4: Past the Encrypted password from the above query output into the below query and execute
SELECT apps.decrypt_pin_func
from dual;


5: Test apps password is working or not
 SQL> conn apps/oralce123;

Delete Files Older Than X days in Unix or Solaris

February 5th, 2023, posted in Solaris

Delete Files Older Than X days in Unix or Solaris,Delete Files Older Than X days in Solaris,


Introduction :

In Production server, there is always a need to free up the disk space from time to time. The best way to achieve is to have a cron job or an autosys job which will delete the older log files from the directory.

In this simple tutorial, we’ll quickly look at the solution to this problem. In order to delete files older than X number of days, try using Unix find command. find command is more powerful than you can really imagine. It comes up with multiple options which when gets handy can help you cover a lot of functional requirements like moving files among directories, deleting old files, archiving files etc.

Recently I came across one such requirement of deleting files older than X days from a directory in Unix server and I thought of sharing the solution with you.

Solution :

Unix find command is used to achieve the desired result.

find /path/to/the/directory/ -type f -name '*' -mtime +30 -exec rm {} \;

Explanation :

Time to breakdown the find command mentioned above :

  1. /path/to/the/directory Edit this portion of the code with the path of your target directory.
  2. -type f : It signifies that we are targeting all the ‘files’ in the specified directory.
  3. -name ‘*’We have used a general regex “*” to match all the file names. You can make it more specific if you need. For example , to delete only dat files use-name "*.dat".
  4. -mtime +30This refers to all the files which are older than 30 days. mtime stands for Modification time in Unix.You can change the number based on your requirement.
  5. exec rm {} \ : This is actually the execution command which calls for deletion of all the files filtered by all the above criteria. rm stands to remove in Unix.

Although it is a very simple command, still I want you understand the usage of mtime in find command in a little more detail.

The POSIX specification for find command states that :

-mtime n The primary shall evaluate as true if the file modification time subtracted from the initialization time, divided by 86400 (with any remainder discarded), is n.

In the descriptions, wherever n is used as a primary argument, it shall be interpreted as a decimal integer optionally preceded by a plus ( ‘+’ ) or minus-sign ( ‘-‘ ) sign, as follows: +n More than nn Exactly n-n Less than.

Important point to note in the above statement is that the fractional part is always ignored. So, when you specify -mtime +1 , it looks for files older more than 1 day. Rather to explain it further, it simply says to match files modified two or more days ago.

If you want to delete files older than 1 day, you can try using -mtime +0 or -mtime 1 or -mmin $((60*24)).

Would suggest you to try playing with the combinations on your own to deepen the understanding.
Still in case you have more questions, please feel free to get in touch with me.