Archiving data by using BMC Server Automation jobs
Use the run_archival_from_om.nsh script to archive data by using BMC Server Automation jobs, as described in this topic. The run_archival_from_om.nsh script uses archival settings, such as archive directory location and retention period for domains, that you configure by using the BMC Decision Support for Server Automation Console. This script is included in the Inventory-Templates.zip file, which is located in the BDSSAInstallationDirectory/Contents directory.
On SQL Server 2012, the archival process fails with the following error message:
Error = [Microsoft][SQL Server Native Client 11.0]Warning: BCP import with a format file will convert empty strings in delimited columns to NULL.
Workaround: This error occurs due to a limitation in SQL Server 2012. To resolve the issue, install SQL Server 2012 SP1.
Before you begin
Before you archive the reports data warehouse data, ensure that theare met:
- Ensure that you are using database versions supported by BMC Decision Support for Server Automation. See Oracle database support and SQL Server database support for supported database versions.
- Back up your reports data warehouse to prevent data loss in case of failure during the archival process. For information about backing up your data warehouse, see your database documentation.
- Ensure that you have read/write permissions in the directory in which you want to store the archived files.
Run extract, transform, and load (ETL) for all sites and ensure that the runs are complete.
Run ETL just before running the archive utility to ensure that no new ETL scripts are run.
- (Oracle only) Ensure that the following privileges are assigned to the reports data warehouse user:
- GRANT CREATE ANY DIRECTORY TO datawarehouseUser
- GRANT DROP ANY DIRECTORY TO datawarehouseUser
- GRANT EXP_FULL_DATABASE TO datawarehouseUser
- GRANT IMP_FULL_DATABASE TO datawarehouseUser
- GRANT EXECUTE ON utl_file TO datawarehouseUser
- (Microsoft SQL Server only) Assign the sysadmin role to the reports data warehouse user. You can revoke this role assignment when the archival and restore operations are complete.
(SQL Server only) If you are running the archive utility for the first time, ensure that you have enabled the
xp_cmdshellserver configuration option. This option enables system administrators to control whether the
xp_cmdshellextended stored procedure can be executed on a system. By default, this option is disabled. It must be enabled to perform the delete operation on archived files. To enable the option, run the
xp_configuresystem stored procedure on the reports data warehouse as a data warehouse user with the sysadmin role, as follows:
EXEC sp_configure 'show advanced options', 1 GO -- To update the currently configured value for advanced options. RECONFIGURE GO -- To enable the feature. EXEC sp_configure 'xp_cmdshell', 1 GO -- To update the currently configured value for this feature. RECONFIGURE GO
To run the archival process by using BMC Server Automation jobs
- Extract the contents of the content_installer.zip file to a directory of your choice on the BMC Server Automation Application Server.
- Run the content installer.
The script is added to BMC Server Automation as a Network Shell script.
- Create a Network Shell Script Job for the run_archival_from_om.nsh script.
You can use this job to run the archival process on specified servers. You can execute the job for a one-time run or you can create a schedule for the job.
- Run the job against the target report server.
To create a Network Shell Script Job for the run_archival_from_om.nsh script
Log on to the BMC Server Automation Console.
Navigate to the Depot/BladeLogic Reports Scripts/Run BDSSA Archival folder.
- Right-click Run BDSSA Archival Script and select the NSH Script Job option.
The New NSH Script Job wizard starts.
- In the Name field, enter name of the NSH Script Job.
- In the Save in field, enter the path where you want to save the job, and click Next.
- In the Targets pane, select the report servers on which you want to run the archival process, and click Next.
In the Parameters pane, set the
ETL_HOMEparameter as the directory in which the ETL-related files (extract, transform, and load) are located.
The default location is BDSSAInstallationDirectory/shared/odi/bin.
Enter the path in NSH format.
- Click Next.
- In the Default Notifications pane, configure job run notifications, and click Next.
- In the Schedules panel, schedule the job if required, and click Finish.
The job is created in the location that you specified in step 5.
For more information about the options available while creating an NSH Script Job, see Creating Network Shell Script Jobs in the BMC Server Automation documentation.
When you run the archival process by using a BMC Server Automation job, the messages are written to the BDSSAInstallationDirectory/logs/archival.log file. When you run the archival process by using the console, the messages are written to the BDSSAInstallationDirectory/logs/bds-ui.log file.