Upgrading Job Scheduler Templates

After upgrading to the new server, upgrade the templates and jobs created by Job Scheduler.

Note: Several changes impact the Job Scheduler templates. These changes make some templates incompatible with earlier versions of the server. The current templates are version 3.0 in the XML files.
  1. Disable Job Scheduler.
  2. Update any environment variables, scripts, or applications that refer to the Job Scheduler directory path. The Job Scheduler directory is under the ASE-16_0 directory, in $SYBASE/$SYBASE_ASE/jobscheduler .

    Directories below jobscheduler remain the same.

  3. Copy files from the jobscheduler directory to the ASE-16_0 directory. If you are installing the new server directories over the old server directories, the installer automatically moves your files to the new jobscheduler directory.
  4. If you modified SAP-supplied templates, stored procedures, or XML documents, do not overlay the new templates with your modified versions. If you do, you lose the enhancements provided by the revised templates. Carefully merge your template changes into the SAP template files, or better yet, rename your modified templates.
  5. 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 must make to the SQL code in the jobs created from the templates.
    Changed Job Scheduler Templates
    Template Modified Files Datatype for <parameter> Changed from varchar(5) to int
    dump database

    jst_dump_databases

    @use_srvr_name
    dump database log

    jst_dump_log

    @truncate_flag and @use_srvr_name
    update statistics

    jst_update_statistics

    @index_flag
    rebuild indexes

    jst_reorg_rebuild_indexes

    @dump_flag
    rebuild table

    jst_reorg_rebuild_tables

    @dump_flag
    reclaim indexes

    jst_reclaim_index_spac

    @dump_flag
    reclaim tables

    jst_reclaim_table_space

    @resume_flag
  6. Some Job Scheduler templates have been modified to support new server functionality. These changes are related to new parameters for specifying a partition name, or a data change value for the new server commands that added these options. If you have jobs created from any of the enhanced templates, modify the SQL of the jobs for the 16.0 servers.

    If you have a job scheduled to run on a pre-16.0 server and you need it to also run on 16.0 servers, leave the existing job alone and create a new job for 15.7 ESD #2 servers, as the job commands are different.

    You need not modify any jobs you run on pre-16.0 servers. The following table lists the templates that changed in version 3.0 and the changes you must make to jobs created from them.

    Note: All templates listed below, except delete statistics, are incompatible with pre-15.0.1 servers. Do not use them to create jobs that are scheduled on pre-15.0.1 servers; you must use the 2.1 or 2.2 versions for pre-15.0.1 servers.
    Modified Job Scheduler Templates
    Template Modified File Change Description Job Modifications
    delete statistics

    jst_delete_statistics

    Added @ptn_name as third parameter. Optional.
    update statistics

    jst_update_statistics

    Added @ptn_name as fifth parameter, @datachg_threshold as the 10th parameter, and added reference. Required. Include values (or NULL) for new parameters.
    rebuild indexes

    jst_reorg_rebuild_indexes

    Added @ndx_ptn_name as third parameter. Required. Include value (or NULL) for new parameter.
    reclaim indexes

    jst_reclaim_index_space

    Added @ptn_name as third parameter. Required. Include value (or NULL) for new parameter.
    reclaim tables

    jst_reclaim_table_space

    Added @ptn_name as second parameter. Required. 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.
  7. Install the template stored procedures and and move them to the Job Scheduler template stored procedure directory. For example:
    cd $SYBASE/$SYBASE_ASE/jobscheduler/Templates/sprocs

    Run the stored procedure installation script for each server being upgraded:

    installTemplateProcs <servername> <username> <password>
    Note: Upgrade template stored procedures on all Job Scheduler servers and target servers that are upgraded to SAP ASE version 16.0. Do not install them on pre-15.5 servers.
  8. Install and move the template XML documents into the JS template XML directory. For example:
    cd $SYBASE/$SYBASE_ASE/jobscheduler/Templates/xml
  9. Before running the installTemplateXml XML installation script, set the SYBASE_ASE_SA_USER environment variable and SYBASE_ASE_SA_PWD variable in the SYBASE.csh file before running the XML installation script:
  10. Run the XML installation script on 15.0.1 servers with Job Scheduler installed:
    installTemplateXml servername machinename serverport
        username password [language_code]
    Use "en" for the language_code or omit the parameter completely, as "en" is the default.
    Note: Upgrade template XML documents on all Job Scheduler servers upgraded to SAP ASE version 15.0.1. Do not install them on pre-15.0.1 servers or servers where Job Scheduler is not installed.