|
地板
楼主 |
发表于 2017-8-11 15:39:39
|
只看该作者
三. 设置OracleSharding Manage和路由层。本例中在HostSDB1上设置。
1. 设置catalog database 环境变量并启动监听。
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
export ORACLE_SID=shard
export PATH=$ORACLE_HOME/bin:$PATH
lsnrctl start
2. 赋角色和权限。GSMCATUSER是12c内置的一个用户,shard director 用这个用户连到catalog database。
sqlplus / as sysdba
alter user gsmcatuser account unlock;
alter user gsmcatuser identified by oracle;
create user mysdbadmin identified by oracle;
grant connect,create session,gsmadmin_role to mysdbadmin;
grant inherit privileges on user sys to GSMADMIN_INTERNAL;
exec DBMS_SCHEDULER.SET_AGENT_REGISTRATION_PASS('oracle');
3. 进入到GDSCTL命令行,创建shard catalog。注:GDSCTL是一个命令行工具,用于管理和配置Global Data Services framework。
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/12.2.0/gsmhome_1
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
gdsctl
create shardcatalog -database 192.168.133.91:1521:orcl -chunks 12 -user mysdbadmin/oracle -sdb shard -region sdb2,sdb3
4. 创建并启动shard director。并设置操作系统安全认证。
add gsm -gsm sharddirector1 -listener 1522 -pwd oracle -catalog 10.10.9.30:1521:shard -region region1
start gsm -gsm sharddirector1
add credential -credential region1_cred -osaccount oracle -ospassword oracle
exit
5. 连接到每一个Shard Hosts(本例中为HOST SDB2和HOST SDB3),注册Scheduler agents, 并创建好oradata和fast_recovery_area文件夹。
ssh oracle@sdb2
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
schagent -start
schagent -status
echo oracle | schagent -registerdatabase 10.10.9.30 8080
mkdir /u01/app/oracle/oradata
mkdir /u01/app/oracle/fast_recovery_area
ssh oracle@sdb3
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
schagent -start
schagent -status
echo oracle | schagent -registerdatabase 10.10.9.30 8080
mkdir /u01/app/oracle/oradata
mkdir /u01/app/oracle/fast_recovery_area |
|