Provides access to an index previously marked suspect by recovery.
sp_forceonline_object dbname, objname, indid, {sa_on | sa_off | all_users} [, no_print]
sp_forceonline_object pubs2, titles, 3 , sa_on
sp_forceonline_object pubs2, titles, 3, sa_off
sp_forceonline_object pubs2, titles, 3, all_users
If an index on a data-only-locked table has suspect pages, the entire index is taken offline during recovery. Offline indexes are not considered by the query optimizer. Indexes on allpages-locked tables are not taken completely offline during recovery; only individual pages of these indexes are taken offline. Use sp_forceonline_page to bring these pages online.
Use sp_listsuspect_object to see a list of databases that are offline.
To repair a suspect index, use sp_forceonline_object with sa_on access. Then, drop and re-create the index.
sp_forceonline_object with all_users cannot be reversed. When an index has been brought online for all users, you cannot take it offline again.
An index that is forced online is not necessarily repaired, as corrupt indexes can be forced online. The SAP ASE server does not perform any consistency checks on indexes that are forced online.
sp_forceonline_object cannot be used in a transaction.
sp_forceonline_object works only for databases in which the recovery fault isolation mode is “page.” Use sp_setsuspect_granularity to display the recovery fault isolation mode for a database.
To bring all of a database’s offline pages and indexes online in a single command, use sp_forceonline_db.
For more information on recovery fault isolation, see the System Administration Guide.
The permission checks for sp_forceonline_object differ based on your granular permissions settings.
Setting | Description |
---|---|
Enabled | With granular permissions enabled, you must be the database owner or a user with own database 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 |
|