Oracle GoldenGate配置过程

在同一个库的不同schema之间进行GoldenGate的配置,下面是详细的步骤。

1, 解压ogg的zip包,ogg是绿色软件,直接解压即可。
2,建立ogg所需的目录,直接用ggsci,然后命令create subdirs


[oracle@localhost base]$ ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
Linux, x64, 64bit (optimized), Oracle 11g on Oct  4 2011 23:49:46

Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.



GGSCI (localhost.localdomain) 1> create subdirs

Creating subdirectories under current directory /u01/app/base

Parameter files                /u01/app/base/dirprm: created
Report files                   /u01/app/base/dirrpt: created
Checkpoint files               /u01/app/base/dirchk: created
Process status files           /u01/app/base/dirpcs: created
SQL script files               /u01/app/base/dirsql: created
Database definitions files     /u01/app/base/dirdef: created
Extract data files             /u01/app/base/dirdat: created
Temporary files                /u01/app/base/dirtmp: created
Veridata files                 /u01/app/base/dirver: created
Veridata Lock files            /u01/app/base/dirver/lock: created
Veridata Out-Of-Sync files     /u01/app/base/dirver/oos: created
Veridata Out-Of-Sync XML files /u01/app/base/dirver/oosxml: created
Veridata Parameter files       /u01/app/base/dirver/params: created
Veridata Report files          /u01/app/base/dirver/report: created
Veridata Status files          /u01/app/base/dirver/status: created
Veridata Trace files           /u01/app/base/dirver/trace: created
Stdout files                   /u01/app/base/dirout: created

3,建立所需要的三个用户,ggate用户,源和目标用户jss和jst。

create user ggate identified by ggate;
grant dba to ggate;

create user jss identified by jss;
grant connect, resource to jss;

create user jst identified by jst;
grant connect, resource to jst;

4, 用jss登录,在源上建立一个测试表,并灌入一部分测试数据。

conn jss/jss
create table test as select * from user_objects where 1=2;
insert into test select * from user_objects ;
commit;

至此,所需要的准备工作完成,这里为了简化操作,我们只做最简单的dml的复制操作。

5,登录ggsci,配置manager所需要的端口并启动manager

GGSCI (localhost.localdomain) 4> edit params mgr

PORT 7809

GGSCI (localhost.localdomain) 5> start mgr
MGR is already running.

6,登录ggsci,连接进源数据库,并添加一个源复制队列和目标复制队列

GGSCI (localhost.localdomain) 6> dblogin userid ggate,password ggate
Successfully logged into database.


GGSCI (localhost.localdomain) 9> add extract ext1 ,tranlog,begin now
EXTRACT added.


GGSCI (localhost.localdomain) 10> add exttrail ./dirdat/lt ,extract ext1
EXTTRAIL added.


GGSCI (localhost.localdomain) 11> edit params ext1

extract ext1
userid ggate@orcldb,password ggate
rmthost 127.0.0.1,mgrport 7809
RMTTASK REPLICAT, GROUP rep1
table jss.*;


GGSCI (localhost.localdomain) 12> add replicat rep1,exttrail ./dirdat/lt,checkpointtable ggate.checkpo
int
REPLICAT added.


GGSCI (localhost.localdomain) 13> edit params rep1

REPLICAT rep1
ASSUMETARGETDEFS
USERID ggate@orcldb,PASSWORD ggate
DISCARDFILE ./dirrpt/rep1_gg2.dsc,PURGE
MAP jss.*, TARGET jst.*;


7,启动源和目标队列,并查看


GGSCI (localhost.localdomain) 30> start ext1

Sending START request to MANAGER ...
EXTRACT EXT1 starting


GGSCI (localhost.localdomain) 31> start rep1

Sending START request to MANAGER ...
REPLICAT REP1 starting

8,查看源和目标的复制结果


GGSCI (localhost.localdomain) 40> view report ext1


2011-11-25 13:16:54  INFO    OGG-01017  Wildcard resolution set to IMMEDIATE because SOURCEISTABLE is
used.

***********************************************************************
                 Oracle GoldenGate Capture for Oracle
     Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
   Linux, x64, 64bit (optimized), Oracle 11g on Oct  7 2011 05:37:17

Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.


                    Starting at 2011-11-25 13:16:54
***********************************************************************

Operating System Version:
Linux
Version #1 SMP Mon Mar 29 22:10:29 EDT 2010, Release 2.6.18-194.el5
Node: localhost.localdomain
Machine: x86_64
                         soft limit   hard limit
Address Space Size   :    unlimited    unlimited
Heap Size            :    unlimited    unlimited
File Size            :    unlimited    unlimited
CPU Time             :    unlimited    unlimited

Process id: 4765

Description:

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************
extract ext1
userid ggate@orcldb,password *****
rmthost 127.0.0.1,mgrport 7809
RMTTASK REPLICAT, GROUP rep1
table jss.*;
TABLEWildcard  resolved (entry JSS.*):
  table JSS.J1;

Using the following key columns for source table JSS.J1: ID.
TABLEWildcard  resolved (entry JSS.*):
  table JSS.J2;

2011-11-25 13:16:55  WARNING OGG-00869  No unique key is defined for table J2. All viable columns will
 be used to represent the key, but may not guarantee uniqueness.  KEYCOLS may be used to define the ke
y.

Using the following key columns for source table JSS.J2: ID, VL.
TABLEWildcard  resolved (entry JSS.*):
  table JSS.TEST;

2011-11-25 13:16:55  WARNING OGG-00869  No unique key is defined for table TEST. All viable columns wi
ll be used to represent the key, but may not guarantee uniqueness.  KEYCOLS may be used to define the
key.

Using the following key columns for source table JSS.TEST: ID.

CACHEMGR virtual memory values (may have been adjusted)
CACHEBUFFERSIZE:                         64K
CACHESIZE:                                8G
CACHEBUFFERSIZE (soft max):               4M
CACHEPAGEOUTSIZE (normal):                4M
PROCESS VM AVAIL FROM OS (min):          16G
CACHESIZEMAX (strict force to disk):  13.99G

Database Version:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

Database Language and Character Set:
NLS_LANG environment variable specified has invalid format, default value will be used.
NLS_LANG environment variable not set, using default value AMERICAN_AMERICA.US7ASCII.
NLS_LANGUAGE     = "AMERICAN"
NLS_TERRITORY    = "AMERICA"
NLS_CHARACTERSET = "WE8MSWIN1252"

Warning: your NLS_LANG setting does not match database server language setting.
Please refer to user manual for more information.

Processing table JSS.J1

Processing table JSS.J2

