Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

AIX system Learning-ODM Management

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

AIX system Learning-ODM Management

AIX ODM (Object Database Manager) is a database made up of a set of object classes and objects. The object class is equivalent to the object in the Oracle database, which is created by ODM create. You can use ODM drop to delete, and the object is equivalent to the data under object (such as disk, Adapter, etc.). You can use the ODM add command to add the object, use the ODM delete command to delete, and use the ODM change command to modify the specified record. The query command can use odmget.

Use the ODM command

When you use the odmcreate or odmdrop command to create or delete an object class, use one of the following methods to specify the directory from which the class definition file will be accessed:

Store the files in the default directory indicated by $ODMDIR, which is the / usr/lib/objrepos directory.

[root@aix211 /] # echo $ODMDIR/etc/objrepos

The more common commands are the odmget and odmadd commands:

1 、 odmget:

Odmget [- Q Criteria] ObjectClass...

Description

The odmget command takes search rules and a list of object classes as input, retrieves the selected objects from the specified object class, and writes the ASCII odmadd input file to standard output.

Mark

-Q Criteria specifies the search criteria used to select objects from the object class. If no criteria is specified (no-Q flag), all objects in the object class are retrieved.

# odmget-Q name=hdisk1 CuAt | moreCuAt: name= "hdisk1" attribute = "unique_id" value = "2308AJ27R0820CDNES-309170W03IBMscsi" type = "R" generic = "rep =" sl "nls_index = 0

2 、 odmadd:

Add objects to the created object class.

Grammar

Odmadd [InputFile...]

Description

The odmadd command takes one or more InputFile files as input and adds objects to the object class with section file data. Each InputFile file is an ASCII file that contains data that describes the objects to be added to the object class. If no file is specified, get input from standard input.

Before using the odmadd command, it is best to use odmget to query and generate the sample file, then modify it, and then use the odmadd command to add the specified object class.

Note: odmadd will add the object to the object class corresponding to the directory specified by the $ODMDIR variable.

For example:

Take a sample of odm

# odmget-Q name=hdisk2 CuAt > hdisk3odm.add

To edit the sample file, the most important thing is to modify the pvid attribute to return to the pvid of the original hard disk, and the name of another attribute unique_id has also been modified. Of course, there is also name to be corrected to hdisk3. Insert modified files into CuAt

# odmadd hdisk3odm.add

3. Odmshow command:

The odmshow command takes the object class name (ObjectClass) as input and displays the class description on the screen. The format of the class description is the input format of the odmcreate command.

# odmshow CuDv | moreclass CuDv {char name [16]; / * offset: 0xc (12) * / short status; / * offset: 0x1c (28) * / short chgstatus; / * offset: 0x1e (30) * / char ddins [16] / * offset: 0x20 (32) * / char location [16]; / * offset: 0x30 (48) * / char parent [16]; / * offset: 0x40 (64) * / char connwhere [16] / * offset: 0x50 (80) * / link PdDv PdDv uniquetype PdDvLn [48]; / * offset: 0x60 (96) * /}; / * descriptors: 8 structure size: 0x98 bytes data offset: 0x200030e8 population: 55 objects (55 active, 0 deleted) * /

Several object classes you need to know:

PdDv predefined equipment library

PdDv: type = "scsd" class = "pdisk" subclass = "ssar" prefix = "pdisk" devid = ""

The above three parameters need to be used when using mkdev, which requires special attention. If it is not convenient to find them, you can use lsdev-P-H to see the three options in the preconfigured database. This item is also very convenient for generating virtual devices using mkdev.

PdAt predefined attribute library

PdAt:uniquetype = "tape/scsi/8mm" attribute = "block_size" deflt = "1024" values = "0-245760 values 1"

CuDv user-defined device Library

CuDv:name = "rmt0" status = 1chgstatus = 2ddins = "tape" location = "04-C0-00-1 PdDvLn 0" parent = "scsi0" connwhere = "1je 0" PdDvLn = "tape/scsi/8mm"

CuDv:

