online database


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.


online database database_name [for standby_access]



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.


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


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.


ANSI SQL – Compliance level: Transact-SQL extension.


Only a system administrator, database owner, or user with the Operator role can execute online database.


Values in event and extrainfo columns of sysaudits are:


Audit option

Command or access audited

Information in extrainfo



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 is in effect

See also

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

System procedures sp_helpdb