Loads a backup copy of a user database, including its transaction log, that was created with dump database, as well as materializes archive databases that have been loaded with a database dump.
The target platform of a load database operation need not be the same platform as the source platform where the dump database operation occurred. dump database and load database are performed from either a big endian platform to a little endian platform, or from a little endian platform to a big endian platform.
See Using Backup Server with IBM Tivoli Storage Manager for the load database syntax when the Tivoli Storage Manager is licensed at your site.
load database database_name cumulative from [compress::[compression_level::]]stripe_device [at backup_server_name] [density = density_value, blocksize = number_bytes, dumpvolume = volume_name, file = file_name] with verify only [= header | full | crc] [stripe on stripe_device [at backup_server_name] [density = density_value, blocksize = number_bytes, dumpvolume = volume_name, file = file_name] [[stripe on stripe_device [at backup_server_name] [density = density_value, blocksize = number_bytes, dumpvolume = volume_name, file = file_name]]...] [with { listonly=load_sql | create_sql, density = density_value, blocksize = number_bytes, dumpvolume = volume_name, file = file_name, [dismount | nodismount], [nounload | unload], passwd = password, until_time = datetime, notify = {client | operator_console}, [override]}]]
load database database_name from [compress::]stripe_device [at backup_server_name] [density = density_value, blocksize = number_bytes, dumpvolume = volume_name, file = file_name] [stripe on [compress::]stripe_device [at backup_server_name] [density = density_value, blocksize = number_bytes, dumpvolume = volume_name, file = file_name] [[stripe on [compress::]stripe_device [at backup_server_name] [density = density_value, blocksize = number_bytes, dumpvolume = volume_name, file = file_name]]...] [with { density = density_value, blocksize = number_bytes, dumpvolume = volume_name, file = file_name, [dismount | nodismount], [nounload | unload], passwd = password, listonly [= full], headeronly, notify = {client | operator_console}, verify[only]=crc }]]
load database database_name from dump_device [ [stripe on stripe_device] ... ] [with [norecovery,][passwd=password]
load database database_name [from stripe_device] with listonly=[load_sql | create_sql | volume]
load database database_name from syb_tsm::[[-S source_sever_name][-D source_database_name] ::]object_name [blocksize = number_bytes] [stripe on syb_tsm::[[-S source_sever_name] [-D source_database_name]::]object_name [blocksize = number_bytes]] [[stripe on syb_tsm::[[-S source_sever_name] [-D source_database_name]::]object_name [blocksize = number_bytes]]...] [with { blocksize = number_bytes, passwd = password, listonly [= full], headeronly, notify = {client | operator_console}, [[verifyonly | verify] [= header | full]] } ]
For archive databases, database_name is the name of the archive database into which you want to load.
load_sql – sequence of load database or load transaction SQL commands to perform restore to a specified point in time.
Do not use the from clause when using with listonly=load_sql; the server displays an error and the load database command does not execute.
create_sql – displays the sequence of disk init/sp_cacheconfig, disk init, create/alter database, and the create/alter database sequence from the latest dump image obtained from the backup history.
When you use with listonly=create_sql when loading a database from a stripe device, this option displays disk init/sp_cacheconfig, disk init, create, or alter database sequence from the dump image.
volume – displays volume information from the dump image.
sp_config "enable dump history" 1
After listing the files on a volume, the Backup Server sends a volume change request. The operator can either mount another tape volume or terminate the list operation for all dump devices.
Due to current implementation, the listonly option overrides the headeronly option.
Use crc to indicate that you are performing a cyclic redundancy check for accidental changes to raw data for compressed database or transaction dumps.
Type of dump (database or transaction log)
Database ID
File name
Date the dump was made
Character set
Sort order
Page count
Next object ID
On operating systems that offer an operator terminal feature, volume change messages are always sent to the operator terminal on the machine on which the Backup Server is running. Use client to route other Backup Server messages to the terminal session that initiated the dump database.
On operating systems (such as UNIX) that do not offer an operator terminal feature, messages are sent to the client that initiated the dump database. Use operator_console to route messages to the terminal on which the Backup Server is running.
load database pubs2 from "/dev/nrmt0"
load database pubs2 from "/dev/nrmt4" at REMOTE_BKP_SERVER stripe on "/dev/nrmt5" at REMOTE_BKP_SERVER stripe on "/dev/nrmt0" at REMOTE_BKP_SERVER
load database pubs2 from "compress::/opt/bin/Sybase/dumps/dmp090100.dmp"
load database key_db from "/tmp/key_db.dat" with override
load database testdb from "syb_tsm::obj1.2" stripe on "syb_tsm::obj1.2" stripe on "syb_tsm::obj1.2" stripe on "syb_tsm::obj1.2" stripe on "syb_tsm::obj1.2"
load database pubs2 from "syb_tsm::-D testdb::obj1.1"
disk init name = 'testdata1', physname='/tmp/t_dat1',size='10M' go disk init name='testdata2',physname='/tmp/t_dat2',size='10M' go disk init name='testdata3',physname='/tmp/t_dat3',size='10M' go disk init name='testlog4',physname='/tmp/t_log4',size='10M' go disk init name='testlog5',physname='/tmp/t_log5',size='10M' go create database testdb on testdata1='10M', testdata2='8M', testdata3='5M' log on testlog4='6M',testlog5 with override go alter database testdb on testdata3 = '5M' go alter database testdb log on testlog4 = '2M' go
dump database testdb to "test.dmp" go
1> load database testdb from "test.dmp" with headeronly 2> go Backup Server: 6.28.1.1: Dumpfile name 'test1025109FD6 ' section number 1 mounted on disk file '/punedbaccess3_dev3/kelkara/backupserver/test.dmp' ….. dbdevinfo: vdevno=1 devname=testdata1 path=/tmp/test1.dat db_size=10485760 device_size=20967424 dbdevinfo: vdevno=2 devname=testdata2 path=/tmp/test2.dat db_size=8388608 device_size=20967424 dbdevinfo: vdevno=3 devname=testdata3 path=/tmp/test3.dat db_size=10485760 device_size=20967424 dbdevinfo: vdevno=4 devname=testlog4 path=/tmp/test4.dat db_size=8388608 device_size=20967424 dbdevinfo: vdevno=5 devname=testlog5 path=/tmp/test5.dat db_size=6291456 device_size=20967424 …..
1> load database test from "test.dmp" with listonly=create_sql 2> go DISK INIT name = 'testdata1' , physname = '/tmp/t_dat1' , size = '10M' go DISK INIT name = 'testdata2' , physname = '/tmp/t_dat2' , size = '10M' go DISK INIT name = 'testdata3' , physname = '/tmp/t_dat3' , size = '10M' go DISK INIT name = 'testlog4' , physname = '/tmp/t_log4' , size = '10M' go DISK INIT name = 'testlog5' , physname = '/tmp/t_log5' , size = '10M' go CREATE DATABASE testdb ON testdata1 = '10M' , testdata2 = '8M' , testdata3 = '5M' LOG ON testlog4 = '6M' , testlog5 = '6M' go ALTER DATABASE testdb ON testdata3 = '5M' LOG ON testlog4 = '2M' go
1> load database testdb with listonly=load_sql 2> go LOAD DATABASE testdb FROM '/dumpdir/testdb_DB_1.1.dmp' STRIPE ON '/dumpdir/testdb_DB_1.2.dmp' STRIPE ON '/dumpdir/testdb_DB_1.3.dmp' go LOAD TRANSACTION testdb FROM '/dumpdir/testdb_XACT_2.dmp' go LOAD TRANSACTION testdb FROM '/dumpdir/testdb_XACT_3.dmp' go LOAD TRANSACTION testdb FROM '/dumpdir/testdb_XACT_4.1.dmp' STRIPE ON '/dumpdir/testdb_XACT_4.2.dmp' go
load database new_dump from mydumpdev with verify[only]=crc
If you use sp_hidetext followed by a cross-platform dump and load, you must manually drop and re-create all hidden objects.
The listonly and headeronly options display information about the dump files without loading them.
If you run load database ... listonly=create_sql from a database dump that includes a shrunken log device, the SAP ASE server may list an unknown device in the create database command. You can eliminate this unknown device from the create database command if you include the shrunken log device is on the last mapped segment and issue dump database ... with shrink_log.
Dumps and loads are performed through Backup Server.
To make sure databases are synchronized correctly so that all proxy tables have the correct schema to the content of the primary database you just reloaded, you may need to run the alter database dbname for proxy_update command on the server hosting the proxy database.
Backing Up and Restoring User Databases in the System Administration Guide.
sp_helpdb, sp_helpdevice, sp_hidetext, sp_volchanged in Reference Manual: Procedures
ANSI SQL – Compliance level: Transact-SQL extension.
The permission checks for load database differ based on your granular permissions settings.
Setting | Description |
---|---|
Enabled | With granular permissions enabled, you must be the database owner, or a user with load database privilege or own database privilege on the database. |
Disabled | With granular permissions disabled, you must be the database owner, or a user with
any of these roles:
|
Values in event and extrainfo columns of sysaudits are:
Information | Values |
---|---|
Event | 43 |
Audit option | load |
Command or access audited | load database |
Information in extrainfo |
|