# Reading and changing database information

When a record is created for a board in the NMS OAM database, it is assigned a unique name and board number. You can display and change this information with oamcfg.

This topic describes how to use oamcfg to:

- Display board ID information.

- Specify settings in board keyword files.

- Specify keyword settings on the command line.

- Change board ID information.

- Replace existing data in the database.

## Displaying board ID information

To display the ID parameters for a board, use the -q option. For example, the following command displays all ID parameters in the database:

oamcfg -q

oamcfg responds with output similar to the following:

NAME NUMBER BUS:SLOT SHELF:SLOT MAC ADDRESS PRODUCT
AG_4040C_E1_2_13 0 2:13 N/A 00-20-22-ff-13-40 AG_4040C_E1
CG_6000C_Quad_2_10 3 2:10 31:7 00-20-22-40-08-74 CG_6000C_Quad
CG_6000C_Quad_2_11 4 2:11 31:6 00-20-22-31-19-12 CG_6000C_Quad

You can change the board name or number. Refer to Changing board ID information.

To specify keyword settings with oamcfg, you can:

- Supply the keywords in a keyword file. The information is stored in the NMS OAM database.

- Specify the keywords on the oamcfg command line.

## Specifying settings in board keyword files

Use the oamcfg -f fname option to specify a board keyword file. fname is the name of a board keyword file. You can include this option more than once, to specify more than one file. If no board is specified, oamcfg loads the keyword file for all boards.

The following command adds the configuration information in keyword files filea.cfg and fileb.cfg to the database record for board 1:

oamcfg -b 1 -f filea.cfg -f fileb.cfg

If you omit the path, oamcfg searches for the specified files in the current directory, and then the paths specified in the AGLOAD environment variable.

To search elsewhere, specify the entire path along with the file name on the command line.

If you specify a file name without an extension, oamcfg assumes the extension to be .cfg.

To specify a space within a file name, surround it with quotation marks:

oamcfg -b 1 -f "My File.cfg"

## Specifying settings on the command line

To set a specific keyword, you can specify it directly on the command line using the -k keyword=value option. keyword is a valid keyword name for the component, and value is a valid value for the keyword.

The keyword and value must be separated by an equal sign (=). For example:

oamcfg -b 1 -k DebugLevel=3

If you need to embed a space in a keyword and value designation, place the whole designation in quotation marks. For example:

oamcfg -b 1 -k "DebugLevel = 3"

The -k option can appear more than once on a command line, to set multiple values.

If no board is specified, oamcfg sets the keyword for all boards in the NMS OAM database.

For more information about keywords and values, refer to Using board keyword files.

## Changing board ID information

You can change the number or PCI bus and slot information for a board. To do so, specify a board on the command line using a board identification option (-b, -g, -l, -m, or -n). This board must be currently listed in the database. Specify the new number, PCI bus and slot, or both using other -b or -l options on the same command line.

oamcfg checks the database for each option. If it determines that only one option specifies current information for an existing board, it assigns that board the number, PCI bus:slot, or both given in the other options.

To change the number of the board in bus 0, slot 20, specify the following (assumes that board number 5 does not currently exist):

oamcfg -l 0:20 -n myboard -b 5

Note: You cannot change a board's name, MAC address, or shelf and slot information.

You cannot specify the same board identification option twice on the same command line. When referencing an existing board with a given identification option, you must specify two command lines to change that option. For example, to change board number 0 to 15 (assuming that board number 15 does not currently exist), specify the following:

oamcfg -b 0 -n temp
oamcfg -n temp -b 15

## Replacing existing data

By default, when oamcfg adds, changes, or deletes information for a component (using the -f or -k options), or changes board ID information (as described in Changing board ID information), it does not disturb any other settings for the board. Use the -r option to delete all database information for the board before adding the new information. This is useful when you want to start from a blank slate when changing information for a component:

oamcfg -b 1 -r -f filea.cfg -f fileb.cfg