Adds a named time range to an SAP ASE server.
sp_add_time_range name, startday, endday, starttime, endtime
"HH:MM"
"HH:MM"
The endtime must occur later in the day than the starttime, unless endtime is “00:00”.
sp_add_time_range business_hours, monday, Friday, "09:00", "17:00"
sp_add_time_range before_hours, Monday, Friday, "00:00", "09:00"
sp_add_time_range after_hours, Monday, Friday, "18:00", "00:00"
sp_add_time_range weekends, Saturday, Sunday, "00:00", "00:00"
sp_add_time_range Fri_thru_Mon, Friday, Monday, "09:00", "17:00"
sp_add_time_range Wednesday_night, Wednesday, Wednesday, "17:00", "00:00"
The SAP ASE server includes one named time range, the “at all times” time range. This time range covers all times, from the first day through the last of the week, from 00:00 through 23:59. It cannot be modified or deleted.
The SAP ASE server generates a unique ID number for each named time range and inserts it into the systimeranges system table,
When storing a time range in the systimeranges system table, the SAP ASE server converts its startday and endday values into integers. For servers with a default language of us_english, the week begins on Monday (day 1) and ends on Sunday (day 7).
You can create a time range that overlaps with one or more other time ranges.
Range days are contiguous, so the days of the week can wrap around the end to the beginning of the week. In other words, Sunday and Monday are contiguous days, as are Tuesday and Wednesday.
The active time ranges are bound to a session at the beginning of each query batch. A change in the server’s active time ranges due to a change in actual time has no effect on a session during the processing of a query batch. In other words, if a resource limit restricts a query batch during a given time range but a query batch begins before that time range becomes active, the query batch that is already running is not affected by the resource limit.
The addition, modification, and deletion of time ranges using the system procedures does not affect the active time ranges for sessions currently in progress.
If a resource limit has a transaction as its scope, and a change occurs in the server’s active time ranges while a transaction is running, the newly active time range does not affect the transaction currently in progress.
Changes to a resource limit that has a transaction as its scope does not affect any transactions currently in progress.
For more information on time ranges, see the System Administration Guide.
The permission checks for sp_add_time_range differ based on your granular permissions settings.
Setting | Description |
---|---|
Enabled | With granular permissions enabled, you must be a user with manage resource limit privilege. |
Disabled | With granular permissions disabled, you must be a user with sso_role. |
Values in event and extrainfo columns from the sysaudits table are:
Information | Values |
---|---|
Event | 38 |
Audit option | exec_procedure |
Command or access audited | Execution of a procedure |
Information in extrainfo |
|