Cloning is an important part of managing an Oracle E-Business Suite implementation. It allows the syncing of recent and relevant data into the non-production environments. The cloning process isn’t without its drawbacks however. In its purest form, the clone takes an exact copy of the Production database and overlays a non-prod environment. With this process, the non-prod database loses any customizations in the upcoming release. At this point, developers need to redeploy their customizations in the non-production environment which leads to loss of productivity. FlexDeploy can help in this situation with its post clone refresh process. To demonstrate, let’s take a look at FlexDeploy before and after a clone. This example will involve cloning the Production environment to the Development environment.

Prior to the EBS Clone

Below is the output of the Environment Discrepancies report for the XXHR module. One particular file, XXHR_BIPUB_REP_PKG.pkb, is what we are going to focus on.

The Development and Production environments show two different SCM revisions deployed for our file, b46b18054826 and b1d6c580d6ec respectively. See the deployed code for the XXHR_BIPUB_REP_PKG.pkb file in Development below:

CREATE OR REPLACE PACKAGE BODY APPS.xxhr_bipub_rep_pkg IS

  PROCEDURE generate_xml( p_errbuf  OUT VARCHAR2
                        , p_retcode OUT NUMBER) IS
  BEGIN
      FND_FILE.put_line(fnd_file.output, '<?xml version="1.0" encoding="UTF-8"?>');
      FND_FILE.put_line(fnd_file.output, '<Roster>');
      FND_FILE.put_line(fnd_file.output, ' <Week>');
      FND_FILE.put_line(fnd_file.output, '  <WeekNo>1</WeekNo>');
      FND_FILE.put_line(fnd_file.output, '  <Monday>Thomas</Monday>');
      FND_FILE.put_line(fnd_file.output, '  <Tuesday>Emily</Tuesday>');
      FND_FILE.put_line(fnd_file.output, '  <Wednesday>Annie</Wednesday>');
      FND_FILE.put_line(fnd_file.output, '  <Thursday>James</Thursday>');
      
      FND_FILE.put_line(fnd_file.output, '  <Friday>Gordon</Friday>');
      FND_FILE.put_line(fnd_file.output, '  <Saturday>Rosie</Saturday>');
      FND_FILE.put_line(fnd_file.output, '  <Sunday>Henry</Sunday>');
      FND_FILE.put_line(fnd_file.output, ' </Week>');
      FND_FILE.put_line(fnd_file.output, ' <Week>');
      FND_FILE.put_line(fnd_file.output, '  <WeekNo>2</WeekNo>');
      FND_FILE.put_line(fnd_file.output, '  <Monday>Bertie</Monday>');
      FND_FILE.put_line(fnd_file.output, '  <Tuesday>Harold</Tuesday>');
      FND_FILE.put_line(fnd_file.output, '  <Wednesday>Toby</Wednesday>');
      FND_FILE.put_line(fnd_file.output, '  <Thursday>Clarabel</Thursday>');
      FND_FILE.put_line(fnd_file.output, '  <Friday>Percy</Friday>');
      FND_FILE.put_line(fnd_file.output, '  <Saturday>Edward</Saturday>');
      FND_FILE.put_line(fnd_file.output, '  <Sunday>Trevor</Sunday>');
      FND_FILE.put_line(fnd_file.output, ' </Week>');
    FND_FILE.put_line(fnd_file.output, ' <Week>');
      FND_FILE.put_line(fnd_file.output, '  <WeekNo>3</WeekNo>');
      FND_FILE.put_line(fnd_file.output, '  <Monday>Jim</Monday>');
      FND_FILE.put_line(fnd_file.output, '  <Tuesday>Matt</Tuesday>');
      FND_FILE.put_line(fnd_file.output, '  <Wednesday>Mo</Wednesday>');
      FND_FILE.put_line(fnd_file.output, '  <Thursday>Trevor</Thursday>');
      FND_FILE.put_line(fnd_file.output, '  <Friday>John</Friday>');
      FND_FILE.put_line(fnd_file.output, '  <Saturday>Danaerys</Saturday>');
      FND_FILE.put_line(fnd_file.output, '  <Sunday>Michael</Sunday>');
      FND_FILE.put_line(fnd_file.output, ' </Week>');
      FND_FILE.put_line(fnd_file.output, '</Roster>');
  end generate_xml;
END xxhr_bipub_rep_pkg;
/

And now Production…

