online database

Description

Marks a database available for public use after a normal load sequence; if needed, upgrades a loaded database to the current version of Adaptive Server; brings a database online after loading a transaction log dumped with the for standby_access option. You can also use online database to bring an archive database online.

Syntax

online database database_name [for standby_access]

Parameters

database_name

specifies the name of the database to be brought online.

for standby_access

brings the database online on the assumption that the database contains no open transactions.

Examples

Example 1

Makes the pubs2 database available for public use after a load sequence completes:

online database pubs2

Example 2

Brings the database inventory_db online. Used after loading inventory_db with a transaction-log dump obtained through dump tran...with standby_access:

online database inventory_db for standby_access

Usage


Upgrading databases


Archive databases

The online database database_name command performs undo recovery during which modified and allocated pages may be remapped to the modified pages section.

You do not need to bring a database online if it has been loaded with norecovery, since the load automatically brings the database online without running the recovery undo pass.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Only a System Administrator, Database Owner, or user with the Operator role can execute online database.

Auditing

Values in event and extrainfo columns of sysaudits are:

Event

Audit option

Command or access audited

Information in extrainfo

83

security

online database

  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – NULL

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

See also

Commands dump database, dump transaction, load database, load transaction

System procedures sp_helpdb