Name = "hdisk1" status = 1 chgstatus = 2 ddins = "scdisk" location = "10-60-00-1 Magi 0" parent = "scsi0" connwhere = "1 Magi 0" PdDvLn = "disk/scsi/scsd"

CuAt: user-defined attribute library

CuAt: name = "hdisk1" attribute = "unique_id" value = "2308AJ27R0820CDNES-309170W03IBMscsi" type = "R" generic = "" rep = "sl" nls_index = 0

As you can see from the above output, when you use the odmget command to find odm user database information, you can use name= × as the query key.

2. Additional Device Object Classes:

CuDep:

Name = "rootvg" dependency = "hd6"

CuDep:

Name = "datavg" dependency = "lv01"

CuDvDr: device driver

Resource = "devno" value1 = "22" value2 = "0" value3 = "rmt0"

CuVPD: device vpd information vital product data

Name = "rmt0" vpd = "* MFEXABYTEPN21F8842"

PdCn: predefined configuration information

Uniquetype = "adapter/pci/sym875" connkey = "scsi" connwhere = "1Jing 0"

3. The system data managed by ODM include:

Device configuration information

Display information for SMIT (menus, selectors, and dialog boxes)

Important product data for the installation and update process

Communication configuration information

System resource information

Note: ODM does not contain device drivers, so you can only write driver records from device driver files to CuDvDr.

Device status:

Define: no driver is loaded, but it is defined in odm

Available: the driver has been loaded and recorded in CuDvDr.

Stopped: stop status, which is supported by some devices

IV. Cases:

Search for the object category to which the object belongs:

Usage:

For i in `ls $ODMDIR`; do (odmget $I 2 > / dev/null | grep-p specific string); done

1. Search the object category to which hdisk0 belongs

[root@aix211 /] # for i in `ls $ODMDIR`; do (odmget $I 2 > / dev/null | grep-p hdisk0); done

CuAt: name = "hdisk0" attribute = "unique_id" value = "21080005E93A0AST373307LC03IBMscsi" type = "R" generic = "rep =" nl "nls_index = 79CuAt: name =" hdisk0 "attribute =" pvid "value =" 00040f8aaa29d28e0000000000000000 "type =" R "generic =" D "rep =" s "nls_index = 2CuAt: name =" hdisk0 "attribute =" size_in_mb "value =" 73400 "type =" R "generic =" D "rep =" nr "nls_index = 60CuAt: name =" hdisk0 "attribute =" led "value =" 0x57D "type =" Z "generic = "" rep = "nr" nls_index = 0CuAt: name = "hdisk0" attribute = "message_no" value = "87" type = "T" generic = "" rep = "nl" nls_index = 0CuAt: name = "hdisk0" attribute = "diag_scsd" value = "a500000107000507000c0d" Type = "R" generic = "rep =" s "nls_index = 0CuDv: name =" hdisk0 "status = 1 chgstatus = 2 ddins =" scdisk "location =" 1S-08-00-8 location 0 "parent =" scsi0 "connwhere =" 8Perry 0 "PdDvLn =" disk/scsi/scsd "CuDvDr: resource =" devno " Value1 = "24" value2 = "0" value3 = "hdisk0" CuPath: name = "hdisk0" parent = "scsi0" connection = "8 path_id 0" alias = "" path_status = 1 path_id = 0CuVPD: name = "hdisk0" vpd_type = 0 vpd = "* MFIBM * TM\ n\ ST373307LC * F00P3072 * RL4335304A*SN0005E93A*ECH12094 * P00P2672 * Z0\ n\ 000003129F00013E*Z0812C512 "

2. The object category to which the search gateway address belongs:

[root@aix211 /] # for i in `ls $ODMDIR`; do (odmget $I 2 > / dev/null | grep-p 192.168.8.1); done

CuAt: name = "inet0" attribute = "route" value = "net,-hopcount,0,0192.168.8.1" type = "R" generic = "DU" rep = "s" nls_index = 0

From the above, you can understand the object category to which each object belongs, and then you can delete the corresponding object with odmdelete.

For example, delete hdisk0:

[root@aix211 /] # odmdelet-o CuDv-Q "name=hdisk0"

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report