Top
Systemwalker Service Quality Coordinator Reference Guide
Systemwalker

1.7.1 sqcPDBcout (CSV Output Command)

Privileges required for execution

[Windows]

The privileges of a user belonging to the "Administrators" group are required to execute this command.

[UNIX]

The privileges of a system administrator (superuser) are required to execute this command.


Execution environment

This command can be executed on Managers, Enterprise Managers and operation management clients.


Syntax

For Managers or Enterprise Managers

[Windows]

<Installation directory>\bin\sqcPDBcout.exe -R record-id [-sys system] [-rid resource-id] [-tmbin time] [-tmfin time] [-intval interval] [-lcltm on|off] [-h on|off]

<Installation directory>\bin\sqcPDBcout.exe -f sql-file [-h on|off]

[UNIX]

/opt/FJSVssqc/bin/sqcPDBcout.sh -R record-id [-sys system] [-rid resource-id] [-tmbin time] [-tmfin time] [-intval interval] [-lcltm on|off] [-h on|off]

/opt/FJSVssqc/bin/sqcPDBcout.sh -f sql-file [-h on|off]

For operation management clients

<Installation directory>\bin\sqcPDBcout.exe -R record-id -name manager [-sys system] [-rid resource-id] [-tmbin time] [-tmfin time] [-intval interval] [-lcltm on|off] [-h on|off]

<Installation directory>\bin\sqcPDBcout.exe -f sql-file -name manager [-h on|off]

Function

This command outputs data stored in a PDB (Summary information or Report information) to CSV format. The command is executed with parameters that specify the conditions to use when extracting information.

Note

Do not execute multiple sqcPDBcout command simultaneously.


Options

-R record-id

This mode specifies data extraction conditions as options. Specify the record ID in "record-id". Refer to "Chapter 4 Data Formats" for details on record IDs.


-f sql-file

This mode specifies data extraction conditions in SQL. Specify the path to a file containing SQL in "sql-file".

Refer to the following usage example for details on the syntax for SQL statements. Also, refer to "Chapter 4 Data Formats" for details on table names specified with the FROM clause.

Refer to the following output results for details on field names specified with the SELECT and WHERE clauses.

Note

  • Do not include linefeed code in the middle of the SQL statements.

  • Only FROM clause and WHERE clause can be used in the SELECT statement.


-name manager

This mode specifies a Manager. Specify in "manager" the host name of a Manager that has the PDB data to be output.


-sys system

Specify the name of the system for which data is to be extracted. If this option is omitted, the data of all systems will be targeted.


-rid resource-id

Specify the ID of the resource for which data is to be extracted. If this option is omitted, the data of all resources will be targeted.


-tmbin time

Specify the extraction start time using GMT (Greenwich Mean Time) or local time according to -lcltm option. If this option is omitted, all the data in the PDB, from the oldest to the newest, will be extracted.

The following format is used to specify the time:

"YYYY-MM-DD hh:mm:ss" (YYYY: year; MM: month; DD: day; hh: hour; mm: minute; ss: second)


-tmfin time

Specify the extraction end time using GMT (Greenwich Mean Time) or the local time according to -lcltm option. If this option is omitted, all the data in the PDB, from the newest to the oldest, will be extracted.

The following format is used to specify the time:

"YYYY-MM-DD hh:mm:ss" (YYYY: year; MM: month; DD: day; hh: hour; mm: minute; ss: second)


-intval interval (can be specified only for Drilled-Down/Report information)

Specify whether to display header information at the beginning of the output result. If this option is omitted, header information is not displayed.


-lcltm on|off

This option specifies whether the local time is to be used in the extraction start and end times specified by the -tmbin and -tmfin options, and in the time in the data that is output in CSV format. If this option is omitted, GMT (Greenwich Mean Time) will be used.

The time zone set in the machine that executes the sqcPDBcout command is set as the local time.

Note that if "86400" (data for one day) is specified in the -intval option and this option is set to "on", data dated "YYYY-MM-DD 00:00:00" Greenwich Mean Time will be converted to the local time before being displayed.


-h on|off

Specify whether to display header information at the beginning of the output result. If this option is omitted, header information is not displayed.


Execution results/Output format

When header information is attached to the beginning of output results, information such as the following will be displayed.

system_name,record_id,resource_id,start_date_time,end_date_time,end_time,data_num1,

data_num2,data_num3,data_num4,data_num5,data_num6,data_num7,data_text1


The items that appear in header information are explained below.

system_name

The system name

record_id

The record ID. Refer to "Chapter 4 Data Formats" for details.

resource_id

The resource ID

start_date_time