CREATE OR REPLACE PACKAGE BODY APPS.xxhr_bipub_rep_pkg IS

  PROCEDURE generate_xml( p_errbuf  OUT VARCHAR2
                        , p_retcode OUT NUMBER) IS
  BEGIN
      FND_FILE.put_line(fnd_file.output, '<?xml version="1.0" encoding="UTF-8"?>');
      FND_FILE.put_line(fnd_file.output, '<Roster>');
      FND_FILE.put_line(fnd_file.output, ' <Week>');
      FND_FILE.put_line(fnd_file.output, '  <WeekNo>1</WeekNo>');
      FND_FILE.put_line(fnd_file.output, '  <Monday>Thomas</Monday>');
      FND_FILE.put_line(fnd_file.output, '  <Tuesday>Emily</Tuesday>');
      FND_FILE.put_line(fnd_file.output, '  <Wednesday>Annie</Wednesday>');
      FND_FILE.put_line(fnd_file.output, '  <Thursday>James</Thursday>');
      
      FND_FILE.put_line(fnd_file.output, '  <Friday>Gordon</Friday>');
      FND_FILE.put_line(fnd_file.output, '  <Saturday>Rosie</Saturday>');
      FND_FILE.put_line(fnd_file.output, '  <Sunday>Henry</Sunday>');
      FND_FILE.put_line(fnd_file.output, ' </Week>');
      FND_FILE.put_line(fnd_file.output, ' <Week>');
      FND_FILE.put_line(fnd_file.output, '  <WeekNo>2</WeekNo>');
      FND_FILE.put_line(fnd_file.output, '  <Monday>Bertie</Monday>');
      FND_FILE.put_line(fnd_file.output, '  <Tuesday>Harold</Tuesday>');
      FND_FILE.put_line(fnd_file.output, '  <Wednesday>Toby</Wednesday>');
      FND_FILE.put_line(fnd_file.output, '  <Thursday>Clarabel</Thursday>');
      FND_FILE.put_line(fnd_file.output, '  <Friday>Percy</Friday>');
      FND_FILE.put_line(fnd_file.output, '  <Saturday>Edward</Saturday>');
      FND_FILE.put_line(fnd_file.output, '  <Sunday>Trevor</Sunday>');
      FND_FILE.put_line(fnd_file.output, ' </Week>');
      FND_FILE.put_line(fnd_file.output, '</Roster>');
  end generate_xml;
END xxhr_bipub_rep_pkg;
/

Package in development has a third week in the xml compared to Production.  Now that we have a firm handle of our current state, lets see what things look like after the clone.

After the EBS Clone

As expected, both the Development and Production environments now contain the same revision, b1d6c580d6ec.

CREATE OR REPLACE PACKAGE BODY APPS.xxhr_bipub_rep_pkg IS

  PROCEDURE generate_xml( p_errbuf  OUT VARCHAR2
                        , p_retcode OUT NUMBER) IS
  BEGIN
      FND_FILE.put_line(fnd_file.output, '<?xml version="1.0" encoding="UTF-8"?>');
      FND_FILE.put_line(fnd_file.output, '<Roster>');
      FND_FILE.put_line(fnd_file.output, ' <Week>');
      FND_FILE.put_line(fnd_file.output, '  <WeekNo>1</WeekNo>');
      FND_FILE.put_line(fnd_file.output, '  <Monday>Thomas</Monday>');
      FND_FILE.put_line(fnd_file.output, '  <Tuesday>Emily</Tuesday>');
      FND_FILE.put_line(fnd_file.output, '  <Wednesday>Annie</Wednesday>');
      FND_FILE.put_line(fnd_file.output, '  <Thursday>James</Thursday>');
      
      FND_FILE.put_line(fnd_file.output, '  <Friday>Gordon</Friday>');
      FND_FILE.put_line(fnd_file.output, '  <Saturday>Rosie</Saturday>');
      FND_FILE.put_line(fnd_file.output, '  <Sunday>Henry</Sunday>');
      FND_FILE.put_line(fnd_file.output, ' </Week>');
      FND_FILE.put_line(fnd_file.output, ' <Week>');
      FND_FILE.put_line(fnd_file.output, '  <WeekNo>2</WeekNo>');
      FND_FILE.put_line(fnd_file.output, '  <Monday>Bertie</Monday>');
      FND_FILE.put_line(fnd_file.output, '  <Tuesday>Harold</Tuesday>');
      FND_FILE.put_line(fnd_file.output, '  <Wednesday>Toby</Wednesday>');
      FND_FILE.put_line(fnd_file.output, '  <Thursday>Clarabel</Thursday>');
      FND_FILE.put_line(fnd_file.output, '  <Friday>Percy</Friday>');
      FND_FILE.put_line(fnd_file.output, '  <Saturday>Edward</Saturday>');
      FND_FILE.put_line(fnd_file.output, '  <Sunday>Trevor</Sunday>');
      FND_FILE.put_line(fnd_file.output, ' </Week>');
      FND_FILE.put_line(fnd_file.output, '</Roster>');
  end generate_xml;