Processing table JSS.TEST

***********************************************************************
*                   ** Run Time Statistics **                         *
***********************************************************************


Report at 2011-11-25 13:17:00 (activity since 2011-11-25 13:16:54)

Output to rep1:

From Table JSS.J1:
       #                   inserts:         4
       #                   updates:         0
       #                   deletes:         0
       #                  discards:         0


REDO Log Statistics
  Bytes parsed                    0
  Bytes output                  316





GGSCI (localhost.localdomain) 41> view report rep1


***********************************************************************
                 Oracle GoldenGate Delivery for Oracle
     Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
   Linux, x64, 64bit (optimized), Oracle 11g on Oct  7 2011 05:44:59

Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.


                    Starting at 2011-11-25 13:16:55
***********************************************************************

Operating System Version:
Linux
Version #1 SMP Mon Mar 29 22:10:29 EDT 2010, Release 2.6.18-194.el5
Node: localhost.localdomain
Machine: x86_64
                         soft limit   hard limit
Address Space Size   :    unlimited    unlimited
Heap Size            :    unlimited    unlimited
File Size            :    unlimited    unlimited
CPU Time             :    unlimited    unlimited

Process id: 4771

Description:

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************
REPLICAT rep1
ASSUMETARGETDEFS
USERID ggate@orcldb,PASSWORD *****
DISCARDFILE ./dirrpt/rep1_gg2.dsc,PURGE
MAP jss.*, TARGET jst.*;

CACHEMGR virtual memory values (may have been adjusted)
CACHEBUFFERSIZE:                         64K
CACHESIZE:                              512M
CACHEBUFFERSIZE (soft max):               4M
CACHEPAGEOUTSIZE (normal):                4M
PROCESS VM AVAIL FROM OS (min):           1G
CACHESIZEMAX (strict force to disk):    881M

Database Version:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

Database Language and Character Set:
NLS_LANG environment variable specified has invalid format, default value will be used.
NLS_LANG environment variable not set, using default value AMERICAN_AMERICA.US7ASCII.
NLS_LANGUAGE     = "AMERICAN"
NLS_TERRITORY    = "AMERICA"
NLS_CHARACTERSET = "WE8MSWIN1252"

Warning: your NLS_LANG setting does not match database server language setting.
Please refer to user manual for more information.

***********************************************************************
**                     Run Time Messages                             **
***********************************************************************


Wildcard MAP resolved (entry JSS.*):
  MAP JSS.J1, TARGET jst.J1;
Using following columns in default map by name:
  ID, VL

Using the following key columns for target table JST.J1: ID.


***********************************************************************
*                   ** Run Time Statistics **                         *
***********************************************************************


Report at 2011-11-25 13:17:05 (activity since 2011-11-25 13:17:00)

From Table JSS.J1 to JST.J1:
       #                   inserts:         4
       #                   updates:         0
       #                   deletes:         0
       #                  discards:         0


CACHE OBJECT MANAGER statistics

CACHE MANAGER VM USAGE
vm current     =      0    vm anon queues =      0
vm anon in use =      0    vm file        =      0
vm used max    =      0    ==> CACHE BALANCED

CACHE CONFIGURATION
cache size       = 512M   cache force paging = 881M
buffer min       =  64K   buffer highwater   =   4M
pageout eligible size =   4M

================================================================================
RUNTIME STATS FOR SUPERPOOL

CACHE Transaction Stats
trans active   =      0    max concurrent =      0
non-zero total =      0    trans total    =      0

CACHE File Caching
disk current   =      0    disk total  =      0
disk caching   =      0    file cached =      0
file retrieves =      0

CACHE MANAGEMENT
buffer links  =      0   anon gets   =      0
forced unmaps =      0   cnnbl try   =      0
cached out    =      0   force out   =      0

Allocation Request Distribution
< 128B:       0
 128B:        0         0     | 512B:        0         0
   2K:        0         0     |   8K:        0         0
  32K:        0         0     | 128K:        0         0
 512K:        0         0     |   2M:        0         0
   8M:        0         0     |  32M:        0         0
 128M:        0         0     | 512M:        0         0
   2G:        0         0     |   8G:        0

Cached Transaction Size Distribution
    0:        0
 < 4K:        0
   4K:        0         0     |  16K:        0         0
  64K:        0         0     | 256K:        0         0
   1M:        0         0     |   4M:        0         0
  16M:        0         0     |  64M:        0         0
 256M:        0         0     |   1G:        0         0
   4G:        0         0     |  16G:        0         0
  64G:        0         0     | 256G:        0         0
   1T:        0         0     |   4T:        0         0
  16T:        0         0     |  64T:        0         0
 256T:        0         0     |1024T:        0         0

================================================================================
CUMULATIVE STATS FOR SUPERPOOL

CACHE Transaction Stats
trans active   =      0    max concurrent =      0
non-zero total =      0    trans total    =      0

CACHE File Caching
disk current   =      0    disk total  =      0
disk caching   =      0    file cached =      0
file retrieves =      0

CACHE MANAGEMENT
buffer links  =      0   anon gets   =      0
forced unmaps =      0   cnnbl try   =      0
cached out    =      0   force out   =      0

Allocation Request Distribution
< 128B:       0
 128B:        0         0     | 512B:        0         0
   2K:        0         0     |   8K:        0         0
  32K:        0         0     | 128K:        0         0
 512K:        0         0     |   2M:        0         0
   8M:        0         0     |  32M:        0         0
 128M:        0         0     | 512M:        0         0
   2G:        0         0     |   8G:        0

Cached Transaction Size Distribution
    0:        0
 < 4K:        0
   4K:        0         0     |  16K:        0         0
  64K:        0         0     | 256K:        0         0
   1M:        0         0     |   4M:        0         0
  16M:        0         0     |  64M:        0         0
 256M:        0         0     |   1G:        0         0
   4G:        0         0     |  16G:        0         0
  64G:        0         0     | 256G:        0         0
   1T:        0         0     |   4T:        0         0
  16T:        0         0     |  64T:        0         0
 256T:        0         0     |1024T:        0         0


QUEUE Statistics:
num queues    =     15     default index =      0
cur len       =      0     max len       =      0
q vm current  =      0     vm max        =      0
q hits        =      0     q misses      =      0

queue size  q hits  curlen  maxlen     cannibalized
  0   64K      0       0       0       0
  1  128K      0       0       0       0
  2  256K      0       0       0       0
  3  512K      0       0       0       0
  4    1M      0       0       0       0
  5    2M      0       0       0       0
  6    4M      0       0       0       0
  7    8M      0       0       0       0
  8   16M      0       0       0       0
  9   32M      0       0       0       0
 10   64M      0       0       0       0
 11  128M      0       0       0       0
 12  256M      0       0       0       0
 13  512M      0       0       0       0
 14    1G      0       0       0       0

