Oracle Concurrent Program LDT Download Merge

Oracle Concurrent Program LDT Download Merge
Oracle Concurrent Program LDT Download Merge

Multiple LDT file challenge

Oracle Concurrent Program LDT download merge can become a challenging task if you have custom programs scattered across multiple Custom Oracle Applications.

Consider a scenario where you have developed few custom concurrent Programs. Now these belong to different custom Oracle applications and you need to get these program definitions migrated to another environment.

Using FNDLOAD command you need to download each concurrent Program definition separately. Once downloaded , upload these files into target environment. For large number of files it can become painful task.

Multiple LDT file solution

Here is a shell script that I have developed to help with this situation. It will take as input a text file with a  list of Concurrent Programs. On execution it creates one LDT file for all the concurrent program listed in input file.

Download and Merge LDT Script

Oracle Concurrent Program LDT Download Merge Steps

Step1

Identify the concurrent programs that need to be downloaded and create a text file in below format

e.g.
File name

prog_list.txt

File Format

<Program Application short name 1>,<Program short Name 1>
<Program Application short name 2>,<Program short Name 2>
<Program Application short name 2>,<Program short Name 3>
<Program Application short name 3>,<Program short Name 4>
<Program Application short name 3>,<Program short Name 5>

Note: Please keep one blank line at the end of file

Step2

Put the shell script and the prog_list.txt into an empty directory

Step3

Give execute permission to shell script

chmod +x download_merge_cp_ldts.sh

Step4

Execute the script

download_merge_cp_ldts.sh prog_list.txt

Step5

During execution the script will prompt for consolidated LDT file name. Specify the file name for consolidated LDT file.

e.g. if you specify file name as ConsolProg then program consolidates all downloaded concurrent program definition into file ConsolProg.ldt

Step6

Next Script will prompt for apps password. Please specify password for apps schema

Once the script finishes execution the result file ConsolProg.ldt should be available in the same directory where script is present.

This consolidated ldt file can be conveniently uploaded to a different environment in one go.

Hope you find this article to be useful. Please do let me know comments/feedback.

Mass keyword replacement across multiple text files using Shell script

Keyword replacement Heading
Mass Keyword replacement across multiple text files

Let’s consider a scenario where we have a  number of text files containing source code or data, which require some keyword replacement both for file content as well as file name.

 

To illustrate the requirement of keyword replacement  with a data example consider a sample file as shown below

Data Example

File Name: APPLE_FILE.txt

File Content:

INSERT INTO SBI_DEL_WB_PNBE VALUES(…);

INSERT INTO DEL_TAB VALUES(…);

l_tab_name := ‘PNBE_VALUES’;

Keyword Replacement requirement for File Name

APPLE => MANGO

Keyword Replacement requirement for File Content

SBI => PNB

DEL => MUM

WB => BR

PNBE => KlK

 

So after doing the keyword replacement as shown above below should be outcome

 

File Name: MANGO_FILE.txt

 

File Content:

INSERT INTO PNB_MUM_BR_KlK VALUES(…);

INSERT INTO MUM_TAB VALUES(…);

l_tab_name := ‘KlK_VALUES’;

 

This can be done manually for one or two files but imagine you have to do such updates to large number of files and the list of keywords  that need to be replaced is also long . Then it will turn out to be lot of manual work.

 

Here is a shell script that I have developed to automate this kind of task. It can be downloaded from github with below link.

Download Script from github

 

Once you download the file you need to follow below steps to use it.

Steps to do mass keyword replacement

Step 1

Create two directories “source” and “destination” and place the shell script in parent of source and destination. As below screen shot shows

File Location
File Location

Step 2

Create the list of old key words and new keyword to be replaced in file names and place in same directory where shell script is present.

<old_key_1>,<new_key_1>

<old_key_2>,<new_key_2>

…….

Here is screen shot of sample file filename.txt in above example

Filename Keywords
Filename keywords

Step 3

Create a list of old keywords and new keywords to be replaced in file data and place in same directory where shell script is present.

<old_key_1>,<new_key_1>

<old_key_2>,<new_key_2>

…….

Here is screen shot of sample file filedata.txt in above example

File Content Keywords
File Content Keywords

Step 4

Copy all the files where the keywords need to be replaced in the directory “source”.

Step 5

Now provide the execute permission to the shell script by running below command

chmod +x replace_keywords.sh

Step 6

Now the script is ready to be run, so execute below command

replace_keywords.sh filename.txt filedata.txt

Output

Once the command execution completes it creates files in “destination ” directory. Let’s check the file names and file content in destination directory.

File Name

File name got changed as per the keyword replacement specified in “filename.txt”. Here you can see that keyword APPLE got replaced with MANGO and GRAPE got replaced with BANANA. As below two screen shots show

source File Names
source File Names
destination File Names
destination File Names

File Content

File Content in destination directory got changed as per the keyword replacement specified in “filedata.txt”.  Here you can notice that SBI got replaced with PNB, WB with BR and PNBE with KlK as shown in below two screen shots

source file GRAPE_APPLE_commands.txt content
source file GRAPE_APPLE_commands.txt content
destination file BANANA_MANGO_command.txt content
destination file BANANA_MANGO_command.txt content

 

 

 

Hope you find this post useful, please do let me know your comments, feedback.