cdr list grid

The cdr list grid command shows information about a grid.

Syntax


1  cdr list grid?  %Connect Option  (1)? 
2.1+ 
2.1  --command=command_ID --verbose
2.1  --source=server_group --verbose
2.1  --summary
2.1  --verbose
2.1  --nacks
2.1  --acks
2.1  --pending
1 grid_name
Notes:
Element Purpose Restrictions Syntax
command_ID The ID of a specific command that was run from the grid. An integer.
grid_name Name of the grid. Must be the name of an existing grid. Long Identifiers
server_group Name of a database server group from which the command was run. Must be the name of an existing database server group in SQLHOSTS. Long Identifiers

The following table describes the cdr list grid options.

Long Form Short Form Meaning
--acks -a Displays the servers in the grid and the commands that succeeded on one or more servers.
--command= -C Displays the servers in the grid and the specified command.
--nacks -n Displays the servers in the grid and the commands that failed on one or more servers.
--pending -p Displays the servers in the grid and the commands that are in progress. A command can be pending because the transaction has not completed processing on the target server, the target server is down, or the target server was added to the grid after the command was run.
--source= -S Displays the servers in the grid and the commands that were run from the specified server.
--summary -s Displays the servers in the grid and the commands that were run on the grid.
--verbose -v Displays the servers in the grid, the commands that were run on the grid, and the results of the commands on each server in the grid.

Usage

Use the cdr list grid command to view information about servers in the grid, and about the commands that were run on servers in the grid.

If you run the cdr list grid command without any options or without a grid name, the output shows the list of grids.

Servers in the grid on which users are authorized to run grid commands are marked with an asterisk (*).

When you add a server to the grid, any commands that were previously run through the grid have a status of PENDING for that server. If you want to run previous grid commands on a new grid server, use the ifx_grid_redo() procedure. If you do not want to run previous grid commands on a new server, you can purge the commands by running the ifx_grid_purge() procedure.

When you run an SQL administration API command, the status of the grid command does not necessarily reflect whether the SQL administration API command succeeded. The grid command can have a status of ACK even if the SQL administration API command failed. The cdr list grid command shows the return codes of the SQL administration API commands. The task() function returns a message indicating whether the command succeeded. The admin() function returns an integer which if it is a positive number indicates that the command succeeded.

Return codes

A return code of 0 indicates that the command was successful.

If the command is not successful, one of the following error codes is returned: 5, 220, 222.

For information on these error codes, see Return Codes for the cdr Utility.

Examples

The examples in this section show the output of the cdr list grid command on a grid grid1 that contains three servers: cdr1, cdr2, and cdr3.

Example 1: Display grid members

The following command displays the members of the grid1 grid:

cdr list grid grid1

The output of the previous command is:

Grid               Node               User
------------------ ------------------ ----------------
grid1              cdr1*              bill
                   cdr2
                   cdr3

This output shows that the grid contains three member servers and that the authorized user bill can run grid routines from the server cdr1.

Example 2: Display verbose information about commands

The following command displays verbose information about a series of commands and their results on each server in the grid:

cdr list grid --verbose grid1

The output of the previous command is:

Grid               Node               User
------------------ ------------------ ----------------
grid1              cdr1*              bill
                   cdr2
                   cdr3
Details for grid grid1

Node:cdr1 Stmtid:1 User:dba1 Database:tstdb 2010-05-27 15:21:57
Tag:test
create database tstdb with log
ACK cdr1 2010-05-27 15:21:57
ACK cdr2 2010-05-27 15:21:58
PENDING cdr3

Node:cdr1 Stmtid:2 User:dba1 Database:tstdb 2010-05-27 15:21:57
Tag:test
create table tab1 (col1 int, col2 int)
ACK cdr1 2010-05-27 15:21:57
ACK cdr2 2010-05-27 15:21:58
PENDING cdr3

Node:cdr1 Stmtid:3 User:dba1 Database:tstdb 2010-05-27 15:21:57
Tag:test
create procedure load(maxnum int)
define tnum int;
for tnum = 1 to maxnum
    insert into tab1 values (tnum, 1);
end for;
end procedure;
ACK cdr1 2010-05-27 15:21:57
ACK cdr2 2010-05-27 15:21:58
PENDING cdr3

This output shows each command and that all commands succeeded on servers cdr1 and cdr2 but are pending on the cdr3 server because it is offline.

Example 3: Display errors

In this example, the cdr3 server already has a database with the same name as the database in the CREATE DATABASE statement: therefore, the CREATE DATABASE and CREATE TABLE statements fail. The following command displays information about commands run within the grid that resulted in an error:

cdr list grid --nacks grid1

The output of the previous command is:

Grid               Node               User
------------------ ------------------ ----------------
grid1              cdr1*              bill
                   cdr2
                   cdr3
Details for grid grid1

Node:cdr1 Stmtid:1 User:dba1 Database:tstdb 2010-05-27 15:21:57
Tag:test
create database tstdb with log
NACK cdr3 2010-05-27 15:39:21 SQLERR:-330 ISAMERR:-100

Node:cdr1 Stmtid:2 User:dba1 Database:tstdb 2010-05-27 15:21:57
Tag:test
create table tab1 (col1 int, col2 int)
NACK cdr3 2010-05-27 15:39:21 SQLERR:-310 ISAMERR:0
     Grid Apply Transaction Failure

This output shows the SQL and ISAM error codes associated with the failed statements.