Queries, utilities, and procedures return information about the tablespaces, dbspaces, and dbfiles in your database.
SELECT dbf.dbfile_name, f.* FROM SYSFILE f, SYSDBFILE dbf WHERE f.file_id=dbf.dbfile_id
dbfile_name file_id file_name dbspace_name store_type lob_map dbspace_id ------------------- ------- ----------------------------------- -------------- ---------- -------- ---------- system 0 /dev/rdsk/SybaseIQ/demo/iqdemo.db system 1 (NULL) 0 temporary 15 /temp/sqla0000.tmp temporary 1 (NULL) 15 IQ_SYSTEM_MAIN 16384 iqdemo.iq IQ_SYSTEM_MAIN 2 (NULL) 16384 IQ_SYSTEM_TEMP 16385 iqdemo.iqtmp IQ_SYSTEM_TEMP 2 (NULL) 16385 IQ_SYSTEM_MSG 16386 iqdemo.iqmsg IQ_SYSTEM_MSG 2 (NULL) 16386 iq_main 16387 iqdemo_main.iq iq_main 2 (NULL) 16387The file_name column in the SYSFILE system table for the SYSTEM dbspace is not updated during a restore. For the SYSTEM dbspace, the file_name column always reflects the name when the database was created. The file name of the SYSTEM dbspace is the name of the database file.
See Reference: Building Blocks, Tables, and Procedures > System Tables and Views > System View > Alphabetical List of System Views > SYSDBFILE System View.
Reads the first backup archive, returns backup statistics and definitions.
db_backupheader [ path ] backup_filedb_backupheader is a command line utility. Output includes backup statistics, database definitions, and dbspace and dbfile specifics.
Returns details about each dbspace.
sp_iqdbspace [ dbspace-name ]
Results are
similar to
this:DBSpaceName DBSpaceType Writable Online Usage TotalSize Reserve NumFiles NumRWFiles Stripingon StripeSize BlkTypes OkToDrop ---------------- ------------ -------- ------ ----- --------- ------- -------- ----------- ---------- ---------- ----------------- -------- iq_main MAIN T T 26 100M 200M 1 1 T 1K 1H,3254A N IQ_SYSTEM_MAIN MAIN T T 22 100M 200M 1 1 T 1K 1H,2528F,32D,128M N IQ_SYSTEM_TEMP TEMPORARY T T 3 25M 200M 1 1 T 1K 1H,64F,16A NSee Reference: Building Blocks, Tables, and Procedures > System Procedures > Alphabetical List of System Stored Procedures > sp_iqdbspace Procedure for column definitions.
Returns details about the dbfiles in a dbspace.
sp_iqfile [ dbspace-name ]
Results
are similar to
this:DBSpaceName DBFileName Path SegmentType RWMode Online Usage DBFileSize Reserve StripeSize BlkTypes FirstBlk LastBlk OkToDrop --------------- ---------------- -------------- ---------- ------ ------ ----- ---------- ------- ---------- ------------------ --------- -------- --------- IQ_SYSTEM_MAIN IQ_SYSTEM_MAIN iqdemo.iq MAIN RW T 22 100M 200M 1K 1H,2528F,32D,128M 1 12800 N iq_main iq_main iqdemo_main.iq MAIN RW T 26 100M 200M 1K 1H,3254A 1045440 1058239 N IQ_SYSTEM_TEMP IQ_SYSTEM_TEMP iqdemo.iqtmp TEMPORARY RW T 3 25M 200M 1K 1H,64F,16A 1 3200 NSee Reference: Building Blocks, Tables, and Procedures > System Procedures > Alphabetical List of System Stored Procedures > sp_iqfile Procedure.
-- Get dbspace and IQ file names and add -- rename syntax including quotation marks select 'rename' as 'restore ... rename' , dbf.dbfile_name as 'IQ file' , 'to' as 'to' , '''' + f.file_name + '''' as 'file_path' from SYSFILE f, SYSDBFILE dbf where f.store_type=2 and f.file_id=dbf.dbfile_id -- Send output to a file in proper format -- without delimiters or extra quotation marks output to restore.tst delimited by '' quote ''; -- This produces a restore.tst file like the following: -- rename IQ_SYSTEM_MAIN to '/dev/rdsk/c2t0d1s7' -- rename IQ_SYSTEM_TEMP to '/dev/rdsk/c2t1d1s7' -- rename IQ_SYSTEM_MSG to 'all_types.iqmsg'