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 SAP ASE; 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]




  • online database brings a database online for general use after a normal database or transaction log load sequence.

  • When load database is issued, the database’s status is set to “offline.” The offline status is set in the sysdatabases system table and remains set until online database completes.

  • Do not issue online database until all transaction logs are loaded. The command sequence is:
    • load database

    • load transaction (there may be more than one load transaction)

    • online database

  • If you execute online database against a currently online database, no processing occurs and no error messages are generated.

  • You can only use online database...for standby_access with a transaction log that was dumped using dump transaction...with standby_access. If you use online database...for standby_access after loading a transaction log that was dumped without using dump transaction...with standby access, online database generates an error message and fails.

  • You can use sp_helpdb to find out whether a database is currently online, online for standby access, or offline.

When upgrading databases:
  • online database initiates, if needed, the upgrade of a loaded database and transaction log dumps to make the database compatible with the current version of SAP ASE. After the upgrade completes, the database is made available for public use. If errors occur during processing, the database remains offline.

  • online database is required only after a database or transaction log load sequence. It is not required for new installations or upgrades. When you upgrade SAP ASE to a new version, all databases associated with that server are automatically upgraded.

  • online database upgrades only version 12.5.4 or later user databases.

  • After you upgrade a database with online database, dump the newly upgraded database to create a dump that is consistent with the current version of SAP ASE. You must dump the upgraded database before you can issue a dump transaction command.

For 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.

See also sp_helpdb in Reference Manual: Procedures.


ANSI SQL – Compliance level: Transact-SQL extension.


The permission checks for online database differ based on your granular permissions settings.


With granular permissions enabled, you must be the database owner, or a user with online database privilege or own database privilege on the database.

With granular permissions disabled, you must be the database owner, or a user with any of these roles:
  • sa_role, or,

  • replication_role, or,

  • oper_role


Values in event and extrainfo columns of sysaudits are:



Audit option


Command or access audited

online database

Information in extrainfo
  • 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

Related reference
dump database
dump transaction
load database
load transaction