END xxhr_bipub_rep_pkg;
/
CREATE OR REPLACE PACKAGE BODY APPS.xxhr_bipub_rep_pkg IS

  PROCEDURE generate_xml( p_errbuf  OUT VARCHAR2
                        , p_retcode OUT NUMBER) IS
  BEGIN
      FND_FILE.put_line(fnd_file.output, '<?xml version="1.0" encoding="UTF-8"?>');
      FND_FILE.put_line(fnd_file.output, '<Roster>');
      FND_FILE.put_line(fnd_file.output, ' <Week>');
      FND_FILE.put_line(fnd_file.output, '  <WeekNo>1</WeekNo>');
      FND_FILE.put_line(fnd_file.output, '  <Monday>Thomas</Monday>');
      FND_FILE.put_line(fnd_file.output, '  <Tuesday>Emily</Tuesday>');
      FND_FILE.put_line(fnd_file.output, '  <Wednesday>Annie</Wednesday>');
      FND_FILE.put_line(fnd_file.output, '  <Thursday>James</Thursday>');
      
      FND_FILE.put_line(fnd_file.output, '  <Friday>Gordon</Friday>');
      FND_FILE.put_line(fnd_file.output, '  <Saturday>Rosie</Saturday>');
      FND_FILE.put_line(fnd_file.output, '  <Sunday>Henry</Sunday>');
      FND_FILE.put_line(fnd_file.output, ' </Week>');
      FND_FILE.put_line(fnd_file.output, ' <Week>');
      FND_FILE.put_line(fnd_file.output, '  <WeekNo>2</WeekNo>');
      FND_FILE.put_line(fnd_file.output, '  <Monday>Bertie</Monday>');
      FND_FILE.put_line(fnd_file.output, '  <Tuesday>Harold</Tuesday>');
      FND_FILE.put_line(fnd_file.output, '  <Wednesday>Toby</Wednesday>');
      FND_FILE.put_line(fnd_file.output, '  <Thursday>Clarabel</Thursday>');
      FND_FILE.put_line(fnd_file.output, '  <Friday>Percy</Friday>');
      FND_FILE.put_line(fnd_file.output, '  <Saturday>Edward</Saturday>');
      FND_FILE.put_line(fnd_file.output, '  <Sunday>Trevor</Sunday>');
      FND_FILE.put_line(fnd_file.output, ' </Week>');
      FND_FILE.put_line(fnd_file.output, '</Roster>');
  end generate_xml;
END xxhr_bipub_rep_pkg;
/

If we were to look at our report again we would see the exact same information as before. FlexDeploy has no knowledge the clone even took place let alone what objects may have changed in the process. How do we solve this? The Post Refresh Request was introduced in order to handle this exact scenario.

Post Refresh Requests

Navigate to the Development EBS instance and we can trigger a Post Refresh Request.

On the next screen we need to fill out the source environment of the Clone. In this case it was the Production environment.  FlexDeploy automatically calculates which files in which projects need to be deployed once the request has been submitted.

Once the request has been submitted, each project will generate a new “Post Refresh” package to be deployed.

Upon inspecting the files in the package, we see it has picked the original development revision b46b18054826 of the XXHR_BIPUB_REP_PKG.pkb file.  

Fantastic!  FlexDeploy correctly rebuilt and deployed the original Development revision of our file. But what happens when we have files sourced directly from EBS, like the other two files in the package? Fear not, FlexDeploy is actually pulling all of these files, SCM sourced included, from its own internal artifact repository.

Keep in mind that we followed one particular file through the EBS Clone and Post Refresh steps.  This same process is performed for every file that would have been affected by the clone.  Not shown is also that FlexDeploy will maintain the order of the files deployed.  No more worrying about deploying package bodies before package headers!

Re-syncing an environment after an EBS Clone with the push of a button…DevOps baby!

Improve EBS development with these pro tips.

Joel Wenzel

I have been working on integration and API architecture and development for the past 6 years, including with products such as Oracle SOA Suite, MuleSoft Anypoint Platform, Oracle Integration Cloud and API Platform, and Google Apigee. At Flexagon, I am part of the FlexDeploy engineering team which is enabling on prem and cloud use cases related to integration, API management, containers, and other tools and technologies.

More posts by Joel Wenzel
    

Leave a Reply

Your email address will not be published. Required fields are marked *