您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

Oracle 19.3 Sharding-安裝配置之04-(添加分片)

bubuko 2022/1/25 20:03:18 其他 字数 10483 阅读 633 来源 http://www.bubuko.com/infolist-5-1.html

1. 連接新分片主機,在其上註冊遠程調度程序代理,並在其上為oradata和fast_recovery_area創建目錄 2.创建系统管理的SDB 3.檢查 ...
  1. 連接新分片主機,在其上註冊遠程調度程序代理,並在其上為oradata和fast_recovery_area創建目錄
#sd05、sd06 上
#如下配置文件,不同机器 HOSTNAME、UNQNAME、SID 不同
[oracle@sc05 ~]$ cat /home/oracle/scripts/setEnv.sh
-----------------------------------------------------------------------------------
# Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=sd05
export ORACLE_UNQNAME=sh21
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.3.0/db_1
export ORACLE_SID=sh5

export PATH=/usr/sbin:/usr/local/bin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

alias sqlplus=‘rlwrap sqlplus‘
alias rman=‘rlwrap rman‘
-----------------------------------------------------------------------------------

$ schagent -start
$ schagent -status
--密码oracle和端口8080是在第7步创建shardcatalog时设置的(oracle 是指 agent_password):
$ echo oracle | schagent -registerdatabase sc01 8080

$ mkdir /u01/app/oracle/oradata
$ mkdir /u01/app/oracle/fast_recovery_area

2.创建系统管理的SDB

[gds@gsm01 ~]$ gdsctl
GDSCTL> set gsm -gsm sharddirector1
GDSCTL> connect mysdbadmin/oracle

GDSCTL> config shard
Name                Shard Group         Status    State       Region    Availability 
----                -----------         ------    -----       ------    ------------ 
sh1                 primary_shgrp       Ok        Deployed    region1   ONLINE       
sh2                 standby_shgrp       Ok        Deployed    region2   READ ONLY    
sh3                 primary_shgrp       Ok        Deployed    region1   ONLINE       
sh4                 standby_shgrp       Ok        Deployed    region2   READ ONLY 

#将每个分片的主机地址添加到有效节点,以检查目录中的注册(VNCR)列表,然后在主或备用分片组中创建分片
4. 将每个shard 地址添加到catalog 的 (VNCR) 列表,并且创建shard
GDSCTL> add invitednode sd05
GDSCTL> create shard -shardgroup primary_shgrp -destination sd05 -credential cre_reg1 -sys_password 123456
The operation completed successfully
DB Unique Name: sh21
GDSCTL> 
GDSCTL> add invitednode sd06
GDSCTL> create shard -shardgroup standby_shgrp -destination sd06 -credential cre_reg1 -sys_password 123456
The operation completed successfully
DB Unique Name: sh22


GDSCTL> config shard
Name                Shard Group         Status    State       Region    Availability 
----                -----------         ------    -----       ------    ------------ 
sh1                 primary_shgrp       Ok        Deployed    region1   ONLINE       
sh2                 standby_shgrp       Ok        Deployed    region2   READ ONLY    
sh21                primary_shgrp       U         none        region1   -            
sh22                standby_shgrp       U         none        region2   -            
sh3                 primary_shgrp       Ok        Deployed    region1   ONLINE       
sh4                 standby_shgrp       Ok        Deployed    region2   READ ONLY    


GDSCTL> config chunks
Chunks
------------------------
Database                      From      To        
--------                      ----      --        
sh1                           1         6         
sh2                           1         6         
sh3                           7         12        
sh4                           7         12        


GDSCTL> config vncr
Name                          Group ID                      
----                          --------                      
10.0.99.103                                                 
10.0.99.105                                                 
10.0.99.106                                                 
10.0.99.107                                                 
10.0.99.108                                                 
sd01                                                        
sd02                                                        
sd03                                                        
sd04                                                        
sd05                                                        
sd06                                                        


#运行DEPLOY命令以创建分片和副本。
#该DEPLOY命令需要一些时间才能运行,大约需要15到30分钟
GDSCTL> deploy
deploy: examining configuration...
deploy: deploying primary shard ‘sh21‘ ...
deploy: network listener configuration successful at destination ‘sd05‘
deploy: starting DBCA at destination ‘sd05‘ to create primary shard ‘sh21‘ ...
deploy: waiting for 1 DBCA primary creation job(s) to complete...
...
deploy: waiting for 1 DBCA primary creation job(s) to complete...
deploy: DBCA primary creation job succeeded at destination ‘sd05‘ for shard ‘sh21‘
deploy: deploying standby shard ‘sh22‘ ...
deploy: network listener configuration successful at destination ‘sd06‘
deploy: starting DBCA at destination ‘sd06‘ to create standby shard ‘sh22‘ ...
deploy: waiting for 1 DBCA standby creation job(s) to complete...
...
deploy: waiting for 1 DBCA standby creation job(s) to complete...
deploy: DBCA standby creation job succeeded at destination ‘sd06‘ for shard ‘sh22‘
deploy: requesting Data Guard configuration on shards via GSM
deploy: shards configured; background operations in progress
The operation completed successfully

