This post explains how to use the ANT script to migrate the BAM objects
across the environments.The script can be run remotely from the client
machine or from the server machine.
- Create a folder BAMConfig and create two sub folders BAMObjects and config inside the BAMConfig folder
- Copy the BAMICommandConfig.xml from $ORACLE_HOME/bam/config folder of the server to the config folder created in the above step.
- Add the default user name and the password to the BAMICommandConfig.xml file
<ICommand_Default_User_Name>weblogic</ICommand_Default_User_Name>
<ICommand_Default_Password>hiyEbs0vwXPQrKh8yE7z3f7JVNhmLLEe+cR3bansiPc=</ICommand_Default_Password>
Also verify the
ADCServerPort - the BAM Server http listening port and
ADCServerName - BAM Server host name properties.
Content of the configuration file:
<?xml version="1.0" encoding="UTF-8"?><BAMICommand>
<ADCServerPort>9001</ADCServerPort>
<ADCServerName>BAM Server hostname</ADCServerName>
<ICommand_Default_User_Name>weblogic</ICommand_Default_User_Name>
<ICommand_Default_Password>hiyEbs0vwXPQrKh8yE7z3f7JVNhmLLEe+cR3bansiPc=</ICommand_Default_Password>
<Communication_Protocol>t3</Communication_Protocol>
<SensorFactory>oracle.bam.common.statistics.noop.SensorFactoryImpl</SensorFactory>
<GenericSatelliteChannelName>invm:topic/oracle.bam.messaging.systemobjectnotification</GenericSatelliteChannelName>
</BAMICommand>
Default password should be encrypted else you will be receiving “ICommandEngine.MissingCredentials” error.
To encrypt the password configure the
BAMICommandConfig.xml file
in the $ORACLE_HOME/bam/config folder with the plain text password and
run any standard icommand from the server (e.g
$ORACLE_HOME/bam/bin/icommand -cmd export -type dataobject -name
SampleDO -file C:\temp\SampleDO.xml) that will encrypt the password.
- Create Export_BAM_Objects.xml file with the BAM export
commands and place the same in BAMConfig folder created in the above
step, the contents of the file look like below
<OracleBAMCommands>
<!--import dataobjects-->
<Export name="/Albin/BAMWebservice" type="dataobject" file="$BAM_PROJ_HOME$/BAMWebservice.xml"/>
<Export name="/SampleDO" type="dataobject" file="$BAM_PROJ_HOME$/SampleDO.xml"/>
</OracleBAMCommands>
Configure the required export commands (exporting different type of objects) into this file.
- Create Import_BAM_Objects.xml file with the BAM import
commands and place the same in BAMConfig folder created in the above
step, the contents of the file look like below
<OracleBAMCommands>
<!--import dataobjects-->
<Import file="$BAM_PROJ_HOME$/BAMWebservice.xml"/>
</OracleBAMCommands>
Configure the required import commands into this file.
- Create the BAMBuild.xml file with the following contents and place the same in the BAMConfig folder created in the above step.
<project name="BAMMigrationProject" basedir="." default="config">
<!--import the property file-->
<property environment="env"/>
<property name="src.dir" value="."/>
<property name="proj.home" value="${env.BAM_PROJ_HOME}"/>
<property name="oracle.home" value="${env.ORACLE_HOME}"/>
<property name="oracle.common.home" value="${env.ORACLE_COMMON_HOME}"/>
<property name="bam.core.lib.dir" value="${env.ORACLE_HOME}/bam/modules/oracle.bam_11.1.1"/>
<property name="bam.tp.lib.dir" value="${env.ORACLE_HOME}/bam/modules/oracle.bam.thirdparty_11.1.1"/>
<property name="dms.lib.dir" value="${env.ORACLE_COMMON_HOME}/modules/oracle.dms_11.1.1"/>
<!--BAM Classpath required by icommand application-->
<path id="bamClasspath">
<fileset file="${bam.core.lib.dir}/oracle-bam-icommand.jar"/>
<fileset file="${bam.core.lib.dir}/oracle-bam-common.jar"/>
<fileset file="${bam.core.lib.dir}/oracle-bam-adc-ejb.jar"/>
<fileset file="${dms.lib.dir}/dms.jar"/>
<fileset file="${bam.tp.lib.dir}/jgroups-core.jar"/>
<fileset file="${bam.tp.lib.dir}/xstream-1.3.1.jar"/>
<fileset file="${bam.tp.lib.dir}/commons-codec-1.3.jar"/>
<fileset file="${oracle.home}/../wlserver_10.3/server/lib/weblogic.jar"/>
<fileset file="${oracle.common.home}/modules/org.jaxen_1.1.1.jar"/>
</path>
<!--export BAM DOs through icommand-->
<target name="export" description="Export BAM dataobjects and reports" depends="config">
<delete dir="${basedir}/BAMObjects" includeemptydirs="true" includes="*/**"></delete>
<java classname="oracle.bam.icommand.Application" fork="true" dir="${src.dir}" classpathref="bamClasspath">
<sysproperty key="oracle.bam.debug" value="true"/>
<arg value="-CmdFile"/>
<arg value="${basedir}/Export_BAM_Objects.xml"/>
</java>
</target>
<!--import BAM DOs through icommand-->
<target name="import" description="Import BAM dataobjects and reports" depends="config">
<java classname="oracle.bam.icommand.Application" fork="true" dir="${src.dir}" classpathref="bamClasspath">
<sysproperty key="oracle.bam.debug" value="true"/>
<arg value="-CmdFile"/>
<arg value="${basedir}/Import_BAM_Objects.xml"/>
</java>
</target>
<!--Modify bam icommand files-->
<target name="config">
<!--replace $project.home$ with the actual project directory inside the command file-->
<replace file="Export_BAM_Objects.xml" token="$BAM_PROJ_HOME$" value="${basedir}/BAMObjects"/>
<replace file="Import_BAM_Objects.xml" token="$BAM_PROJ_HOME$" value="${basedir}/BAMObjects"/>
</target>
</project>
0 comments:
Post a Comment