DBSpace Header utility (iqheader) [CR 427630]

The dbspace management enhancements added in Sybase IQ 12.6 allowed users to view an IQ server dbspace configuration from a connected user. At times, an administrator might want to determine which server, if any, is using a particular LUN/device/file as a dbspace in order to analyze disk usage or to configure a multiplex query server.

In ESD #1, the iqheader utility reports the configuration of an arbitrary device regardless of whether it is currently in use by an IQ server.

The user interface is a standalone console application called iqheader (header.exe on Windows). The iqheader tool searches the device for a IQ dbspace header and reports the header information in a user-readable format.

NoteLUN is a Logical Unit Number and is used to identify SCSI devices so the host can address and access the data on each disk drive in an array.

Syntax

iqheader [ [ dbspace_path ] 

Parameters

The iqheader application takes a single parameter, which is the device to be checked.

Usage

iqheader usage When invoked with no parameters, a usage summary is reported and a non-zero status is returned:

>iqheader
Usage: iqheader [dbspace_path]

iqheader error When the specified target is not an IQ dbspace, an error message is reported and a non-zero status is returned:

>iqheader /dev/null
Not an IQ file: Error 0

Operating system errors When the specified target is unreadable or any file operation fails due to an error returned from the operating system, the native operating system error displays and a non-zero status is returned.

>iqheader /dev/rdsk/c1t32d0s1              <
Open Failed: No such file or directory

>iqheader /dev/rdsk/c1t3d0s1               <
Open Failed: Permission denied

iqheader output When a valid IQ dbspace is specified, iqheader prints the dbspace configuration to the console and returns a 0 exit status. Table 3 describes the fields in the iqheader output.

Table 3: iqheader output

Field

Description

Full Path

Full path after symbolic link resolution

Version

dbspace file format version

File ID

Unique number assigned to each dbspace

Create Time

Time of dbspace creation

RW Mode

Current Readwrite mode: RW, RO, RW, N/A (Upgraded)

Last RW Mode

Last dbspace mode

Size (MB)

DBSpace size in Megabytes

Reserve (MB)

DBSpace reserve size in Megabytes

Block Size

Size of IQ block in Bytes

Page Size

Size of IQ page in Bytes

First Block

First IQ block number mapped to dbspace

Block Count

Number of IQ blocks that map to actual disk blocks

Reserve Blocks

Number of IQ blocks that may be added to this dbspace

Last Real Block

Last IQ block number that maps to an actual disk block

Last Mapped Block

Last IQ block number mapped to dbspace

Online

Online Status (YES/NO)

Create ID

Commit ID in which dbspace was created

Alter ID

Last Commit ID in which dbspace was altered

DBID1

Location of 1st database identity

DBID2

Location of 2nd database identity

CREATE DBSPACE command

Template create dbspace command

Example

The following example shows output for the iqheader command when executed against an IQ dbspace on a Solaris raw partition.

>iqheader /dev/rdsk/c1t17d0s4
File Name: /dev/rdsk/c1t17d0s4

Full Path: /devices/sbus@2,0/SUNW,socal@d,10000/sf@1,0/ssd@w2100002037229873,0:e,raw

DBSpace Header Info
  Version: 2
  File ID: 16404
  Create Time: 2006-04-03 09:32:00
  RW Mode: RW
  Last RW Mode: N/A
  Size (MB): 1025
  Reserve (MB): 0
  Block Size: 4096
  Page Size: 65536
  First Block: 2611040
  Block Count: 262575
  Reserve Blocks: 0
  Last Real Block: 2873614
  Last Mapped Block: 3133247
  Online: YES
  Create ID: 90
  Alter ID: 0
  vDBID1: 0
  DBID2: 0

CREATE DBSPACE command 
create dbspace "[DBSPACENAME]" as '/dev/rdsk/c1t17d0s4'
  iq [MAIN|TEMPORARY|LOCAL] store
server "[|SERVER_NAME]" file id 16404 prefix 65536
  finish 0 first block 2611040 block count 262575

See also

Chapter 5, “Working with Database Objects,” in the Sybase IQ System Administration Guide.