Upgrading Job Scheduler templates

After upgrading to the new Adaptive Server, perform the following steps to upgrade templates and jobs created from Job Scheduler templates.

NoteFor the Adaptive Server version 15.0 release, there are several changes that impact Job Scheduler templates. These changes make some templates incompatible with earlier versions of Adaptive Server. These templates are version 3.0 in the XML files.

StepsUpgrading Job Scheduler templates

  1. Update any environment variables, scripts, or applications that refer to the Job Scheduler directory path. The Job Scheduler directory has been renamed and moved beneath the ASE-15_0 directory. New location is $SYBASE/$SYBASE_ASE/jobscheduler.

    Directories below jobscheduler remain the same.

  2. If you have any of your own files in the old Job Scheduler directory, copy them to the new 15.0 directory. If you are installing Adaptive Server over the old server directories, the installer will have moved your files to the new jobscheduler directory already.

  3. If you have modified any of the Sybase-supplied templates stored procedures or XML documents, do not overlay the new templates with your versions. If you do, you will lose the enhancements provided by the revised templates. Carefully merge your template changes into the Sybase template files, or better yet, rename your modified templates.

    NoteSybase recommends that if you modify Sybase-supplied templates that you save the changes under new names and in new files.

  4. You may need to make minor modifications to jobs you created from 2.0 or earlier templates. In some templates, parameters changed from varchar(5) to int. The following table lists the templates that changed in version 2.1 and the changes you need to make to jobs created from them.

    Table 5-2: Changed Job Scheduler templates

    Template

    Modified files

    Change description

    Modify jobs created from this template

    dump database

    SybBackupDbToDiskTemplate.xml

    jst_dump_databases

    Changed the datatype for the @use_srvr_name parameter from varchar(5) to int

    Required, modify job SQL to change @use_srvr_name to int datatype.

    dump database log

    SybBackupLogToDiskTemplate.xml

    jst_dump_log

    Changed the datatype for the @truncate_flag and @use_srvr_name parameters from varchar(5) to int

    Required, modify job SQL to change @truncate_flag and @use_srvr_name to int datatype.

    update statistics

    SybUpdateStatsTemplate.xml

    jst_update_statistics

    Changed the datatype for the @index_flag parameter from varchar(5) to int

    Required, modify job SQL to change @index_flag to int datatype.

    rebuild indexes

    SybRebuildIndexTemplate.xml

    jst_reorg_rebuild_indexes

    Changed the datatype for the @dump_flag parameter from varchar(5) to int

    Required, modify job SQL to change @dump_flag to int datatype.

    rebuild table

    SybRebuildTableTemplate.xml

    jst_reorg_rebuild_tables

    Changed the datatype for the @dump_flag parameter from varchar(5) to int

    Required, modify job SQL to change @dump_flag to int datatype.

    reclaim indexes

    SybReclaimIndexTemplate.xml

    jst_reclaim_index_spac

    Required, modify job SQL to change @dump_flag to int datatype.

    Required, modify job SQL to change @resume_flag to int datatype.

    reclaim tables

    SybReclaimTableTemplate.xml

    jst_reclaim_table_space

    Changed the datatype for the @resume_flag parameter from varchar(5) to int

    Required, modify job SQL to change @resume_flag to int datatype.

  5. Some Job Scheduler templates were modified to support new 15.0 Adaptive Server functionality. The changes are related to new parameters for specifying a partition name or a datachange value for the Adaptive Server command that have added these options. If you have jobs created from any of the enhanced templates, modify the SQL of the jobs for 15.0 servers.

    NoteIf you have a job scheduled to run on a pre-15.0 server and you need it to run on 15.0 servers too, leave the existing job alone and create a new job for 15.0 servers as the job commands will be different.

    Jobs intended to run on pre-15.0 servers do not need to be modified. The following table lists the templates that changed in version 3.0 and the changes you need to make to jobs created from them.

    Note All templates listed below, except Delete Statistics, are incompatible with pre-15.0 servers. Do not use them to create jobs that will be scheduled on pre-15.0 servers; you must use the 2.1 or 2.2 versions for pre-15.0 servers.

    Table 5-3:

    Template

    Modified file

    Change description

    Modify jobs created from this template

    delete statistics

    SybDeleteStatsTemplate.xml

    jst_delete_statistics

    Added @ptn_name as third parameter.

    Optional.

    update statistics

    SybUpdateStatsTemplate.xml

    jst_update_statistics

    Added @ptn_name as fifth parameter and @datachg_threshold as the 10th parameter and added reference

    Required, modify job SQL to include values (or NULL) for new parameters

    rebuild indexes

    SybRebuildIndexTemplate.xml

    jst_reorg_rebuild_indexes

    Added @ndx_ptn_name as third parameter.

    Required, modify job SQL to include value (or NULL) for new parameter

    reclaim indexes

    SybReclaimIndexTemplate.xml

    jst_reclaim_index_space

    Added @ptn_name as third parameter

    Required, modify job SQLto include value (or NULL) for new parameter

    reclaim tables

    SybReclaimTableTemplate.xml

    jst_reclaim_table_space

    Added @ptn_name as second parameter

    Required, modify job SQL to include value (or NULL)for new parameter

    multiple

    jst_get_freespace,jst_get_usedspace

    Replace reserved_pgs and data_pgs with reserved_pages and data_pages

    No impact on job SQL

  6. Install the Template stored procedures.

    NoteTemplate stored procedures should be upgraded on all Job Scheduler servers and target servers upgraded to Adaptive Server version 15.0. Do not install them on pre-15.0 servers.

    1. Move to the JS template stored procedure directory. For example:

      cd $SYBASE/$SYBASE_ASE/jobscheduler/Templates/sprocs
      
    2. Run the stored procedure install script for each server being upgraded:

      installTemplateProcs <servername> <username><password>
      
  7. Install the template XML documents.

    NoteTemplate XML should be upgraded on all Job Scheduler servers upgraded to Adaptive Server version 15.0. Do not install them on pre-15.0 servers or servers where Job Scheduler is not installed.

    1. Move to the JS template XML directory. For example:

      cd $SYBASE/$SYBASE_ASE/jobscheduler/Templates/xml 
      
    2. Run the XML install script on 15.0 servers with Job Scheduler installed:

      installTemplateXml <servername> <machinename> <serverport>
          <username> <password> [<language_code>]
      

      Use “en” for the language_code or you may omit the parameter completely as “en” is the default.