ITPub博客

[20180810]gpnptool.txt

原创 Oracle 作者:lfree 时间:2018-08-10 09:06:23 0 删除 编辑

[20180810]gpnptool.txt


--//gpnptool用于查看GPnP Profile的内容.我以前一直认为输出格式不好看.使用xmllint格式化.

--//链接:http://blog.itpub.net/267265/viewspace-2117702/

--//实际上gpnptool支持一些参数,可以显示输出更加清晰.

--//例子如下:

$ gpnptool get -o- | xmllint --format - | grep SPFile


Success.

  <orcl:ASM-Profile id="asm" DiscoveryString="/dev/asm-disk*" SPFile="+OCR/fyhis-cluster/asmparameterfile/registry.253.931436169"/>


--//注:gpnptool get -o-不过滤,显示很难看.通过xmllint格式化在grep过滤显示比较清晰.查看gpnptool帮助:


$ gpnptool


Oracle GPnP Tool


Usage:

 "gpnptool <verb> <switches>", where verbs are:


     create   Create a new GPnP Profile

     edit     Edit existing GPnP Profile

     getpval  Get value(s) from GPnP Profile

     get      Get profile in effect on local node

     rget     Get profile in effect on remote GPnP node

     put      Put profile as a current best

     find     Find all RD-discoverable resources of given type

     lfind    Find local gpnpd server

     check    Perform basic profile sanity checks

     c14n     Canonicalize, format profile text (XML C14N)

     sign     Sign/re-sign profile with wallet's private key

     unsign   Remove profile signature, if any

     verify   Verify profile signature against wallet certificate

     help     Print detailed tool help

     ver      Show tool version


--//提供取值getpval参数.

$ gpnptool getpval -p=profile.xml -?


Oracle GPnP Tool

     getpval  Get value(s) from GPnP Profile

Usage:

 "gpnptool getpval <switches>", where switches are:

    -prf                  Profile Tag: <GPnP-Profile>, optional

    -[id:]prf_cn          Profile Tag: <GPnP-Profile [Id="id"]  ClusterName="<val>">, optional

    -[id:]prf_pa          Profile Tag: <GPnP-Profile [Id="id"]  PALocation="<uri>">, optional

    -[id:]prf_sq          Profile Tag: <GPnP-Profile [Id="id"]  ProfileSequence="<num>">, optional

    -[id:]prf_cid         Profile Tag: <GPnP-Profile [Id="id"]  ClusterUId="<val>">, optional

    -[pid:]nets           Profile Tag: <Network-Profile> children of <GPnP-Profile Id="pid">, optional

    -[pid:]haip           Profile Tag: <HAIP> children of <Network-Profile Id="pid">, optional

    -[id:]haip_ma         Profile Tag: <HAIP [Id="id"]  MulticastAddress="<val>">, optional

    -[id:]haip_bm         Profile Tag: <HAIP [Id="id"]  BootMode="<val>">, optional

    -[id:]haip_s          Profile Tag: <HAIP [Id="id"]  Subnet="<val>">, optional

    -[pid:]hnet           Profile Tag: <HostNetwork> children of <Network-Profile Id="pid">, optional

    -[id:]hnet_nm         Profile Tag: <HostNetwork [Id="id"]  HostName="<val>">, optional

    -[pid:]net            Profile Tag: <Network> children of <HostNetwork Id="pid">, optional

    -[id:]net_ip          Profile Tag: <Network [Id="id"]  IP="<val>">, optional

    -[id:]net_use         Profile Tag: <Network [Id="id"]  Use="<val>">, optional

    -[id:]net_nt          Profile Tag: <Network [Id="id"]  NameTempl="<val>">, optional

    -[id:]net_aip         Profile Tag: <Network [Id="id"]  AutoIP="<val>">, optional

    -[id:]net_ada         Profile Tag: <Network [Id="id"]  Adapter="<val>">, optional

    -[pid:]asm            Profile Tag: <ASM-Profile> children of <GPnP-Profile Id="pid">, optional

    -[id:]asm_dis         Profile Tag: <ASM-Profile [Id="id"]  DiscoveryString="<val>">, optional

    -[id:]asm_spf         Profile Tag: <ASM-Profile [Id="id"]  SPFile="<val>">, optional

    -[id:]asm_uid         Profile Tag: <ASM-Profile [Id="id"]  UniverseId="<hexnum>">, optional

    -[pid:]css            Profile Tag: <CSS-Profile> children of <GPnP-Profile Id="pid">, optional

    -[id:]css_dis         Profile Tag: <CSS-Profile [Id="id"]  DiscoveryString="<val>">, optional

    -[id:]css_ld          Profile Tag: <CSS-Profile [Id="id"]  LeaseDuration="<num>">, optional

    -[id:]css_cin         Profile Tag: <CSS-Profile [Id="id"]  ProfileCIN="<num>">, optional

    -[id:]css_cuv         Profile Tag: <CSS-Profile [Id="id"]  CUV="<val>">, optional

    -[pid:]ocr            Profile Tag: <OCR-Profile> children of <GPnP-Profile Id="pid">, optional

    -[id:]ocr_oid         Profile Tag: <OCR-Profile [Id="id"]  OCRId="<num>">, optional

    -rmws                 Remove whitespace from xml, optional

    -fmt[=0,2]            Format profile. Value is ident level,step, optional

    -p[=profile.xml]      GPnP profile name

    -o[=gpnptool.out]     Output result to a file, optional

    -o-                   Output result to stdout

    -ovr                  Overwrite output file, if exists, optional

    -t[=3]                Trace level (min..max=0..7), optional

    -f=<val>              Command file name, optional

    -?                    Print verb help and exit


--//通过这个参数getpval可以更好取值.例子如下:


1.定位profile.xml

# find / -name profile.xml

/u01/app/11.2.0/grid/gpnp/fyhis1/profiles/peer/profile.xml

/u01/app/11.2.0/grid/gpnp/profiles/peer/profile.xml


--//或者使用locate:

$ locate profile.xml

/u01/app/11.2.0/grid/gpnp/fyhis1/profiles/peer/profile.xml

/u01/app/11.2.0/grid/gpnp/profiles/peer/profile.xml



2.查询:

$ cd /u01/app/11.2.0/grid/gpnp/fyhis1/profiles/peer/


$ gpnptool getpval -p=profile.xml -asm_spf  -o-

+OCR/fyhis-cluster/asmparameterfile/registry.253.931436169


$ gpnptool getpval -p=profile.xml -asm_dis -o-

/dev/asm-disk*



--//也可以使用如下:

$ gpnptool get -o- | xmllint --format - | grep SPFile


Success.

  <orcl:ASM-Profile id="asm" DiscoveryString="/dev/asm-disk*" SPFile="+OCR/fyhis-cluster/asmparameterfile/registry.253.931436169"/>


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-2199606/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-01-03

  • 博文量
    2163
  • 访问量
    5930313