Creates a schedule to execute shell commands at a time you specify.
[mm] [HH] [DOM] [MON] [DOW]
The time and date parameters are:
Parameter |
Description |
Values |
---|---|---|
mm |
Minutes past the hour |
0 – 59. Use “*” to include all legal values. |
HH |
Hour in 24-hour notation |
0 – 23. Use “*” to include all legal values. |
DOM |
Day of the month |
1 – 31. Use “*” to include all days of the month. |
MON |
Month of the year |
1 – 12. Use “*” to include all months of the year. |
DOW |
Day of the week |
0 – 6 with 0=Sunday. Use “*” to include all days of the week. |
Use an asterisk “*” to specify all valid values. For example, “17 20 * * *” represents a daily schedule at 8:17 p.m.
Use a comma “,” to separate values that are not part of a range. For example, “17 20 1,15 * *” represents 8:17 p.m. on the 1st and 15th of every month, where 1 and 15 are the values for the DOM parameter.
Use a hyphen “-” between two values to specify a range of values, inclusive of the two values. For example, “17 20 * * 1-5” represents 8:17 p.m. from Monday to Friday where “1-5” are the range of values for the DOW parameter.
For the DOM, MON, or DOW parameters, you can specify the day using both the DOM and DOW parameters. Replication Server follows all schedules you specify in the string. For example, “0 12 16 * 1” represents 12:00 p.m.every Monday and 12:00 p.m. on the 16th of every month.
Shell commands:
Must be in $SYBASE/$SYBASE_REP/sched for UNIX or %SYBASE%\%SYBASE_REP%\sched for Windows
Can include parameters delimited with a space within the shell command.
In Windows, create schedule executes the command specified in the last parameter within the shell command or batch file. You must also include stdout to a file in the create schedule command line.
In shell command names, you:
Can use only ASCII alphanumeric characters, such as A – Z, a – z, and 0 – 9
Can use the “.”, “-”, and “_” characters
Cannot use the “\” and “/” characters
Must include the .bat suffix if you are executing on Windows. For example, the name should be suspend_conn.bat on Windows and suspend_conn.sh on UNIX.
Create a text file, such as sql.txt that contains the actual Replication Server command line that you want to schedule. For example, sql.txt can contain
suspend connection to SYDNEY_DS.pubs2 go
Create a batch file, such as suspend_conn.bat in Windows that contains isql and relevant parameters to run the command line in sql.txt. For example, suspend_conn.bat can contain:
%SYBASE%\OCS-15_0\bin\isql.exe -Usa -P -S SYDNEY_DS -I %SYBASE%\sql.ini -i %SYBASE%\REP-15_5\sched\sql.txt
Create the schedule, “schedule1”:
create schedule schedule1 as ‘0 12 16 * 1’ for exec ‘test.bat > c:\temp\test.out’ go
create schedule schedule2 as ‘17 20 * * *’ for exec ‘suspend_conn.sh’
create schedule schedule2 as '15 7 * * *' for exec ‘resume_conn.sh’
Schedule the time you want to perform replication tasks – to report, for example, on a specific state of the replicate database while the replicate database is frozen and not receiving data from the primary database.
You can schedule replication to happen only during specific night hours, so that the processing of the next day does not change the replicate database, and reporting can occur on the data of the day before, that is frozen in the replicate database. You can do this by creating schedules to suspend and resume connections to the replicate database at specific times of the day.