Enables you to bring an engine online or offline. In threaded mode, use alter thread pool to bring engines online.
sp_engine {“online” | [offline | can_offline] [, engine_id] | [“shutdown”, engine_id]}
In threaded mode, online increases the thread count for syb_default_pool by 1.
In threaded mode, offline decreases the thread count for syb_default_pool by 1.
In threaded mode, can_offline succeeds only if the total number of engines is less than the total number of threads in syb_default_pool and the total number of threads in syb_default_pool is greater than or equal to 2.
This parameter is ignored in threaded mode.
sp_engine "online", 1
02:00000:00000:2001/10/26 08:53:40.61 kernel Network and device connection limit is 3042. 02:00000:00000:2001/10/26 08:53:40.61 kernel SSL Plus security modules loaded successfully. 02:00000:00000:2001/10/26 08:53:40.67 kernel engine 2, os pid 8624 online 02:00000:00000:2001/10/26 08:53:40.67 kernel Enabling Sun Kernel asynchronous disk I/O strategy 00:00000:00000:2001/10/26 08:53:40.70 kernel ncheck: Network fc0330c8 online
select engine, status from sysengines
engine status ------ ------ 0 online 1 online 2 online 3 online
sp_engine offline, 1
The following task(s) will affect the offline process: spid: 19 has outstanding ct-lib connections.
select engine, status from sysengines
engine status ------ ------ 0 online 1 in offline 2 online 3 online
02:00000:00000:2001/10/26 09:02:09.05 kernel engine 1, os pid 8623 offline
sp_engine can_offline, 1
sp_engine offline, 1
01:00000:00000:2001/11/09 16:11:11.85 kernel Engine 1 waiting for affinitated process(es) before going offline 01:00000:00000:2001/11/09 16:11:11.85 kernel Process 917518 is preventing engine 1 going offline 00:00000:00000:2001/11/09 16:16:01.90 kernel engine 1, os pid 21127 offline
sp_engine shutdown, 1
As sp_engine works only in process mode, the SAP ASE server issues an error message if you run sp_engine in threaded mode. Use alter thread pool in threaded mode.
You cannot take offline or shut down engine 0.
select engine, status from sysengines where status = "online"
online and shutdown are keywords and must be enclosed in quotes.
Engines can be brought online only if max online engines is greater than the current number of engines with an online status, and if enough CPU is available to support the additional engine.
sp_engine can run in sessions using chained transaction mode if there are no open transactions.
An engine offline command may fail or may not immediately take effect if there are server processes with an affinity to that engine.
The permission checks for sp_engine differ based on your granular permissions settings.
Setting | Description |
---|---|
Enabled | With granular permissions enabled, you must be a user with manage server privilege. |
Disabled | With granular permissions disabled, you must be a user with sa_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 |
|