sp_forceonline_db

Description

Provides access to all the pages in a database that were previously marked suspect by recovery.

Syntax

sp_forceonline_db dbname, 
	{"sa_on" | "sa_off" | "all_users"}

Parameters

dbname

is the name of the database to be brought online.

sa_on

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

sa_off

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

all users

allows all users access to the specified page.

Examples

Example 1

Allows the System Administrator access to all suspect pages in the pubs2 database:

sp_forceonline_db pubs2, "sa_on"

Example 2

Revokes access to all suspect pages in the pubs2 database from the System Administrator. Now, no one can access the suspect pages in pubs2:

sp_forceonline_db pubs2, "sa_off"

Example 3

Allows all users access to all pages in the pubs2 database:

sp_forceonline_db pubs2, "all_users"

Usage

Permissions

Only a System Administrator can execute sp_forceonline_db.

See also

System procedures sp_forceonline_page, sp_listsuspect_db, sp_listsuspect_page, sp_setsuspect_granularity, sp_setsuspect_threshold