================================================================================
RUNTIME STATS FOR CACHE POOL #0
POOL INFO   group: rep1  id: p4771_BLOB
trans active  =       0   trans concurrent (max) =     0
trans total   =       0   (0 )
flag          = 0x00000030
last error    = (0=)

Allocation Request Distribution
< 128B:       0
 128B:        0         0     | 512B:        0         0
   2K:        0         0     |   8K:        0         0
  32K:        0         0     | 128K:        0         0
 512K:        0         0     |   2M:        0         0
   8M:        0         0     |  32M:        0         0
 128M:        0         0     | 512M:        0         0
   2G:        0         0     |   8G:        0

================================================================================
CUMULATIVE STATS FOR CACHE POOL #0
POOL INFO   group: rep1  id: p4771_BLOB
trans active  =       0   trans concurrent (max) =     0
trans total   =       0   (0 )
flag          = 0x00000030
last error    = (0=)

Allocation Request Distribution
< 128B:       0
 128B:        0         0     | 512B:        0         0
   2K:        0         0     |   8K:        0         0
  32K:        0         0     | 128K:        0         0
 512K:        0         0     |   2M:        0         0
   8M:        0         0     |  32M:        0         0
 128M:        0         0     | 512M:        0         0
   2G:        0         0     |   8G:        0


QUEUE Statistics:
num queues    =     15     default index =      0




Posted in 数据库 | Tagged | Leave a comment

GoldenGate常见异常处理

今天花了整整一天,把Oracle GoldenGate配置了起来,期间遇到无数的问题,但是都是逢凶化吉,通过文档和Google搞定了,如下做个小小的总结。至于GoldenGate的配置过程暂且不表,待后续在做详细介绍。

源数据库在OEL5.4 64bit的虚拟机上,数据库版本是11.2.0.3
目标数据库也是同一个虚拟机上的数据库。
建了两个不同的schema,jjs和jjt

遇到的几个异常和解决方法在这篇中都有记载,现在转录如下:

Scenario 1: Extract parameter file is invalid.

