Configuring Adaptive Server to run sp_opt_querystats

  1. Install the Job Scheduler. See the Job Scheduler Users Guide.

    NoteThis may require that you restart Adaptive Server.

  2. If Adaptive Server is unnamed, set the server name then restart Adaptive Server:

    sp_addserver server_name, local
    
  3. Any login that runs sp_opt_querystats must have the js_user_role role, and must use a non-Null password to log in to Adaptive Server.

    sp_opt_querystats require the sa_role:

    grant role role_name to login_name 
    
  4. Create an external login on the loopback server for all users who run sp_opt_querystats:

    sp_addexternlogin loopback, <login>, <password>, <password>
    
  5. Sybase recommends that you set the value for maximum job output to 1000000 to ensure that Job Scheduler can capture all diagnostic output for your queries.

    NoteIf sp_opt_querystats truncates the output, increase the value for maximum job output. Increasing this value consumes no additional resources.