Running the VarcharConversion utility for the MS SQL Server


The datatype NTEXT/TEXT is deprecated. You run this utility to change any NTEXT/TEXT fields on AR forms to NVARCHAR(MAX)/VARCHAR(MAX).

 

The VarcharConversion utility has the following capabilities:

  • It enables you to pause and resume the utility. When you resume the utility, it continues from the step at which it was paused. Pausing the utility might take some time, because the utility must first complete the current operation. 
  • If you stop the utility, during the next run it continues from where it was stopped.  
  • If you run the utility again with the same file name, the new report is appended to the existing report. The default report name is varCharConvertReport.txt, and the report is created in the execution folder. 

Note

  • Run the VarcharConversion utility on the MS SQL Server only. 
  • If the BMC Remedy AR System is configured for non-Unicode database, use the -nonunicode flag. 
  • The utility runs in report mode by default. To run the utility in update mode, use the -udb flag.

Difference between report mode and update mode

The report mode does only READ in the database and only generates the report of fields that are of type NTEXT or TEXT. The update mode actually makes the changes in the database schema to change the data type NTEXT/TEXT to NVARCHAR/VARCHAR, which are supported data types. The report mode of the VarcharConversion utility only reads, so there is no problem in running it in a live system. However, the update mode should be run with a downtime and not in a live system. The VarcharConversion utility can take time to execute depending on the data present in various tables and it cannot be predicted how much time this will take. If time needs to be predicted, the best way is to restore the production dump in another system and run the utility in update mode.

To run the VarcharConversion utility

  1. From <AR System Install Directory path>\artools, extract the arsvarcharconvwinnt91_build001 file. The zip file contains the arsvarcharconv.bat file in the varcharconv folder.
  2. Perform either of the following actions:
    • Run arsvarcharconv.bat with arguments.
    • Run the batch file without arguments.

      The usage is displayed. When prompted for arguments, enter them on a single line; for example:
       -durl "jdbc:sqlserver://localhost:1433;databaseName=ARSystem" -du "ARAdmin" -dp "AR#Admin#" -udb -f "c:\reportfile.txt"

      Usage: arsvarcharconv         [-durl dbConnectionurl] [-du ARDBUser] [-dp ARDBPassword] No user and password needed if integrated security is used by DB.          
      Connection url should have all parameters in that case.         
      [-ddrv JDBC Driver. If not specified default jdbc driver will be used.]          
      If driver is specified make sure its in classpath.         
      [-nonunicode To be specified if AR Server installation is non-unicode         
      [-udb Update DB. If not specified only report will be generated.         
      [-f Absolute file path of report output CSV file.

A report is generated in the following format :

Report Date : 8/12/14 1:39 PM
FORMNAME,TABLENAME,TEXTFIELDS,RELATEDVIEWS
AR System Log: Server Group,T95,C6010 ,AR_System_Log__Server_Group

The values displayed in the report are separated by commas. For a formatted report, open the report in Microsoft Excel so that the values are displayed in the appropriate columns.

Note

  • The arvarcharconv.log is created in the execution folder.
  • The log levels are in the log4j.properties file for log4j.logger.artools.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*