To restore a backup to a raw device, the device must be large enough to hold both the dbspace and the space reserved for the operating system.
SELECT segment_type, file_name, block_count, data_offset, block_size, (block_count * block_size) + data_offset AS raw_size FROM SYS.SYSIQFILE, SYS.SYSIQINFO where segment_type !='Msg' ORDER BY 1,2
segment_type file_name block_count data_offset block_size raw_size Main iqdemo.iq 12800 65536 8192 104923136 Main iqdemo_main.iq 2800 65536 8192 104923136 Temp iqdemo.iqtmp 3200 65536 8192 26279936
Column Name | Description |
---|---|
segment_type |
Main or Temp segments, but not message files (type Msg). |
file_name |
Dbspace name. |
block_count |
Number of blocks in use. |
data_offset |
Number of bytes reserved for the operating system. |
block_size |
Number of bytes per block. |
raw_size |
Minimum raw device size, in bytes required to restore the dbspace. The target device must be at least 10MB larger than the original raw device. |
BACKUP DATABASE TO '/dev/rmt/0n' TO '/dev/rmt/1n' WITH COMMENT 'Jan 18 full backup of iquser'The catalog store is backed up first, to /dev/rmt/0n. The IQ store is backed up next, to both tapes.
RESTORE DATABASE 'iquser' FROM '/dev/rmt/0n' FROM '/dev/rmt/1n' RENAME IQ_SYSTEM_MAIN TO '/dev/rdsk/c2t0d1s1' RENAME IQ_SYSTEM_TEMP TO '/dev/rdsk/c2t1d1s1' RENAME IQ_SYSTEM_MSG TO 'iquser.iqmsg' RENAME IQ_USER TO '/dev/rdsk/c1t5d2s1'You can also issue these commands using only the last RENAME clause, since only one dbspace is being restored to a new location. Listing all of the files or raw partitions, as shown here, ensures that you know exactly where each will be restored.