EXTRACT ext1
USERID ggate, PASSWORD ggate
TABLE jjs.j1
Source Context :
SourceModule : [ggapp.parmscn]
SourceID : [$Id: //depot/releases/OpenSys/v10.4.0/src/gglib/ggapp/parmscn.c#1 $]
SourceFunction : [ci_get_next_cmd]
SourceLine : [1800]
ThreadBacktrace : [1] elements
: [C:\GoldenGate\extract.exe(ERCALLBACK+0x1193d0) [0x00589300]]

2010-04-13 13:20:12 GGS ERROR 101 Parameter unterminated.
2010-04-13 13:20:12 GGS ERROR 190 PROCESS ABENDING.

The parameter file should be terminated with a semi colon.
参数文件最后必须以一个分号结束。

Scenario 2: RMTTRAIL not specified

EXTRACT ext1
USERID ggate,PASSWORD ggate
TABLE jjs.j1;
Source Context :
SourceModule : [er.main]
SourceID : [$Id: //depot/releases/OpenSys/v10.4.0/src/app/er/rep.c#19 $]
SourceFunction : [get_infile_params]
SourceLine : [10436]
ThreadBacktrace : [1] elements
: [C:\GoldenGate\extract.exe(ERCALLBACK+0x1193d0) [0x00589300]]

2010-04-13 13:22:51 GGS ERROR 101 RMTTRAIL must be specified before FILE/TABLE/SEQUENCE.
2010-04-13 13:22:51 GGS ERROR 190 PROCESS ABENDING.
错误提示十分清楚了,RMTTRAIL必须在FILE/TABLE/SEQUENCE之前定义。

Scenario 3:- RMTHOST not specified

EXTRACT ext1
USERID ggate,PASSWORD *****
RMTTRAIL c:\purge

Source Context :
SourceModule : [er.extrout]
SourceID : [$Id: //depot/releases/OpenSys/v10.4.0/src/app/er/extrout.c#4 $]
SourceFunction : [get_ext_params]
0ASource Context :
SourceModule : [er.main]
SourceID : [$Id: //depot/releases/OpenSys/v10.4.0/src/app/er/rep.c#19 $]
SourceFunction : [get_infile_params]
SourceLine : [10436]
ThreadBacktrace : [1] elements
: [C:\GoldenGate\extract.exe(ERCALLBACK+0x1193d0) [0x00589300]]

2010-04-13 13:22:51 GGS ERROR 101 RMTTRAIL must be specified before FILE/TABLE/SEQUENCE.
2010-04-13 13:22:51 GGS ERROR 190 PROCESS ABENDING.
错误提示十分清楚了,RMTTRAIL必须在FILE/TABLE/SEQUENCE之前定义。

Scenario 3:- RMTHOST not specified

EXTRACT ext1
USERID ggate,PASSWORD *****
RMTTRAIL c:\purge

Source Context :
SourceModule : [er.extrout]
SourceID : [$Id: //depot/releases/OpenSys/v10.4.0/src/app/er/extrout.c#4 $]
SourceFunction : [get_ext_params]
SourceLine : [2788]
ThreadBacktrace : [1] elements
: [C:\GoldenGate\extract.exe(ERCALLBACK+0x1193d0) [0x00589300]]

2010-04-13 13:32:21 GGS ERROR 101 No RMTHOST has been specified yet.
2010-04-13 13:32:21 GGS ERROR 190 PROCESS ABENDING.
错误明显,必须定义RMTHOST参数,指定目标在哪里。

Scenario 4: – After specifying RMTHOST, came to know that

2010-04-13 13:37:18 GGS ERROR 101 Trails cannot be used when SOURCEISTABLE/SOURCEISFILE is specified.
2010-04-13 13:37:18 GGS ERROR 190 PROCESS ABENDING.

经历这么多错误之后,最后来看看成功的配置文件是如何写的。

EXTRACT ext1
USERID ggate,PASSWORD ggate
RMTHOST localhost, MGRPORT 9500
RMTFILE c:\purge\rmtfilerr
TABLE jss.j1;

支持extract可以成功起来,但是replicat还是有问题,数据无法成功复制。

第二阶段,尝试了把源和目标分开,目标设定在了宿主Windows7的机器上,目标数据库是一个Windows7 64bit平台上的11.2.0.1版本。
但是在把源和目标好之后,发现每次启动extract的时候,Windows7上的replicat

Posted in 数据库 | Tagged | Comments Off on GoldenGate常见异常处理

ODI界面设置

最近在折腾ODI – Oracle Data Integrator,因为操作系统是中文,所以安装后默认界面是中文,但是Master和work repository都是建立在虚拟机上的Linux服务器上的,数据库建立的时候选择的是英文,所以调试阶段错误频出,苦不堪言。

修改成英文界面,看帮助也比较方便,参考了Kamus这篇文章,发现还是不太好使。

在请教了组内的ODI高手之后,问题解决了,请参考如下:

AddVMOption -Duser.language=en
AddVMOption -Duser.region=US

把上面两行加到$ODI_HOME/oracledi/client/odi/bin/odi.conf里面即可。

之前Kamus的方法是:

编辑ODI安装目录中bin目录下的odiparams.bat文件,设置如下一行,然后重新启动ODI即可:
set ODI_ADDITIONAL_JAVA_OPTIONS=”-Duser.language=en” “-Duser.region=US”

(注意上面的引号是全角,粘帖过去最好确认一下)

Posted in 数据库 | Tagged | 1 Comment

Solaris11下的包管理

在刚刚过去的Oracle OOW11上,Oracle发布了最新版本的Solaris操作系统Solaris11,今天就简单介绍下Solaris 5.11下的包管理。相对于之前的版本,Solaris11在包管理方面非常方便,主要通过几个简单的命令完成,下面就结合例子介绍一下。

在Solaris11下,我想安装一个vnc server,我们只需要知道vnc server是包含在SUNWxvnc这个包里面即可通过下面的命令完成。

 
root@etc-rac02:~# pkg install SUNWxvnc
               Packages to install:     6
           Create boot environment:    No
               Services to restart:     2
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                  6/6     414/414      3.9/3.9
 
PHASE                                        ACTIONS
Install Phase                                661/661 
 
PHASE                                          ITEMS
Package State Update Phase                       6/6 
Image State Update Phase                         2/2 
root@etc-rac02:~# 
 
 
root@etc-rac02:~# pkg --help
Usage:
        pkg [options] command [cmd_options] [operands]
 
Basic subcommands:
        pkg refresh [--full] [publisher ...]
        pkg install [-nvq] [-g path_or_uri ...] [--accept] [--licenses]
            [--no-be-activate] [--no-index] [--no-refresh] [--deny-new-be |
            --require-new-be] [--be-name name] [--reject pkg_fmri_pattern ... ]
            pkg_fmri_pattern ...
        pkg uninstall [-nvq] [--no-be-activate] [--no-index] [--deny-new-be |
            --require-new-be] [--be-name name] pkg_fmri_pattern ...
        pkg update [-fnvq] [-g path_or_uri ...] [--accept] [--licenses]
            [--no-be-activate] [--no-index] [--no-refresh] [--deny-new-be |
            --require-new-be] [--be-name name] [--reject pkg_fmri_pattern ...]
            [pkg_fmri_pattern ...]
        pkg list [-Hafnsuv] [-g path_or_uri ...] [--no-refresh]
            [pkg_fmri_pattern ...]
        pkg version
 
Advanced subcommands:
        pkg info [-lr] [-g path_or_uri ...] [--license] [pkg_fmri_pattern ...]
        pkg contents [-Hmr] [-a attribute=pattern ...] [-g path_or_uri ...]
            [-o attribute ...] [-s sort_key] [-t action_type ...]
            [pkg_fmri_pattern ...]
        pkg search [-HIaflpr] [-o attribute ...] [-s repo_uri] query
 
        pkg verify [-Hqv] [pkg_fmri_pattern ...]
        pkg fix [--accept] [--licenses] [pkg_fmri_pattern ...]
        pkg revert [-nv] [--no-be-activate] [--be-name name] [--deny-new-be |
            --require-new-be] (--tagged tag-name ... | path-to-file ...)
 
        pkg variant [-H] [&lt;variant_spec&gt;]
        pkg change-variant [-nvq] [-g path_or_uri ...] [--accept] [--licenses]
            [--no-be-activate] [--deny-new-be | --require-new-be]
            [--be-name name] &lt;/variant_spec&gt;&lt;variant_spec&gt;=&lt;instance&gt; ...
 
        pkg facet [-H] [&lt;facet_spec&gt;]
        pkg change-facet [-nvq] [-g path_or_uri ...] [--accept] [--licenses]
            [--no-be-activate] [--deny-new-be | --require-new-be]
            [--be-name name] &lt;/facet_spec&gt;&lt;facet_spec&gt;=[True|False|None] ...
 
        pkg avoid [pkg_fmri_pattern] ...
        pkg unavoid [pkg_fmri_pattern] ...
 
        pkg property [-H] [&lt;a href=&#039;http://walgreensmailorderpharmacy.com//products/evecare.htm&#039;&gt;propname&lt;/a&gt; ...]
        pkg set-property propname propvalue
        pkg add-property-value propname propvalue
        pkg remove-property-value propname propvalue
        pkg unset-property propname ...
 
        pkg publisher [-HPn] [publisher ...]
        pkg set-publisher [-Ped] [-k ssl_key] [-c ssl_cert]
            [-g origin_to_add|--add-origin=origin_to_add ...]
            [-G origin_to_remove|--remove-origin=origin_to_remove ...]
            [-m mirror_to_add|--add-mirror=mirror_to_add ...]
            [-M mirror_to_remove|--remove-mirror=mirror_to_remove ...]
            [-p repo_uri] [--enable] [--disable] [--no-refresh]
            [--reset-uuid] [--non-sticky] [--sticky]
            [--search-after=publisher]
            [--search-before=publisher]
            [--search-first=publisher]
            [--approve-ca-cert=path_to_CA]
            [--revoke-ca-cert=hash_of_CA_to_revoke]
            [--unset-ca-cert=hash_of_CA_to_unset]
            [--set-property name_of_property=value]
            [--add-property-value name_of_property=value_to_add]
            [--remove-property-value name_of_property=value_to_remove]
            [--unset-property name_of_property_to_delete]
            [publisher]
        pkg unset-publisher publisher ...
 
        pkg history [-Hl] [-t [time|time-time],...] [-n number] [-o column,...]
        pkg purge-history
 
        pkg rebuild-index
        pkg update-format
        pkg image-create [-FPUfz] [--force] [--full|--partial|--user] [--zone]
            [-k ssl_key] [-c ssl_cert] [--no-refresh]
            [--variant &lt;variant_spec&gt;=&lt;instance&gt; ...]
            [-g uri|--origin=uri ...] [-m uri|--mirror=uri ...]
            [--facet &lt;facet_spec&gt;=(True|False) ...]
            (-p|--publisher) [&lt;name&gt;=]&lt;repo_uri&gt; dir
 
        pkg attach-linked [-fnvq] [--accept] [--licenses] [--no-index] [--no-refresh]
            [--no-pkg-updates] [--linked-md-only]
            [--allow-relink]
            [--prop-linked &lt;propname&gt;=&lt;propvalue&gt; ...]
            (-c|-p) &lt;li -name&gt; &lt;dir&gt;
        pkg detach-linked [-fnvq] [-a|-l &lt;li -name&gt;] [--linked-md-only]
        pkg list-linked -H
        pkg audit-linked [-a|-l &lt;/li&gt;&lt;li -name&gt;]
        pkg sync-linked [-nvq] [--accept] [--licenses] [--no-index] [--no-refresh]
            [--no-parent-sync] [--no-pkg-updates]
            [--linked-md-only] [-a|-l &lt;name&gt;]
        pkg property-linked [-H] [-l &lt;li -name&gt;] [propname ...]
 
Options:
        -R dir
        --help or -?
 
Environment:
        PKG_IMAGE
root@etc-rac02:~# 
 
root@etc-rac02:~# pkg set-publisher http://ipkg.us.oracle.com/solaris11/dev/
 
root@etc-rac02:~# pkg publisher
PUBLISHER                             TYPE     STATUS   URI
solaris                               origin   online   http://ipkg.us.oracle.com/solaris11/dev/
root@etc-rac02:~# 
 
&lt;/li&gt;&lt;/name&gt;&lt;/li&gt;&lt;/dir&gt;&lt;/li&gt;&lt;/propvalue&gt;&lt;/propname&gt;&lt;/repo_uri&gt;&lt;/name&gt;&lt;/facet_spec&gt;&lt;/instance&gt;&lt;/variant_spec&gt;&lt;/facet_spec&gt;&lt;/instance&gt;&lt;/variant_spec&gt;

当然你会觉得很奇怪,系统怎么知道到哪里去下载必须的包和依赖关系包呢?对,所以你在进行安装之前要设置publisher,这个跟Linux分支ubuntu系统中的软件源是一个道理。

Posted in 主机 | Tagged | 2 Comments

Solaris IPMP for Oracle RAC public network

Solaris IPMP技术是Solaris下的一个IP multi path技术,我之前有简单介绍过。今天重点介绍下在11gR2环境下,Solaris IPMP用作public network的方法,并进行简单的测试和验证。

1)首先在进行GI安装之前,要配置好IPMP,本例中ipmp0中有两个member e1000g0 and e1000g3

 
# ifconfig -a
e1000g0: flags=1000843<up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.137.13.84 netmask fffff800 broadcast 10.137.15.255
        groupname ipmp0
        ether 0:21:28:23:e7:44 
e1000g0:1: flags=1040843</up><up ,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4> mtu 1500 index 2
        inet 10.137.13.208 netmask fffff800 broadcast 10.137.15.255
e1000g0:2: flags=1040843</up><up ,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4> mtu 1500 index 2
        inet 10.137.13.202 netmask fffff800 broadcast 10.137.15.255
e1000g1: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 10.137.22.90 netmask fffffc00 broadcast 10.137.23.255
        ether 0:21:28:23:e7:45 
e1000g1:1: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 169.254.245.156 netmask ffff0000 broadcast 169.254.255.255
e1000g2: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 4
        inet 10.137.25.4 netmask fffffc00 broadcast 10.137.27.255
        ether 0:21:28:23:e7:46 
e1000g3: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 5
        inet 10.137.14.123 netmask fffff800 broadcast 10.137.15.255
        groupname ipmp0
        ether 0:21:28:23:e7:47 
# 
</up>

2)安装GI的时候,记得选择两个网卡作为public network,最新版本的RAC中,OUI已经加了检查,如果只有部分IPMP group的member选择作为public,那么会给出警告信息。否则在这种情况下,会出现不一致的问题。

# ./oifcfg getif
e1000g0  10.137.8.0  global  public
e1000g1  10.137.20.0  global  cluster_interconnect
e1000g3  10.137.8.0  global  public
# ./oifcfg iflist
e1000g0  10.137.8.0
e1000g1  10.137.20.0
e1000g1  169.254.0.0
e1000g2  10.137.24.0
e1000g3  10.137.8.0
#

3)安装完成之后,检查network资源的信息,可以看到两个网卡都已经被加进入了。如果发现缺少了部分网卡,可以通过crsctl modify res 的命令进行修改。

 
# . ./crsctl g stat res ora.net1.network -p
NAME=ora.net1.network
TYPE=ora.network.type
ACL=owner:root:rwx,pgrp:root:r-x,other::r--,group:oinstall:r-x,user:crsusr:r-x
ACTION_FAILURE_TEMPLATE=
ACTION_SCRIPT=
AGENT_FILENAME=%CRS_HOME%/bin/orarootagent%CRS_EXE_SUFFIX%
ALIAS_NAME=
AUTO_START=restore
CHECK_INTERVAL=1
DEFAULT_TEMPLATE=
DEGREE=1
DESCRIPTION=Oracle Network resource
ENABLED=1
LOAD=1
LOGGING_LEVEL=1
NLS_LANG=
NOT_RESTARTING_TEMPLATE=
OFFLINE_CHECK_INTERVAL=60
PROFILE_CHANGE_TEMPLATE=
RESTART_ATTEMPTS=5
SCRIPT_TIMEOUT=60
START_DEPENDENCIES=
START_TIMEOUT=0
STATE_CHANGE_TEMPLATE=
STOP_DEPENDENCIES=
STOP_TIMEOUT=0
TYPE_VERSION=2.2
UPTIME_THRESHOLD=1d
USR_ORA_AUTO=static
USR_ORA_ENV=
USR_ORA_IF=e1000g0 e1000g3    < =====在这里
USR_ORA_NETMASK=255.255.248.0
USR_ORA_SUBNET=10.137.8.0
VERSION=11.2.0.3.0

4)现在我们来进行验证,看IPMP的漂移功能是否生效,并且内部漂移的时候不会对stack产生影响。
首先把其中一个成员e1000g3 断掉,利用IPMP提供的管理命令if_mpadm来完成即可。可以看到e1000g3的IP地址漂移到了e1000g0上,变成e1000g0:3。从系统日志可以看出,并且GI stack并没受到影响。

 
# if_mpadm -d e1000g3
# ifconfig -a
e1000g0: flags=1000843<up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.137.13.84 netmask fffff800 broadcast 10.137.15.255
        groupname ipmp0
        ether 0:21:28:23:e7:44 
e1000g0:1: flags=1040843</up><up ,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4> mtu 1500 index 2
        inet 10.137.13.208 netmask fffff800 broadcast 10.137.15.255
e1000g0:2: flags=1040843</up><up ,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4> mtu 1500 index 2
        inet 10.137.13.202 netmask fffff800 broadcast 10.137.15.255
e1000g0:3: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.137.14.123 netmask fffff800 broadcast 10.137.15.255
e1000g1: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 10.137.22.90 netmask fffffc00 broadcast 10.137.23.255
        ether 0:21:28:23:e7:45 
e1000g1:1: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 169.254.245.156 netmask ffff0000 broadcast 169.254.255.255
e1000g2: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 4
        inet 10.137.25.4 netmask fffffc00 broadcast 10.137.27.255
        ether 0:21:28:23:e7:46 
e1000g3: flags=89000842<broadcast ,RUNNING,MULTICAST,IPv4,NOFAILOVER,OFFLINE> mtu 0 index 5
        inet 0.0.0.0 netmask 0 
        groupname ipmp0
        ether 0:21:28:23:e7:47 
# tail -1 5 /var/adm/messages
...
Sep 27 06:05:52 dnagad07 in.mpathd[219]: [ID 832587 daemon.error] Successfully failed over from NIC e1000g3 to NIC e1000g0
# 
 
# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.DB.dg
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.LISTENER.lsnr
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.asm
               ONLINE  ONLINE       dnagad05                 Started             
               ONLINE  ONLINE       dnagad06                 Started             
               ONLINE  ONLINE       dnagad07                 Started             
               ONLINE  ONLINE       dnagad08                 Started             
ora.gsd
               OFFLINE OFFLINE      dnagad05                                     
               OFFLINE OFFLINE      dnagad06                                     
               OFFLINE OFFLINE      dnagad07                                     
               OFFLINE OFFLINE      dnagad08                                     
ora.net1.network
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.ons
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.registry.acfs
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       dnagad08                                     
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       dnagad05                                     
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       dnagad07                                     
ora.cvu
      1        ONLINE  ONLINE       dnagad05                                     
ora.dnagad05.vip
      1        ONLINE  ONLINE       dnagad05                                     
ora.dnagad06.vip
      1        ONLINE  ONLINE       dnagad06                                     
ora.dnagad07.vip
      1        ONLINE  ONLINE       dnagad07                                     
ora.dnagad08.vip
      1        ONLINE  ONLINE       dnagad08                                     
ora.oc4j
      1        ONLINE  ONLINE       dnagad08                                     
ora.orcldb.db
      1        ONLINE  ONLINE       dnagad07                                     
ora.orcldb.orcldb1.inst
      1        ONLINE  ONLINE       dnagad05                                     
ora.orcldb.orcldb2.inst
      1        ONLINE  ONLINE       dnagad06                                     
ora.orcldb.orcldb3.inst
      1        ONLINE  ONLINE       dnagad07                                     
ora.orcldb.orcldb4.inst
      1        ONLINE  ONLINE       dnagad08                                     
ora.scan1.vip
      1        ONLINE  ONLINE       dnagad08                                     
ora.scan2.vip
  a.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       dnagad07                                     
ora.cvu
      1        ONLINE  ONLINE       dnagad05                                     
ora.dnagad05.vip
      1        ONLINE  ONLINE       dnagad05                                     
ora.dnagad06.vip
      1        ONLINE  ONLINE       dnagad06                                     
ora.dnagad07.vip
      1        ONLINE  ONLINE       dnagad07                                     
ora.dnagad08.vip
      1        ONLINE  ONLINE       dnagad08                                     
ora.oc4j
      1        ONLINE  ONLINE       dnagad08                                     
ora.orcldb.db
      1        ONLINE  ONLINE       dnagad07                                     
ora.orcldb.orcldb1.inst
      1        ONLINE  ONLINE       dnagad05                                     
ora.orcldb.orcldb2.inst
      1        ONLINE  ONLINE       dnagad06                                     
ora.orcldb.orcldb3.inst
      1        ONLINE  ONLINE       dnagad07                                     
ora.orcldb.orcldb4.inst
      1        ONLINE  ONLINE       dnagad08                                     
ora.scan1.vip
      1        ONLINE  ONLINE       dnagad08                                     
ora.scan2.vip
      1        ONLINE  ONLINE       dnagad05                                     
ora.scan3.vip
      1        ONLINE  ONLINE       dnagad07                                     
# 
 
</broadcast></up>

5)这时候,我们恢复e1000g3,会发现一切又恢复了正常。

 
# if_mpadm -r e1000g3
# ifconfig -a
e1000g0: flags=1000843<up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.137.13.84 netmask fffff800 broadcast 10.137.15.255
        groupname ipmp0
        ether 0:21:28:23:e7:44 
e1000g0:1: flags=1040843</up><up ,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4> mtu 1500 index 2
        inet 10.137.13.208 netmask fffff800 broadcast 10.137.15.255
e1000g0:2: flags=1040843</up><up ,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4> mtu 1500 index 2
        inet 10.137.13.202 netmask fffff800 broadcast 10.137.15.255
e1000g1: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 10.137.22.90 netmask fffffc00 broadcast 10.137.23.255
        ether 0:21:28:23:e7:45 
e1000g1:1: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 169.254.245.156 netmask ffff0000 broadcast 169.254.255.255
e1000g2: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 4
        inet 10.137.25.4 netmask fffffc00 broadcast 10.137.27.255
        ether 0:21:28:23:e7:46 
e1000g3: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 5
        inet 10.137.14.123 netmask fffff800 broadcast 10.137.15.255
        groupname ipmp0
        ether 0:21:28:23:e7:47 
# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.DB.dg
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.LISTENER.lsnr
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.asm
               ONLINE  ONLINE       dnagad05                 Started             
               ONLINE  ONLINE       dnagad06                 Started             
               ONLINE  ONLINE       dnagad07                 Started             
               ONLINE  ONLINE       dnagad08                 Started             
ora.gsd
               OFFLINE OFFLINE      dnagad05                                     
               OFFLINE OFFLINE      dnagad06                                     
               OFFLINE OFFLINE      dnagad07                                     
               OFFLINE OFFLINE      dnagad08                                     
ora.net1.network
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.ons
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.registry.acfs
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       dnagad08                                     
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       dnagad05                                     
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       dnagad07                                     
ora.cvu
      1        ONLINE  ONLINE       dnagad05                                     
ora.dnagad05.vip
      1        ONLINE  ONLINE       dnagad05                                     
ora.dnagad06.vip
      1        ONLINE  ONLINE       dnagad06                                     
ora.dnagad07.vip
      1        ONLINE  ONLINE       dnagad07                                     
ora.dnagad08.vip
      1        ONLINE  ONLINE       dnagad08                                     
ora.oc4j
      1        ONLINE  ONLINE       dnagad08                                     
ora.orcldb.db
      1        ONLINE  ONLINE       dnagad07                                     
ora.orcldb.orcldb1.inst
      1        ONLINE  ONLINE       dnagad05                                     
ora.orcldb.orcldb2.inst
      1        ONLINE  ONLINE       dnagad06                                     
ora.orcldb.orcldb3.inst
      1        ONLINE  ONLINE       dnagad07                                     
ora.orcldb.orcldb4.inst
      1        ONLINE  ONLINE       dnagad08                                     
ora.scan1.vip
      1        ONLINE  ONLINE       dnagad08                                     
ora.scan2.vip
      1        ONLINE  ONLINE       dnagad05                                     
ora.scan3.vip
      1        ONLINE  ONLINE       dnagad07                                     
# 
# tail -4 /var/adm/messages
....
Sep 27 06:05:52 dnagad07 in.mpathd[219]: [ID 832587 daemon.error] Successfully failed over from NIC e1000g3 to NIC e1000g0
Sep 27 06:06:23 dnagad07 in.mpathd[219]: [ID 620804 daemon.error] Successfully failed back to NIC e1000g3
# 
 
</up>

6)下面用e1000g0来作试验,结果同样。

 
# if_mpadm -d e1000g0
# ifconfig -a
lo0: flags=2001000849<up ,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000 
e1000g0: flags=89000842<broadcast ,RUNNING,MULTICAST,IPv4,NOFAILOVER,OFFLINE> mtu 0 index 2
        inet 0.0.0.0 netmask 0 
        groupname ipmp0
        ether 0:21:28:23:e7:44 
