设为首页收藏本站

Botang唐波's Oracle Station

查看: 90|回复: 0

课程第47/48/49次(2018-10-21星期日上下午,2018-10-22星期一)

[复制链接]

744

主题

1117

帖子

8077

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
8077
发表于 2018-10-21 09:13:45 | 显示全部楼层 |阅读模式
  1. [root@station37 ~]# acfsutil  registry  -a -f /dev/asm/db_files-214   /u01/app/oracle/acfs_share
  2. acfsutil registry: ACFS-05062: cannot query CRS resource
复制代码
这是一个BUG:
Bug 13617861 - crs-210: could not find resource 'ora.registry.acfs' (11.2.0.4 only). (Or at least, it really looks like that.) This was fixed in 11.2.0.3.3.

-----------
修改环境做GNS:
反向域文件:
  1. for i in `seq 152 2 240`; do  echo  "@                                    IN  NS             gns$[ $i - 151 ].example.com."; done  >>  192.168.0.zone
复制代码
  1. for i in `seq 152 2 240`; do  echo  "$i                    IN  PTR         gns$[ $i - 151 ].example.com."; done    >> 192.168.0.zone
复制代码
正向域文件:
  1. for i in `seq 152 2 240`; do  echo  "@                                    IN  NS             gns$[ $i - 151 ].example.com."; done  >> example.com.zone
复制代码
  1. for i in `seq 152 2 240`; do  echo  "gns$[ $i - 151 ]                       0       IN  A           192.168.0.$i"; done  >> example.com.zone
复制代码

