sp_forceonline_object

Description

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

dbname

is the name of the database containing the index to be brought online.

objname

is the name of the table.

indid

is the index ID of the suspect index being brought online.

sa_on

allows only users with the sa_role to access the specified index.

sa_off

revokes access privileges created by a previous invocation of sp_forceonline_object with sa_on.

all_users

allows all users to access the specified index.

no_print

skips printing a list of other suspect objects after the specified object is brought online.

Examples

Example 1

Allows a system administrator to access the index with indid 3 on the titles table in the pubs2 database:

sp_forceonline_object pubs2, titles, 3 , sa_on

Example 2

Revokes access to the index from the system administrator. Now, no one has access to this index:

sp_forceonline_object pubs2, titles, 3, sa_off

Example 3

Allows all users to access the index on the titles table in the pubs2 database:

sp_forceonline_object pubs2, titles, 3, all_users

Usage

Permissions

Only a system administrator can execute sp_forceonline_object.

Auditing

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

Event

Audit option

Command or access audited

Information in extrainfo

38

exec_procedure

Execution of a procedure

  • 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

See also

Documents For more information on recovery fault isolation, see the System Administration Guide.

System procedures sp_listsuspect_object, sp_setsuspect_granularity