Skip to Content

In this blog, I will be demonstrating a program object to automate the process of back up of the log files generated by BO servers and free the disk space used by logs in default BO logging directory. It helps to investigate root cause for server issues as the log files are organized efficiently

Prerequisites:

  1. BusinessObjects Enterprise System
  2. BusinessObjects Enterprise Java SDKs

Creation of a Java Program Object:

  • For creating a java program object, you need to write a java class which has to implement the interface IProgramBase.
  • Once you create the java file, you would then need to create a jar file for the java class by setting all the required jars in your classpath.
  • Below is a sample java file to take back up of log files in a BusinessObjects environment

import java.io.File;
import java.io.*;
import com.crystaldecisions.sdk.plugin.desktop.program.*;
import com.crystaldecisions.sdk.framework.*;
import com.crystaldecisions.sdk.occa.infostore.*;
import com.crystaldecisions.sdk.exception.*;
public class MoveLogFiles implements IProgramBase {
public void run(IEnterpriseSession enterprisesession,IInfoStore iStore,String str[]) throws SDKException
{
File file = new File(str[0]);
System.out.println("Checkpoint1");     
String[] myFiles;   
if(file.isDirectory()){
System.out.println("cHECKpOINT2");
                myFiles = file.list();
                for (int i=0; i<myFiles.length; i++) {
                File myFile = new File(file, myFiles[i]);
              System.out.println(myFile.getName());
File afile = new File(str[0] +"\\"+ myFile.getName());
System.out.println(afile);
  afile.renameTo(new File(str[1] + "\\" + myFile.getName())) ;
System.out.println(new File(str[1] + "\\" + myFile.getName()));
System.out.println("Suceeded");
                }
             }
}
}

  • Copy the above code into a text file and save it as MoveLogFiles.java. Please make sure that your java class name and file name should exactly be the same (case sensitive).
  • Compile the above java class by having all the jars required to run the file in the classpath. You can also use eclipse IDE to compile and create jar file. The list of jars can be found from the developers guide available at below links:
    • For BI 4.0:

               http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_boejava_dg_en.zip

    • For XI 3.1

               http://help.sap.com/businessobject/product_guides/boexir31/en/boesdk_java_dg_12_en.zip

  • Refer to the section ‘JAR files needed for deployment of Business Objects Software’ from the above guides to get the list of jar files.
  • You would specifically need the jar files listed under ‘BusinessObjects Enterprise Java SDK’
  • Once you have compiled the code, create a jar file for your compiled .class file.


Publishing the Java Program Object to the Enterprise System:

  1. In the CMC, go to Folders and create new folder “Objects” or navigate to an existing folder where you want to publish the program object
  2. Select the folder “Objects” and click on Manage | Add | Program File
  3. Choose as Program Type Java and add BackUpLogFiles.jar
  4. Right Click on ServerStatus within your Objects folder and choose Properties | Default Settings | Program Parameters
  5. Specify as “Class to run:” MoveLogFiles.
  6. In the Arguments section, pass the folllowing parameters:

               It takes two arguments as path for directories starting with the source directory (BO default logging dir path) followed by destination directory (Archive                directory). For example, “D:\BusinessObjects\Logging” “D:\Backup”

               Following two scenarios are applicable here:

      1. BO default logging directory is hosted on the server box where Program Job Server is running:

                       In this scenario you can specify the cache directory path in the usual format e.g. C:\Program Files (x86)\Business Objects\logging

                   b. BO Logging directory is hosted on a remote server or SAN Disk:

                        In this scenario you can specify the cache directory path in the UNC syntax for windows i.e. \\server\share\file_path

                         e.g. \\172.198.101.11\C$\Program Files (x86)\Business Objects\logging

                       Note: The account on which BO services are running must have required access on the remote box in order to perform the read/write/delete operation


   7. Test “Run Now” and schedule the Program Object.

Upon successful execution of the program objects log files are moved from the logging directory to the back up directory.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply