Oracle Applications: Production to Development Refresh/Clone Parameter Change SQL Script.

Posted by Jiltin     12 May, 2009    2,901 views   

Big companies that follow Process oriented project management team, with multiple projects executed at phased manner, may face challenges during database refresh from production system to development or test systems. Many programs customized to connect to external systems such as lockbox servers, payment processing servers and other boundary server systems.

After every refresh, it is imperative to change the development systems to point to null or Development external test servers instead of production servers. If this is not done immediately after the database refresh, development data may accidentally reach the production external servers that cause havoc! For example, if some developers start automatic payment/receipt programs in DEV servers that connects to production payment processors, customers may get charged without any product shipped! This is illegal and I had seen, two times in last 10 years, which affects customer confidence!

We have created a simple table that stores development default values and production default values and a simple plsql block that reads the table and changes the default parameter depending on the instances. This can be a manual or automatic run after a refresh by DBAs. In many companies, this is maintained by DBAs. However, using this, Any one responsible can maintain the parameter and DBAs can run the script to change the values. We have even created a form to review, add, edit or delete. Currently, I am not providing the form (*.fmb) but the table and plsql block for your reference.

Download parameterchange.sql

Here is the table script:

DROP TABLE xxcus_con_default_value CASCADE CONSTRAINTS;

CREATE TABLE xxcus_con_default_value
(
  CONC_PROGRAM_NAME   VARCHAR2(30 BYTE)         NOT NULL,
  PARAM_NAME          VARCHAR2(30 BYTE)         NOT NULL,
  DEV_DEFAULT_VALUE   VARCHAR2(240 BYTE),
  PROD_DEFAULT_VALUE  VARCHAR2(240 BYTE),
  CREATED_BY          NUMBER(15)                NOT NULL,
  CREATION_DATE       DATE                      NOT NULL,
  LAST_UPDATED_BY     NUMBER(15)                NOT NULL,
  LAST_UPDATE_LOGIN   NUMBER(15),
  LAST_UPDATE_DATE    DATE                      NOT NULL
)

Here is the form:
parameter.jpg

Here is the PLSQL script:

–Source File                :ParameterChange.sql
–REM =====================================================================================
/* Created  on             : 09-Jan-2006                                                   */
/* Created By              : Jiltin                                                        */
/* ======================================================================================= */

SET serveroutput ON size 1000000
SET arraysize 1
SET feed off
SET echo off

DECLARE
   l_instance      VARCHAR2(30):= ‘&1′;
   l_report_only   VARCHAR2(30):= ‘&2′;

   CURSOR parm_list IS
    SELECT      conc.conc_program_name,
                conc.param_name,
                conc.dev_default_value,
                conc.prod_default_value,
                arg.DEFAULT_VALUE old_default_value
    FROM        xxcus_con_default_value conc,
                FND_DESCR_FLEX_COL_USAGE_VL arg
    WHERE arg.descriptive_flexfield_name =  ‘$SRS$.’conc.conc_program_name
    AND arg.END_USER_COLUMN_NAME=conc.param_name
    ORDER BY 1,2;

    l_rowid         rowid;
    l_default_value VARCHAR2(240);
    l_status VARCHAR2(3000):=‘Report Only’;

BEGIN
 fnd_file.put_line(fnd_file.LOG,‘Instance: ‘l_instance);
 fnd_file.put_line(fnd_file.output,‘Instance Name: ‘l_instance);
 fnd_file.put_line(fnd_file.output,‘Resport Only Mode: ‘l_report_only);

 fnd_file.put_line(fnd_file.output,‘Program Name         Parameter                      Current Value                                                          New Value                                                              Status’);
 fnd_file.put_line(fnd_file.output,‘============         =========                      =============                                                          =========                                                              ======’);

 FOR rec IN parm_list LOOP
    IF (l_instance = ‘Production’ ) THEN
       l_default_value := rec.prod_default_value;
    ELSE
       l_default_value := rec.dev_default_value;
    END IF;

    IF (l_report_only <> ‘Yes’) THEN
       BEGIN
          UPDATE      fnd_descr_flex_column_usages
          SET         DEFAULT_VALUE = l_default_value,
                      LAST_UPDATE_LOGIN = fnd_global.user_id,
                      LAST_UPDATE_DATE = sysdate
          WHERE       descriptive_flexfield_name =  ‘$SRS$.’rec.conc_program_name
          AND         END_USER_COLUMN_NAME= rec.param_name
          AND         DEFAULT_VALUE <> l_default_value;

          fnd_file.put_line(fnd_file.LOG,rec.conc_program_name‘,’rec.param_name‘,’l_default_value‘,’SQL%ROWCOUNT);
          IF (SQL%ROWCOUNT > 0 ) THEN
             l_status := ‘Updated’;
          ELSE
             l_status := ‘Not Updated’;
          END IF;
       EXCEPTION
          WHEN others THEN
             l_status := sqlerrm;
       END;
    END IF;

    fnd_file.put_line(fnd_file.output,rpad(rec.conc_program_name,20,‘ ‘)‘ ‘rpad(rec.param_name,30,‘ ‘)‘ ‘rpad(rec.old_default_value,70)‘ ‘rpad(l_default_value,70,‘ ‘)‘ ‘l_status);
 
 END LOOP;

 IF (l_report_only <> ‘Yes’) THEN
    commit;
 END IF;
 
