How To Install Job Scheduler in ASE.
Job scheduler allows DBA to create and schedule administration tasks. Since ASE
v15.0.3, lot of bugs are solved, making job scheduler to be workable. By the way,
I will suggest to heavily test it before to go in production environment!
So how to install it ?
Job scheduler is a separate external process running as an agent (JS Agent), and
an internal ASE task (JS Task) that need a specific database to run. We will need
to setup a database and create a directory services entry in interface file.
Create the database user_db:
Let’s assume the dataserver you created is named SYBPARFRUAT01_DS and
you created 2 separate devices named user_dbdat for data and user_dblog for log
segment.
Connect to the dataserver you want to install the job scheduler and create the
database user_db:
1> create database user_db on user_db_data = 100 log on
user_db_log = 25
2> go
1> sp_dboption user_db,"trunc log",true
2> go
1> sp_dboption user_db, "select into", true
2> go
1> use user_db
2> go
1> checkpoint
2> go
Then, back to Unix command line, you must run the installjsdb script located in
$SYBASE/$SYBASE_ASE/scripts, it will install the job scheduler componants
into database user_db:
isql -Usa -Ppassword -SSYBPARFRUAT01_DS -i
$SYBASE/$SYBASE_ASE/scripts/installjsdb
I previously mentionned job scheduler is a separate server process running as an
agent. So we need to create a directory services entry in interface file.
Let’s call the job scheduler server process SYBPARFRUAT01_JS.
SYBPARFRUAT01_JS
master tcp ether vm.sybnux.com 5999
query tcp ether vm.sybnux.com 5999
Now, let’s connect to the dataserver and add the job scheduler agent using
sp_addserver to create an entry in the dataserver’s sysservers table:
1> sp_addserver SYB_JSAGENT, null, SYBPARFRUAT01_JS
2> go
While executing a job, job scheduler consider all dataservers as remote
servers, including the server where Job Scheduler is installed.
Job scheduler use CIS mechanism. So to execute jobs locally, we need to create
an entry in sysservers (SYBPARFRUAT01_RPC) to alias the local dataserver
(SYBPARFRUAT01_DS):
1> sp_addserver SYBPARFRUAT01_RPC, ASEnterprise, SYBPARFRUAT01_DS
2> go
Setup job scheduler users:
To create, manage, or execute jobs and schedules, we need to create at least one
job scheduler admin account one job scheduler user account.
1> exec sp_addlogin 'jobsadm', 'password', @defdb='user_db',
@deflanguage='us_english'
2>go
1> exec sp_addlogin 'jobsusr', 'password', @defdb='pubs2',
@deflanguage='us_english'
2>go
1> use user_db
2> go
1> sp_adduser jobsadm
2> go
1> use pubs2
2> go
1> sp_adduser jobsusr
2> go
1> sp_addexternlogin
'SYBPARFRUAT01_RPC','jobsadm','jobsadm','password'
2> go
1> sp_addexternlogin
'SYBPARFRUAT01_RPC','jobsusr','jobsusr','password'
2> go
Grant the appropriate roles to logins:
1> sp_role 'grant', js_admin_role, jobsadm
2> go
1> sp_role 'grant', js_user_role, jobsadm
2> go
1> sp_role 'grant', js_user_role, jobsusr
2> go
1> sp_modifylogin jobsadm, 'add default role', js_user_role
2> go
1> sp_modifylogin jobsadm, 'add default role', js_admin_role
2> go
1> sp_modifylogin jobsusr, 'add default role', js_user_role
2> go
Activate and start the jobscheduler agent:
1> sp_configure "enable job scheduler", 1
2> go
1> use user_db
2> go
1> sp_js_wakeup "start_js", 1
2> go
You are now ready to use the jobsheduler.
To stop the jobscheduler proceed as follow:
1> use user_db
2> go
1> sp_js_wakeup "stop_js", 1
2> go
Replication Server Guide : • Replication Server Commands • ASE commands and system stored procedures • ASE RSSD stored procedures • RSSD tables • Replication Server System Functions • Troubleshooting Tips Abbreviations Some abbreviations which are used in this Quick Reference Guide: ASE Adaptive Server Enterprise DSI DataServer Interface - RS thread for a connection to a replicate database DIST Distributor - RS thread per primary database LTM Log Transfer Manager; synonym for RepAgent RS, RepServer Replication Server RepAgent Replication Agent (in primary dataserver) RepDef Replication Definition RSI Replication Server Interface - RS thread related to a route to another RepServer RSM Replication Server Manager (a DBA tool normally used in combination with Sybase Central) RSSD Replication Server System Database SQM Stable Queue Manager - RS thread managing a queue SQT Stable Queue Manager - RS thread assembling transactions Replication Server Commands The following commands can only be ...
That's a shame to cut and past articles from blog without mentionning the original source blog !
ReplyDeleteI have no issue the content of my blog to be copied as long you provide the original blog or author name......