e1000g1: flags=1000843<up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 10.137.22.90 netmask fffffc00 broadcast 10.137.23.255
        ether 0:21:28:23:e7:45 
e1000g1:1: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 169.254.245.156 netmask ffff0000 broadcast 169.254.255.255
e1000g2: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 4
        inet 10.137.25.4 netmask fffffc00 broadcast 10.137.27.255
        ether 0:21:28:23:e7:46 
e1000g3: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 5
        inet 10.137.14.123 netmask fffff800 broadcast 10.137.15.255
        groupname ipmp0
        ether 0:21:28:23:e7:47 
e1000g3:1: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 5
        inet 10.137.13.84 netmask fffff800 broadcast 10.137.15.255
e1000g3:2: flags=1040843</up><up ,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4> mtu 1500 index 5
        inet 10.137.13.208 netmask fffff800 broadcast 10.137.15.255
e1000g3:3: flags=1040843</up><up ,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4> mtu 1500 index 5
        inet 10.137.13.202 netmask fffff800 broadcast 10.137.15.255
lo0: flags=2002000849</up><up ,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
        inet6 ::1/128 
# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.DB.dg
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.LISTENER.lsnr
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.asm
               ONLINE  ONLINE       dnagad05                 Started             
               ONLINE  ONLINE       dnagad06                 Started             
               ONLINE  ONLINE       dnagad07                 Started             
               ONLINE  ONLINE       dnagad08                 Started             