The collection start time using GMT (Greenwich Mean Time)

end_date_time

The collection end time using GMT (Greenwich Mean Time)

end_time (for Summary information only)

The time component of the collection end time

time_flag (only if the -f option is specified)

Internal control information

ime_zone (only if the -f option is specified)

Internal control information

daylight_saving (only if the -f option is specified)

Internal control information

cycle_nr (only if the -f option is specified, and for Summary information only)

Internal control information

consol_flag (for Drilled-Down/Report information only)

The interval type

consol_interval (for Drilled-Down/Report information only)

The interval time

coverage (for Drilled-Down/Report information only)

The data coverage rate. For example, a coverage rate of 1 indicates no lost data. A coverage rate of 0.9 indicates that 10% of data has been lost.

data_num1 to data_num7

The numerical value of each field. Refer to "Chapter 4 Data Formats" for details.

data_text1 to data_text5

The text of each field. Refer to "Chapter 4 Data Formats" for details.


Return values

0 : Normal termination

> 0 : Abnormal termination (error details are as follows)


  1. PDB lock error

    This error occurs if a contention occurs between the sqcPDBcout command and another process, such as a process that writes information collected by an Agent or Proxy Manager to the PDB, or a process that performs a PDB maintenance operation at 2:00 AM every day.

    If this error occurs, keep executing the sqcPDBcout command until it terminates normally. Note, however, that if the PDB lock remains in effect for a long time during the time frame that the PDB maintenance process is executed, adjust the timing of the sqcPDBcout command so that it does not coincide with the timing of the PDB maintenance process.


  2. Manager communication error

    This error occurs when communication with a Manager fails. If this error occurs, check whether the Manager is running correctly. If the Manager is stopped, start it before executing this command.


  3. Other error

    Other errors can be caused by factors such as incorrectly specified options and problems with the environment. If an error occurs, review the option details and the execution environment.


Usage example 1

The following execution example uses the option specification (-R) as an extraction condition.

[Windows]

C:\>cd C:\Program Files\SystemwalkerSQC\bin

C:\Program Files\SystemwalkerSQC\bin>sqcPDBcout -R WIN_DISKSPACE -sys LABRET -rid C:\ -tmbin "2004-07-01 10:00:00" -intval 3600 -h off

LABRET,WIN_DISKSPACE,C:\,2004-07-01 11:00:00,2004-07-01 12:00:00,2,3600,1,74857984,2113864192,,,,,,,,,,

LABRET,WIN_DISKSPACE,C:\,2004-07-01 12:00:00,2004-07-01 13:00:00,2,3600,1,105043456,2113864192,,,,,,,,,,

End.

[UNIX]

# cd /opt/FJSVssqc/bin/

# ./sqcPDBcout.sh -R WIN_DISKSPACE -sys LABRET -rid C:\ -tmbin "2004-07-01 10:00:00" -intval 3600 -h off

LABRET,WIN_DISKSPACE,C:\,2004-07-01 11:00:00,2004-07-01 12:00:00,2,3600,1,74857984,2113864192,,,,,,,,,,

LABRET,WIN_DISKSPACE,C:\,2004-07-01 12:00:00,2004-07-01 13:00:00,2,3600,1,105043456,2113864192,,,,,,,,,,

End.


Usage example 2

The following execution example uses the SQL file specification (-f) as an extraction condition.

[Windows]

C:\>cd C:\Program Files\SystemwalkerSQC\bin

C:\Program Files\SystemwalkerSQC\bin>sqcPDBcout -f C:\sql.txt

LABRET,WIN_DISKSPACE,C:\,2004-07-01 11:00:00,2004-07-01 12:00:00,2,3600,1,74857984,2113864192,,,,,,,,,,

LABRET,WIN_DISKSPACE,C:\,2004-07-01 12:00:00,2004-07-01 13:00:00,2,3600,1,105043456,2113864192,,,,,,,,,,

End.

[UNIX]

# cd /opt/FJSVssqc/bin/

# ./sqcPDBcout.sh -f /tmp/sql.txt

LABRET,WIN_DISKSPACE,C:\,2004-07-01 11:00:00,2004-07-01 12:00:00,2,3600,1,74857984,2113864192,,,,,,,,,,

LABRET,WIN_DISKSPACE,C:\,2004-07-01 12:00:00,2004-07-01 13:00:00,2,3600,1,105043456,2113864192,,,,,,,,,,

End.


In this case, the content of sql.txt is as follows. There is no linefeed code in the middle of the actual SQL statement.

select * from resource_data where record_id='WIN_DISKSPACE' AND system_name='LABRET' AND consol_interval=3600;