sp_forceonline_object

Provides access to an index previously marked suspect by recovery.

Syntax

sp_forceonline_object dbname, objname, indid,
	{sa_on | sa_off | all_users} [, no_print]

Parameters

Examples

Usage

There are additional considerations when using sp_forceonline_object:
  • 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.

    Note: If the index is on systabstats or sysstatistics (the only data-only-locked system tables) call Sybase Technical Support.
  • 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.

Permissions

The permission checks for sp_forceonline_object differ based on your granular permissions settings.

SettingDescription
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.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

InformationValues
Event

38

Audit option

exec_procedure

Command or access audited

Execution of a procedure

Information in extrainfo
  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

Related reference
sp_listsuspect_object
sp_setsuspect_granularity