DHCP配置可以不改,但是如果要VIP/SCAN VIP都在100以后:
  1. # Stock gls /etc/dhcpd.conf for RH300 and other classes
  2. # : dhcpd.conf,v 1.1.2.2 2007/11/19 03:08:34 mcurry Exp $
  3. ddns-update-style none;
  4. subnet 192.168.0.0 netmask 255.255.255.0 {



  5. #       The following lines are standard all of the time.
  6.         option routers 192.168.0.254;
  7.         option subnet-mask 255.255.255.0;
  8.         option domain-name "example.com";
  9.         option domain-name-servers 192.168.0.254;
  10.         default-lease-time 21600;
  11.         max-lease-time 43200;

  12.         # Assign IPs 61-80 to Xen domUs
  13.         pool {
  14.                 allow unknown-clients;
  15.                 range 192.168.0.101 192.168.0.252;
  16.         }
  17.         # Assign IPs 1-20 for classroom systems unless
  18.         # static IPs are assigned below
  19.         pool {
  20.                 deny  unknown-clients;
  21.                 range  192.168.0.1 192.168.0.99;
  22.         }
  23. ......
复制代码

每一个节点、每一个客户端都要注意:
/etc/hosts里面不能出现VIP,
/etc/resolv.conf里都要指向所分配的GNS

每一个节点都不能自己启动eth0:XXX

a.png

安装12c GRID时,安装过程漫长的日志:
  1. [grid@station11 logs]$ pwd
  2. /u01/app/oraInventory/logs
  3. [grid@station11 log
复制代码

RAC里的SQUENCE:
  1. SQL> create sequence ps_seq  start with 100  minvalue 100  maxvalue 99999 increment by 1  cache 99900 order ;
复制代码
  1. [grid@station11 ~]$ crs_stat -t
  2. Name           Type           Target    State     Host        
  3. ------------------------------------------------------------
  4. ora.DATA.dg    ora....up.type ONLINE    ONLINE    station11   
  5. ora....ER.lsnr ora....er.type ONLINE    ONLINE    station11   
  6. ora....N1.lsnr ora....er.type ONLINE    ONLINE    station12   
  7. ora....N2.lsnr ora....er.type ONLINE    ONLINE    station11   
  8. ora....N3.lsnr ora....er.type ONLINE    ONLINE    station11   
  9. ora.MGMTLSNR   ora....nr.type ONLINE    ONLINE    station11   
  10. ora.asm        ora.asm.type   ONLINE    ONLINE    station11   
  11. ora.cvu        ora.cvu.type   ONLINE    ONLINE    station11   
  12. ora.gns        ora.gns.type   ONLINE    ONLINE    station11   
  13. ora.gns.vip    ora....ip.type ONLINE    ONLINE    station11   
  14. ora.mgmtdb     ora....db.type ONLINE    ONLINE    station11   
  15. ora....network ora....rk.type ONLINE    ONLINE    station11   
  16. ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    station11   
  17. ora.ons        ora.ons.type   ONLINE    ONLINE    station11   
  18. ora.scan1.vip  ora....ip.type ONLINE    ONLINE    station12   
  19. ora.scan2.vip  ora....ip.type ONLINE    ONLINE    station11   
  20. ora.scan3.vip  ora....ip.type ONLINE    ONLINE    station11   
  21. ora....SM1.asm application    ONLINE    ONLINE    station11   
  22. ora....11.lsnr application    ONLINE    ONLINE    station11   
  23. ora....n11.ons application    ONLINE    ONLINE    station11   
  24. ora....n11.vip ora....t1.type ONLINE    ONLINE    station11   
  25. ora....SM2.asm application    ONLINE    ONLINE    station12   
  26. ora....12.lsnr application    ONLINE    ONLINE    station12   
  27. ora....n12.ons application    ONLINE    ONLINE    station12   
  28. ora....n12.vip ora....t1.type ONLINE    ONLINE    station12  
复制代码

转Flex  ASM:
  1. [grid@station11 ~]$ asmcmd
  2. Connected to an idle instance.
  3. ASMCMD> showclustermode
  4. ASM cluster : Flex mode disabled
  5. ASMCMD> exit
复制代码
asmca

设置网卡:
1. 获取oifcfg的帮助:
  1. [grid@station11 ~]$ sudo oifcfg

  2. Name:
  3.         oifcfg - Oracle Interface Configuration Tool.

  4. Usage:  oifcfg iflist [-p [-n]]
  5. Shows the available interfaces that you can configure with 'setif' by querying the operating system to find which network interfaces are present on this node.

  6.         where -p displays a heuristic assumption of the interface type (PRIVATE, PUBLIC, or UNKNOWN).
  7.         -n displays the netmask.
  8.         oifcfg setif {-node <nodename> | -global} {<if_name>/<subnet>:<if_type>[,<if_type>...]}[,...]
  9.         oifcfg getif [-node <nodename> | -global] [ -if <if_name>[/<subnet>] [-type <if_type>] ]
  10.         oifcfg delif {{-node <nodename> | -global} [<if_name>[/<subnet>]] [-force] | -force}
  11.         oifcfg [-help]

  12.         <nodename> - name of the host, as known to a communications network
  13.         <if_name>  - name by which the interface is configured in the system
  14.         <subnet>   - subnet address of the interface
  15.         <if_type>  - one or more comma-separated interface types { cluster_interconnect | public | asm}
复制代码

2. 获取当前网络的信息:
  1. [grid@station11 ~]$ sudo oifcfg getif
  2. eth0  192.168.0.0  global  public
  3. eth1  172.31.118.0  global  cluster_interconnect
  4. *  172.31.118.0  global  cluster_interconnect,asm
  5. PRIF-29: Warning: wildcard in network parameters can cause mismatch among GPnP profile, OCR, and system.
复制代码

3. 把第三张网卡用上:
  1. [grid@station11 ~]$ sudo oifcfg setif -global eth2/172.31.118.0:cluster_interconnect,asm
复制代码

4.把*的网卡删掉:
  1. [grid@station11 ~]$ sudo oifcfg delif  -global */172.31.118.0
复制代码

5.把eth1编程带ASM的:
  1. [grid@station11 ~]$ sudo oifcfg setif -global eth1/172.31.118.0:cluster_interconnect,asm
  2. [grid@station11 ~]$ sudo oifcfg getif
  3. eth0  192.168.0.0  global  public
  4. eth1  172.31.118.0  global  cluster_interconnect,asm
  5. eth2  172.31.118.0  global  cluster_interconnect,asm
复制代码

集群的模式:
  1. [grid@station11 ~]$ crsctl get cluster mode status
  2. Cluster is running in "standard" mode
复制代码

验证GNS然后转集群模式:
  1. [grid@station11 ~]$ sudo  srvctl config gns
  2. GNS is enabled.
  3. GNS VIP addresses: 192.168.0.162
  4. Domain served by GNS: example.com
复制代码
  1. [grid@station11 ~]$ sudo  crsctl set cluster mode  flex
  2. CRS-4933: Cluster mode set to "flex"; restart Oracle High Availability Services on all nodes for cluster to run in "flex" mode.
复制代码

这时再运行:
  1. /u01/app/grid/cfgtoollogs/asmca/scripts/converttoFlexASM.sh
复制代码
成功转成Flex ASM和Flex Cluster:
  1. [grid@station11 ~]$ crsctl get cluster mode status
  2. Cluster is running in "flex" mode
  3. [grid@station11 ~]$ asmcmd
  4. ASMCMD> showclustermode
  5. ASM cluster : Flex mode enabled
  6. ASMCMD>
复制代码
策略管理的集群的策略集:
只要是Flex集群,就有以下默认两个Category:
  1. [grid@station12 ocrbackup]$ crsctl status category
  2. NAME=ora.hub.category
  3. ACL=owner:root:rwx,pgrp:root:r-x,other::r--
  4. ACTIVE_CSS_ROLE=hub
  5. EXPRESSION=

  6. NAME=ora.leaf.category
  7. ACL=owner:root:rwx,pgrp:root:r-x,other::r--
  8. ACTIVE_CSS_ROLE=leaf
  9. EXPRESSION=
复制代码
策略集管理Category,默认只有一个策略集管理两个策略(Free和Generic):
  1. [grid@station12 ocrbackup]$ crsctl status policyset
  2. ACL=owner:grid:rwx,pgrp:oinstall:rwx,other::r--
  3. LAST_ACTIVATED_POLICY=
  4. SERVER_POOL_NAMES=Free
  5. POLICY
  6.   NAME=Current
  7.   DESCRIPTION=This policy is built-in and managed automatically to reflect current configuration
  8.   SERVERPOOL
  9.     NAME=Free
  10.     IMPORTANCE=0
  11.     MAX_SIZE=-1
  12.     MIN_SIZE=0
  13.     SERVER_CATEGORY=
  14.     SERVER_NAMES=
  15.   SERVERPOOL
  16.     NAME=Generic
  17.     IMPORTANCE=0
  18.     MAX_SIZE=-1
  19.     MIN_SIZE=0
  20.     SERVER_CATEGORY=
  21.     SERVER_NAMES=
复制代码

/home/oracle/scripts/policysetfile.txt:
游客,本帖隐藏的内容需要积分高于 100 才可浏览,您当前积分为 0


什么服务器当作hub用,什么服务器当作leaf用:
  1. [grid@station11 ~]$ crsctl status category
  2. NAME=big
  3. ACL=owner:grid:rwx,pgrp:oinstall:rwx,other::r--
  4. ACTIVE_CSS_ROLE=hub
  5. EXPRESSION=

  6. NAME=ora.hub.category
  7. ACL=owner:root:rwx,pgrp:root:r-x,other::r--
  8. ACTIVE_CSS_ROLE=hub
  9. EXPRESSION=

  10. NAME=ora.leaf.category
  11. ACL=owner:root:rwx,pgrp:root:r-x,other::r--
  12. ACTIVE_CSS_ROLE=leaf
  13. EXPRESSION=

  14. [grid@station11 ~]$ crsctl status server -category big
  15. NAME=station11
  16. STATE=ONLINE

  17. NAME=station12
  18. STATE=ONLINE

  19. [grid@station11 ~]$ crsctl status server -category ora.hub.category
  20. NAME=station11
  21. STATE=ONLINE

  22. NAME=station12
  23. STATE=ONLINE

  24. [grid@station11 ~]$ crsctl status server -category ora.leaf.category
复制代码
  1. [grid@station11 ~]$ crsctl  modify
  2. Usage:
  3.   crsctl modify {resource|type|serverpool|policy|policyset} <name> <options>
  4. where
  5.     name         Name of the CRS entity
  6.     options      Options to be passed to the modify command

  7.     See individual CRS entity help for more details

  8.   crsctl modify wallet -type <wallet_type> <options>
  9. where
  10.     wallet_type   Type of wallet i.e. , APPQOSADMIN, APPQOSUSER, APPQOSDB, MGMTDB, OSUSER or CVUDB.
  11.     options       Options to be passed to the modify command

  12.   crsctl modify policyset {-attr "<attrName>=<value>[,...]" | -file <fileName>} [-ksp] [-f]
  13. where
  14.     attrName   Name of the policy set attribute, e.g. SERVER_POOL_NAMES, etc.
  15.     value      Value of the attribute
  16.     fileName   Name of text file containing policy set definition
  17.     -ksp       Keep server pools in the system
  18.     -f         Force option

  19.   crsctl modify category <categoryName> -attr "<attrName>=<value>[,...]" [-f] [-i]
  20. where
  21.     categoryName Name of server category to be modified
  22.     attrName     Attribute name
  23.     value        Attribute value
  24.     -f           Force option
  25.     -i           Fail if request cannot be processed immediately
  26. [grid@station11 ~][        DISCUZ_CODE_101        ]nbsp; crsctl modify policyset -file  policysetfile.txt
  27. [grid@station11 ~]$
复制代码

  1. [grid@station11 ~]$ crsctl status policyset
  2. ACL=owner:grid:rwx,pgrp:oinstall:rwx,other::r--
  3. LAST_ACTIVATED_POLICY=
  4. SERVER_POOL_NAMES=Free ora.racdbpool ora.rep
  5. POLICY
  6.   NAME=Current
  7.   DESCRIPTION=This policy is built-in and managed automatically to reflect current configuration
  8.   SERVERPOOL
  9.     NAME=Free
  10.     IMPORTANCE=0
  11.     MAX_SIZE=-1
  12.     MIN_SIZE=0
  13.     SERVER_CATEGORY=
  14.     SERVER_NAMES=
  15.   SERVERPOOL
  16.     NAME=Generic
  17.     IMPORTANCE=0
  18.     MAX_SIZE=-1
  19.     MIN_SIZE=0
  20.     SERVER_CATEGORY=
  21.     SERVER_NAMES=
  22. POLICY
  23.   NAME=day
  24.   DESCRIPTION=The day policy
  25.   SERVERPOOL
  26.     NAME=Free
  27.     IMPORTANCE=0
  28.     MAX_SIZE=-1
  29.     MIN_SIZE=0
  30.     SERVER_CATEGORY=
  31.     SERVER_NAMES=
  32.   SERVERPOOL
  33.     NAME=ora.racdbpool
  34.     IMPORTANCE=10
  35.     MAX_SIZE=5
  36.     MIN_SIZE=2
  37.     SERVER_CATEGORY=ora.hub.category
  38.     SERVER_NAMES=
  39.   SERVERPOOL
  40.     NAME=ora.rep
  41.     IMPORTANCE=0
  42.     MAX_SIZE=2
  43.     MIN_SIZE=1
  44.     SERVER_CATEGORY=ora.hub.category
  45.     SERVER_NAMES=
  46. POLICY
  47.   NAME=night
  48.   DESCRIPTION=The night policy
  49.   SERVERPOOL
  50.     NAME=Free
  51.     IMPORTANCE=0
  52.     MAX_SIZE=-1
  53.     MIN_SIZE=0
  54.     SERVER_CATEGORY=
  55.     SERVER_NAMES=
  56.   SERVERPOOL
  57.     NAME=ora.racdbpool
  58.     IMPORTANCE=0
  59.     MAX_SIZE=2
  60.     MIN_SIZE=1
  61.     SERVER_CATEGORY=ora.hub.category
  62.     SERVER_NAMES=
  63.   SERVERPOOL
  64.     NAME=ora.rep
  65.     IMPORTANCE=5
  66.     MAX_SIZE=2
  67.     MIN_SIZE=1
  68.     SERVER_CATEGORY=ora.hub.category
  69.     SERVER_NAMES=
  70. [grid@station11 ~]$ crsctl modify policyset -attr "LAST_ACTIVATED_POLICY=day"
  71. [grid@station11 ~]$
复制代码












回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Botang唐波's Oracle Station   

GMT+8, 2018-11-18 01:09 , Processed in 0.188032 second(s), 27 queries .

快速回复 返回顶部 返回列表