sp_forceonline_db

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

Examples

Usage

There are additional considerations when using sp_forceonline_db:
  • A page that is forced online is not necessarily repaired. Corrupt pages can also be forced online. The SAP ASE server does not perform any consistency checks on pages that are forced online.

  • sp_forceonline_page with all users cannot be reversed. When pages have been brought online for all users, you cannot take them offline again.

  • sp_forceonline_db cannot be used in a transaction.

  • To bring only specific offline pages online, use sp_forceonline_page.

Permissions

The permission checks for sp_forceonline_db 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_forceonline_page
sp_listsuspect_db
sp_listsuspect_page
sp_setsuspect_granularity
sp_setsuspect_threshold