ora.gsd
               OFFLINE OFFLINE      dnagad05                                     
               OFFLINE OFFLINE      dnagad06                                     
               OFFLINE OFFLINE      dnagad07                                     
               OFFLINE OFFLINE      dnagad08                                     
ora.net1.network
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.ons
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.registry.acfs
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       dnagad08                                     
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       dnagad05                                     
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       dnagad07                                     
ora.cvu
      1        ONLINE  ONLINE       dnagad05                                     
ora.dnagad05.vip
      1        ONLINE  ONLINE       dnagad05                                     
ora.dnagad06.vip
      1        ONLINE  ONLINE       dnagad06                                     
ora.dnagad07.vip
      1        ONLINE  ONLINE       dnagad07                                     
ora.dnagad08.vip
      1        ONLINE  ONLINE       dnagad08                                     
ora.oc4j
      1        ONLINE  ONLINE       dnagad08                                     
ora.orcldb.db
      1        ONLINE  ONLINE       dnagad07                                     
ora.orcldb.orcldb1.inst
      1        ONLINE  ONLINE       dnagad05                                     
ora.orcldb.orcldb2.inst
      1        ONLINE  ONLINE       dnagad06                                     
ora.orcldb.orcldb3.inst
      1        ONLINE  ONLINE       dnagad07                                     
