search cancel

How can I import log files generated by harvest.bat script into a SQL Server Database.


Article ID: 52916


Updated On:


CA Single Sign On Secure Proxy Server (SiteMinder) CA Single Sign On SOA Security Manager (SiteMinder) CA Single Sign-On



I have followed the TEC484180 to import the audit logs to the sql database I was successfully able to run the script harvest.bat -cleanup (switch) and the script created all the comma seperated values in .tmp files know i was trying to import these files to SQL database. Do you know How I can import the csv files into the SQL Server Databases?


This can be done using SQL Server utilities, in this KB article we are using the SQL Server utility BCP.

You can import the data as follows:

  1. Create a format file or use the attached template.
  2. Copy the csv files to the SQL Server host.
  3. Run the bcp utility as follows:
bcp <database>.<owner>.table in <datafile> -T -f format <file>


C:\temp>bcp auditstore..smobjlog4 in XPS_324_20090731104256_1.dat -T -f C:\temp\format.xml
Starting copy...
8 rows copied.
Network packet size (bytes): 4096
Clock Time (ms.) Total     : 16     Average : (500.00 rows per sec.)


Component: SMPLC

Attachments get_app