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.
brings the database online on the assumption that the database contains no open transactions.
Makes the pubs2 database available for public use after a load sequence completes:
online database pubs2
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
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.
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 Adaptive Server. 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 Adaptive Server to a new version, all databases associated with that server are automatically upgraded.
online database only upgrades version 11.9 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 Adaptive Server. You must dump the upgraded database before you can issue a dump transaction command.
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:
Event |
Audit option |
Command or access audited |
Information in extrainfo |
---|---|---|---|
83 |
security |
online database |
|
Commands dump database, dump transaction, load database, load transaction
System procedures sp_helpdb