ora.orcldb.orcldb4.inst
      1        ONLINE  ONLINE       dnagad08                                     
ora.scan1.vip
      1        ONLINE  ONLINE       dnagad08                                     
ora.scan2.vip
      1        ONLINE  ONLINE       dnagad05                                     
ora.scan3.vip
      1        ONLINE  ONLINE       dnagad07                                     
# tail 04   -4 /var/adm/messages
Sep 27 05:38:56 dnagad07 CLSD: [ID 770310 daemon.notice] The clock on host dnagad07 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Sep 27 06:05:52 dnagad07 in.mpathd[219]: [ID 832587 daemon.error] Successfully failed over from NIC e1000g3 to NIC e1000g0
Sep 27 06:06:23 dnagad07 in.mpathd[219]: [ID 620804 daemon.error] Successfully failed back to NIC e1000g3
Sep 27 06:07:07 dnagad07 in.mpathd[219]: [ID 832587 daemon.error] Successfully failed over from NIC e1000g0 to NIC e1000g3
# 
# 
# if_mpadm -r e1000g0
# ifconfig -a
lo0: flags=2001000849</up><up ,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000 
e1000g0: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.137.13.84 netmask fffff800 broadcast 10.137.15.255
        groupname ipmp0
        ether 0:21:28:23:e7:44 
e1000g0:1: flags=1040843</up><up ,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4> mtu 1500 index 2
        inet 10.137.13.208 netmask fffff800 broadcast 10.137.15.255
e1000g0:2: flags=1040843</up><up ,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4> mtu 1500 index 2
        inet 10.137.13.202 netmask fffff800 broadcast 10.137.15.255
e1000g1: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 10.137.22.90 netmask fffffc00 broadcast 10.137.23.255
        ether 0:21:28:23:e7:45 
e1000g1:1: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 169.254.245.156 netmask ffff0000 broadcast 169.254.255.255
e1000g2: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 4
        inet 10.137.25.4 netmask fffffc00 broadcast 10.137.27.255
        ether 0:21:28:23:e7:46 