EXCEPTION
   WHEN OTHERS THEN
        fnd_file.put_line(fnd_file.LOG,‘Error occurred while executing: ‘ SUBSTR(SQLERRM, 1, 150));
END;
/

Following Google Searches Lead To This Post: sql plus error with fnd_file
refreshing the oracle r12 clone instance
using FND_file in SQL SCRIPT
can i use substr in fnd_file.put_line in oracle
to find the date at which the table is last updated in oracle apps
refresh database oracle financials
oracle prod to development database refresh
refresh Oracle form
script to refresh oracle test database with production
refresh oracle apps steps
data refresh in oracle Apps
R12 post clone
production instance in oracle apps
oracle apps refresh one instance with another
unix oracle apps script
oracle apps refreshing database
dev and test developer passwords production
how to change apply date in oracle application
mysql refresh development database
IF `SQL%ROWCOUNT` <> THEN commit IN ORACLE AND DISPLAY IN UNIX SCRIPT
oracle financials cloning
oracle apps form parameter
fnd_file.put_line
change oracle database production development
find date oracle apps instance was cloned
oracle + refresh test db with prod data
oracle refreshing development database
oracle cloning scripts
apps clone database refresh only
db refres oracle apps
oracle apps refres
current program 11i parameter passing
oracle applications 11i+ scripts
oracle applications management cloning
oracle application cloning 12.0
how to automate R12 cloning
daily refresh database oracle
11i database refresh
oracle forms refresh bloc
how to male aclone in oracle applicaion
Oracle select Prod data from dev instance
oracle last refresh date
oracle apps cloning steps
APPS.FND_FILE.PUT_LINE
oracle parameter+compare+prod+dev
steps to refresh oracle database from prod to dev
how to refresh Oracle Apps development
passing paramter from shell script to sql script example code
oracle db refresh date
Oracle applications database refresh date
mysql refresh shell script
automated r12 cloning
oracle apps R12 refresh
oracle applications clone bash script
oracle add data prod to clone
oracle find cloned date
R12 cloning with out the production data
R12 cloning without the production data
How to clone without production data
refresh data through SQL Scripts
fnd_file.file.output in Oracle applications
refreshing oracle applications database
oracle financial clone
post clone automation script in apps
oracle apps script sql
to cloning a test instance from production in oracle
SET size using fnd_file.OUTPUT
unix shell scripts for Database Refreshes
refresh date in oracle
post cloning steps+oracle apps r12
oracle auto database clone script
how to find last cloned date in database
SQL change oracle db parameters
oracle R12 clone scripts
oracle apps cloning
oracle form ROWCOUNT = 0
shell script to change apps password+oracle application clone
shell script refresh
R12 post clone steps?
site name parameter apps 12i
database refresh from prod to dev
automated oracle applications cloning script
oracle applications Jiltin sql scripts
passing date parameters to oracle sql script
how to get the cloning date from oracle apps back end tables
sql script change apps password R12i
apps 11i cloning softwares
refresh oracle applications
script oracle parameters
oracle forms refrescar datos
database refresh in oracle apps 11i linux
how to check the last cloned date in oracle Apps 11i
how to pass date as parameter in apps
script refresh oracle database
refresh clone in oracle
clone date in oracle apps11i
Automatic Apps Cloning Script
oracle forms refresh block
oracle + how to find when was database refresh done
Oracle Forms: refresh a data block table after the table is changed.
oracle refresh TABLE SQL
clone from production to devlopment
FND_FILE.put_line in oracle
clone of oracle apps from production to devlopment
database refresh cloning in oracle 11i
Automatic Oracle Apps Cloning Script
how to automate db refresh in oracle
how to change apply date in oracle applications
How to refresh many tables from production to Development in Oracle Database
Oracle database refresh/clone date
table where the Oracle database refresh/clone date
where oracle maintains (table) data “fnd_file.put_line”
11i determine last clone date
11i when was last clone date
how to check the cloning date in oracle apps 11i

Post to Twitter  Post to Delicious  Post to Digg    Post to StumbleUpon

Categories : 11i Scripts, Oracle AOL, Oracle Applications, Scripts Oracle Tags : ,

Comments
December 9, 2009

So, for me, this plugin did not work. If you have suggestions or recommendations, I would very much appreciate them. Thanks.

Posted by mac wholesale
Leave a comment

(required)

(required)