3.檢查

[gds@gsm01 ~]$ gdsctl config shard
Name                Shard Group         Status    State       Region    Availability 
----                -----------         ------    -----       ------    ------------ 
sh1                 primary_shgrp       Ok        Deployed    region1   ONLINE       
sh2                 standby_shgrp       Ok        Deployed    region2   READ ONLY    
sh21                primary_shgrp       Ok        Deployed    region1   ONLINE       
sh22                standby_shgrp       Ok        Deployed    region2   READ ONLY    
sh3                 primary_shgrp       Ok        Deployed    region1   ONLINE       
sh4                 standby_shgrp       Ok        Deployed    region2   READ ONLY  

[gds@gsm01 ~]$ gdsctl config chunks -show_Reshard
Chunks
------------------------
Database                      From      To        
--------                      ----      --        
sh1                           1         4         
sh2                           1         4         
sh21                          5         6         
sh22                          5         6         
sh3                           7         12        
sh4                           7         12        

Ongoing chunk movement
------------------------
Chunk     Source                        Target                        status    
-----     ------                        ------                        ------    
5         sh1                           sh21                          Moved     
11        sh3                           sh21                          scheduled 
12        sh3                           sh21                          scheduled 

[gds@gsm01 ~]$ gdsctl databases
Database: "sh1" Registered: Y State: Ok ONS: N. Role: PRIMARY Instances: 1 Region: region1
   Service: "oltp_ro_srvc" Globally started: Y Started: N
            Scan: N Enabled: Y Preferred: Y
   Service: "oltp_rw_srvc" Globally started: Y Started: Y
            Scan: N Enabled: Y Preferred: Y
   Registered instances:
     cust_sdb%1
Database: "sh2" Registered: Y State: Ok ONS: N. Role: PH_STNDBY Instances: 1 Region: region2
   Service: "oltp_ro_srvc" Globally started: Y Started: Y
            Scan: N Enabled: Y Preferred: Y
   Service: "oltp_rw_srvc" Globally started: Y Started: N
            Scan: N Enabled: Y Preferred: Y
   Registered instances:
     cust_sdb%11
Database: "sh21" Registered: Y State: Ok ONS: N. Role: PRIMARY Instances: 1 Region: region1
   Service: "oltp_ro_srvc" Globally started: Y Started: N
            Scan: N Enabled: Y Preferred: Y
   Service: "oltp_rw_srvc" Globally started: Y Started: Y
            Scan: N Enabled: Y Preferred: Y
   Registered instances:
     cust_sdb%41
Database: "sh22" Registered: Y State: Ok ONS: N. Role: PH_STNDBY Instances: 1 Region: region2
   Service: "oltp_ro_srvc" Globally started: Y Started: Y
            Scan: N Enabled: Y Preferred: Y
   Service: "oltp_rw_srvc" Globally started: Y Started: N
            Scan: N Enabled: Y Preferred: Y
   Registered instances:
     cust_sdb%51
Database: "sh3" Registered: Y State: Ok ONS: N. Role: PRIMARY Instances: 1 Region: region1
   Service: "oltp_ro_srvc" Globally started: Y Started: N
            Scan: N Enabled: Y Preferred: Y
   Service: "oltp_rw_srvc" Globally started: Y Started: Y
            Scan: N Enabled: Y Preferred: Y
   Registered instances:
     cust_sdb%21
Database: "sh4" Registered: Y State: Ok ONS: N. Role: PH_STNDBY Instances: 1 Region: region2
   Service: "oltp_ro_srvc" Globally started: Y Started: Y
            Scan: N Enabled: Y Preferred: Y
   Service: "oltp_rw_srvc" Globally started: Y Started: N
            Scan: N Enabled: Y Preferred: Y
   Registered instances:
     cust_sdb%31

[gds@gsm01 ~]$ gdsctl services
Service "oltp_ro_srvc.cust_sdb.oradbcloud" has 3 instance(s). Affinity: ANYWHERE
   Instance "cust_sdb%11", name: "sh2", db: "sh2", region: "region2", status: ready.
   Instance "cust_sdb%31", name: "sh4", db: "sh4", region: "region2", status: ready.
   Instance "cust_sdb%51", name: "sh22", db: "sh22", region: "region2", status: ready.
Service "oltp_rw_srvc.cust_sdb.oradbcloud" has 3 instance(s). Affinity: ANYWHERE
   Instance "cust_sdb%1", name: "sh1", db: "sh1", region: "region1", status: ready.
   Instance "cust_sdb%21", name: "sh3", db: "sh3", region: "region1", status: ready.
   Instance "cust_sdb%41", name: "sh21", db: "sh21", region: "region1", status: ready.

Oracle 19.3 Sharding-安裝配置之04-(添加分片)

原文:https://www.cnblogs.com/mydb/p/12553697.html


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