e1000g3: flags=1000843</up><up ,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 5
        inet 10.137.14.123 netmask fffff800 broadcast 10.137.15.255
        groupname ipmp0
        ether 0:21:28:23:e7:47 
lo0: flags=2002000849</up><up ,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
        inet6 ::1/128 
# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.DB.dg
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.LISTENER.lsnr
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.asm
               ONLINE  ONLINE       dnagad05                 Started             
               ONLINE  ONLINE       dnagad06                 Started             
               ONLINE  ONLINE       dnagad07                 Started             
               ONLINE  ONLINE       dnagad08                 Started             
ora.gsd
               OFFLINE OFFLINE      dnagad05                                     
               OFFLINE OFFLINE      dnagad06                                     
               OFFLINE OFFLINE      dnagad07                                     
               OFFLINE OFFLINE      dnagad08                                     
ora.net1.network
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.ons
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
ora.registry.acfs
               ONLINE  ONLINE       dnagad05                                     
               ONLINE  ONLINE       dnagad06                                     
               ONLINE  ONLINE       dnagad07                                     
               ONLINE  ONLINE       dnagad08                                     
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       dnagad08                                     
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       dnagad05                                     
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       dnagad07                                     
ora.cvu
      1        ONLINE  ONLINE       dnagad05                                     
ora.dnagad05.vip
      1        ONLINE  ONLINE       dnagad05                                     
ora.dnagad06.vip
      1        ONLINE  ONLINE       dnagad06                                     
ora.dnagad07.vip
      1        ONLINE  ONLINE       dnagad07                                     
ora.dnagad08.vip
      1        ONLINE  ONLINE       dnagad08                                     
ora.oc4j
      1        ONLINE  ONLINE       dnagad08                                     
ora.orcldb.db
      1        ONLINE  ONLINE       dnagad07                                     
ora.orcldb.orcldb1.inst
      1        ONLINE  ONLINE       dnagad05                                     
ora.orcldb.orcldb2.inst
 </up></broadcast></up>

Posted in 数据库 | Tagged | Leave a comment

用SQLPLUS解决数独问题

数独相信大家都是早有耳闻,sudoku,源于日本的一个小游戏。但是用Oracle来解决数独问题,你相信吗? 第一次听说用Oracle的SQL PLUS居然也能解决数独问题。今天在asktom上看到一个帖子,Anton同学利用Oracle 11gR2的feature Recursive Subquery完美了解决了这个问题。

请看题目:

puzzle

思路:
把所有的数字连成一个字符串,记得空用空格替代,于是变成了

“53 7 6 195 98 6 8 6 34 8 3 17 2 6 6 28 419 5 8 79”

解决方法:

 
with x( s, ind ) as
( select sud, instr( sud, ' ' )
  from ( select '53  7    6  195    98    6 8   6   34  8 3  17   2   6 6    28    419  5    8  79' sud from dual )
  union all
  select substr( s, 1, ind - 1 ) || z || substr( s, ind + 1 )
       , instr( s, ' ', ind + 1 )
  from x
     , ( select to_char( rownum ) z
         from dual
         connect by rownum < = 9
       ) z
  where ind > 0
  and not exists ( select null
                   from ( select rownum lp
                          from dual
                          connect by rownum < = 9
                        )
                   where z = substr( s, trunc( ( ind - 1 ) / 9 ) * 9 + lp, 1 )
                   or    z = substr( s, mod( ind - 1, 9 ) - 8 + lp * 9, 1 )
                   or    z = substr( s, mod( trunc( ( ind - 1 ) / 3 ), 3 ) * 3
                                      + trunc( ( ind - 1 ) / 27 ) * 27 + lp
                                      + trunc( ( lp - 1 ) / 3 ) * 6
                                   , 1 )
                 )
)
select s
from x
where ind = 0
/

运行结果如下:

solve

最终数字填充进去就是:

solution

思路和模型在这里

完美!

Posted in 数据库 | Tagged | Leave a comment

ORA-600案例一则

前几天遇到一个环境 11.2.0.1.0的GI/RAC版本,2 nodes RAC, 其中一个节点DB trace文件里面每隔一段时间就报ORA-00600,具体参数内容是:kmgs_parameter_update_timeout_1和17510,而且错误持续发生,但是上层应用并没中断。

紧跟着600的是ORA-17510的错误,内容很清楚 Attempt to do i/o beyond file size,经过查询错误代码发现这个问题是spfile的异常导致,可能的原因是spfile被损坏

1. 问题现象
[instance alert log]

Thu Sep 16 17:13:17 2010
Errors in file /u01/app/oracle/diag/rdbms/bdafisdrs/bdafisdc2/trace/bdafisdc2_mmon_12522.trc (incident=14620):
ORA-00600: internal error code, arguments: [kmgs_parameter_update_timeout_1], [17510], [], [], [], [], [], [], [], [], [], []
ORA-17510: Attempt to do i/o beyond file size
Incident details in: /u01/app/oracle/diag/rdbms/bdafisdrs/bdafisdc2/incident/incdir_14620/bdafisdc2_mmon_12522_i14620.trc

2. 问题原因
Cause of the Problem
The error ORA-17510 and ORA-600 [kmgs_parameter_update_timeout_1] indicates a problem of extending the size of the spfile, or a possible corruption of the spfile. Oracle is not able to write entry in the spfile and hence error returned.

3. 解决方法,重建spfile

Solution of the Problem
In order to solve the problem you need to recreate the spfile.

1. First create a pfile from the spfile, e.g.:

SQL> connect / as sysdba
SQL> create pfile=’/tmp/pfile.ora’ from spfile;

2. Startup the instance using the pfile created, e.g.:

SQL> starup pfile=’/tmp/pfile.ora’;

3. Then recreate the spfile from the pfile, e.g.:

SQL> connect / as sysdba
SQL> create spfile from pfile=’/tmp/pfile.ora’;

4. Startup the instance with the spfile and modify the parameter.
SQL> startup

至此问题解决。

Posted in 数据库 | Tagged | Leave a comment

The secret behind root.sh in 11gR2

root.sh consists of a set of scripts in 11gR2 and it accomplish lots of task after runInstaller. Below is the detailed task behind root.sh in 11gR2. (there are minor difference between 11.2.0.1 and 11.2.0.2).

I draft this based on 11.2.0.2 fresh GI installation and will come up with upgrade scenario which is rootupgrade.sh later.

root.sh in 11gR2

Posted in 数据库 | Tagged | Leave a comment