Friday, April 3, 2015

Best Practices BAM 11g to_12c Migration


The Migration process of BAM 11g Projects to  SOA 12c (12.1.3)


Oracle BAM 12c. Oracle Business Activity Monitoring (BAM) 12c has been completely redesigned for use with Oracle SOA Suite 12c, so there is no direct upgrade path. The schemas, binaries, and directory structure used in Oracle BAM 12c are different than those used with Oracle BAM 11g. Therefore, upgrading from Oracle BAM 11g to BAM 12c cannot be handled with the standard upgrade procedures. You will need to perform several manual configuration tasks to complete the upgrade. unfortunately you won't be able to migrate your 11g  reports on 12c because  "Reports have become dashboards” , “ Columnar reports are no longer supported, replaced by tabbed dashboards”.


         Pre-Requisite


    1.  Oracle SOA12c BAM server should be installed. 
    2. Apply  Patch 19705170 to run BamCommands.
Patch details :[ https://support.oracle.com/epmos/faces/ui/patch/PatchDetail.jspx?parent=DOCUMENT&sourceId=1952000.1&patchId=19705170 ]

Note : With out Patch bamcommand will not import 11g DO,EMS objects to BAM12c
       

         Bam Command Utility

SOA12c the “ICommand “is replaced  with “BAMCommand”. This BAM command Utility  helps us to migrate the  DO,EMS  from SOA11g to SOA12c from back end. This is like ICommand in the SOA11gBAM .   BAMCommand command-line utility can be executed locally or remotely, and it uses  to export, import, migrate, clear, and delete BAM metadata, data, and project artifacts.


        Where to execute BamCommand

Windows  : BAMCommand can be executed from the FMW_HOME\soa\bam\bin
 Unix        : BAM Command can be executed from the FMW_HOME/soa/bam/bin 

        Syntax 


windows  :  bamcommand [-host host] [-port port] [-username username] [-logfile filename] [-logmode [overwrite|append]] -cmd operation -param value

Unix :  ./bamcommand [-host host] [-port port] [-username username] [-logfile filename] [-logmode [overwrite|append]] -cmd operation -param value

Note : [-host host] [-port port] [-username username]  are  read from the BAMCommandConfig.xml

BAMCommand Configuration File

BAMCommand configuration file  is used to  preset BAMCommand parameters . this will help us  not have to type the parameters on the command line each time you use BAMCommand. Command-line parameters override parameters in the configuration file.
This file is located at FMW_HOME/soa/bam/bin/BAMCommandConfig.xml.


Sample BAMCommandConfig.xml 

<host>www.kbace.com</host>
<port>4001</port>
<username>weblogic</username>
<password>welcome1</password>
<dbusername>SOAINFRA</dbusername>
<dbpassword>welcome1</dbpassword>
<dburl>jdbc:oracle:thin:@localhost:1521:orcl</dburl>


Lets start migration now .

DO Migration


 I have 11g DO [UL_OrdersOnHold_DO.xml],  I want to migrate this to 12c , to migrate this you have to follow this steps

1.       Export  BAM11g DO to any folder  [ex: c:\soa11g\bam\ OrdersOnHold_DO.xml]
2.       Start SOA12c  server
3.       Navigate to the following path through command prompt
      $Oracle_Home\soa\bam\bin

4.       Execute following BAMcommand  through command prompt
             
       bamcommand –cmd import –file C:\kbace\ bam \OrdersOnHold_DO.xml -UPGRADE 1
 


5       Once you see the above  message , log into the BAM console using following url

6       Navigate to Administrator à Data Objects  , you will see UL_Order_Hold_DO created .



After migrating the Object , we will find following changes to the 12c Data Objects :


1     Data Object’s Name (UL_Order_Hold_DO) is changed by removing leading underscores from
11g Data Object ID (_UL_Order_Hold_DO) .

2     11g Data Object Column ID (_StringField) is changed to StringField.

3     The 11g Data Object XML has “AutoIncrementingIntegerField”, which is of column type “auto-incrinteger”,which is why no new column is created corresponding to this 11g column in 12c. This column gets mapped to the 12c BEAM_ID column

4     The 11g Data Object XML has “TimestampField”, which is of column type “timestamp”. Again, no new column is created corresponding to this 11g column in 12c. This column gets mapped to the 12c DATAOBJCET_CREATED column.

5     If the length of the 11g Data Object XML column “LongStringField” is specified as 10000, in 12c it is truncated to 2000 because that’s the most that Varchar can support.

You can view the changes in the following screenshots.




Data Object Data Migration:

               
The BAMCommand utility is used to migrate the 11g Data Object data to 12c. The “-migrate” option of BAMCommand is used to migrate the 11g Data Object data to 12c.

Syntax :  bamcommand  -cmd import -file <11g DO XML file> -migrate 1

 Verify BAMCommandConfig.xml


Before migrating 11g data, you must ensure that the DB details such as dbusername and dburl, mentioned in the BAMCommandConfig.xml, are valid.


  Execute BAM Command:

Run following command under  $Oracle\Middleware\Oracle_Home\soa\bam\bin through cmd prompt.
           
  bamcommand  -cmd import  -file C:\bam\UL_OrdersOnHold_DO.xml  -migrate 1
       
       provide the details like  weblogic server username ,password and DB password details.



1.       Once you see the above  message , log into the BAM Composer

2.       Navigate to Administrator à Data Objectsà UL_Order_Hold_DOà Data   , you will see UL_Order_Hold_DO having data like below screenshot.


Note :

You can perform different data operations such as update and overwrite, for that we can  using the “-datamode” option. syntax is below .

Update :
bamcommand -cmd import -file <BAM11gDO>.xml -migrate 1 -datamode update

Overwrite:
bamcommand -cmd import -file BAM11gSimpleDOWithData.xml -migrate 1 -datamode overwrite

EMS Migration

Run following command under  $Oracle\Middleware\Oracle_Home\soa\bam\bin through cmd prompt.

     bamcommand  -cmd import  -file C:\bam\ UL_OrdersOnHold_JMS.xml  -upgrade 1


      
1. Once you see the above  message , log into the BAM console using following url

2.       Navigate to Administrator à Enterprise Message Sources à UL_Order_Hold_JMS  , you will see UL_Order_Hold_JMS appers  like below screenshot.




Manual setup

 When you migrate the 11g EMS to 12c following things are not going to happen and these things  should be done by manually .

          Connection Factory details are not retained. The Outbound Connection JNDI is mapped to NONE.




You must create these details manually and choose the 12c JNDI name.

1     EMS field “Start when BAM Server starts” is not mapped as part of upgrade process. So the “Auto-start” field is set to “false” in 12c .You will have to start the EMS manually.




Report Migration

Unfortunately you won't be able to import your reports on 12c. 
  1.       Reports have become dashboards
  2.       Columnar reports are no longer supported, replaced by tabbed dashboards.

So you have to re-design the BAM11g reports from scratch in BAM12c .





6 comments:

  1. Hi Ramesh,

    Wonderful Article!!! it has solved most my issues in migrating the objects.

    Unfortunately I am getting below Error

    Error occurred for "Dataobject" "tasks_details" :BAM-00901: Object exists already, type: DataObject, name: requests_details..


    Please find the complete log file details


    "accounts_details" has been imported successfully from file "ChartOfAccount.xml" in 2,757 milliseconds.
    Dataobject "accounts_details_BASE", already exists.
    "contacts_details" has been imported successfully from file "ChartOfAccount.xml" in 3,625 milliseconds.
    "external_links" has been imported successfully from file "ChartOfAccount.xml" in 4,403 milliseconds.
    Dataobject "requests_details", already exists.
    Error occurred for "Dataobject" "tasks_details" :BAM-00901: Object exists already, type: DataObject, name: requests_details..
    Import of 3 artifacts completed successfully in 5,484 milliseconds.


    Could you please help me. Thanks in advance,
    with best regards,
    Narasimha

    ReplyDelete
    Replies
    1. Sorry for the delay response , -mode append option can be used to avoid these errors. The point I am
      trying to make is that the usability experience is not consistent. If the
      user is importing a Simple DO without -mode options, then the user should be
      @ able to import Logical DOs, and Derived DOs without -mode options. BAMCommand
      should be a simple interface or a facade that hides the complexities such as
      dependencies in this case.

      Delete
  2. even i am facing same issue, can you please let us know what is the command to delete the Data object.

    ReplyDelete
    Replies
    1. Sorry for the delay response ,
      -mode append option can be used to avoid these errors.
      The point I am trying to make is that the usability experience is not consistent. If the user is importing a Simple DO without -mode options, then the user should be able to import Logical DOs, and Derived DOs without -mode options. BAMCommand should be a simple interface or a facade that hides the complexities such as dependencies in this case.

      Delete
  3. It's really a great and helpful piece of info. I'm glad that you just shared this useful information with us. Please keep us up to date like this. Thank you for sharing.Here is the right place to Submit Guest Post Big Data.

    ReplyDelete