分享更有价值
被信任是一种快乐

单实例GI环境怎么转换为集群环境

文章页正文上

这篇文章主要讲解了“单实例GI环境怎么转换为集群环境”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“单实例GI环境怎么转换为集群环境”吧!

—————————————————————————————————————-
1. 单机ASM转换集群ASM
—————————————————————————————————————-

——————————
1.1 关闭GI环境资源.
——————————

[oracle@a42ams1 ~]$ sqlplus / as sysdba
SQL> shutdown immediate;

[grid@a42ams1 ~]$ crsctl stop has

——————————
1.2 检查安装环境信息
——————————

–1.2.1 配置互信

./sshUserSetup.sh -hosts “a42ams1 a42ams2” -user grid -advanced -noPromptPassphrase
./sshUserSetup.sh -hosts “a42ams1 a42ams2” -user oracle -advanced -noPromptPassphrase
more /etc/hosts | grep -Ev ‘^#|^$|127.0.0.1|vip|scan|:’ | awk ‘{print “ssh ” $2 ” date;”}’ > ping.sh

–1.2.2 执行集群安装校验
./runcluvfy.sh stage -pre crsinst -n a42ams1,a42ams2 -verbose

——————————
1.3 卸载单机环境GI,清除软件文件
——————————

[root@a42ams1 ~]# cd /grid/app/11.2.0/
[root@a42ams1 grid]# cd crs/install/
[root@a42ams1 install]# ./roothas.pl -deconfig -force
Using configuration parameter file: ./crsconfig_params
CRS resources for listeners are still configured
PRKO-2573 : ONS daemon is already stopped.
CRS-2673: Attempting to stop ‘ora.A42AMSARCH.dg’ on ‘a42ams1’
CRS-2673: Attempting to stop ‘ora.A42AMSDATA1.dg’ on ‘a42ams1’
CRS-2673: Attempting to stop ‘ora.A42AMSOCR.dg’ on ‘a42ams1’
CRS-2677: Stop of ‘ora.A42AMSOCR.dg’ on ‘a42ams1’ succeeded
CRS-2677: Stop of ‘ora.A42AMSDATA1.dg’ on ‘a42ams1’ succeeded
CRS-2677: Stop of ‘ora.A42AMSARCH.dg’ on ‘a42ams1’ succeeded
CRS-2673: Attempting to stop ‘ora.asm’ on ‘a42ams1’
CRS-2677: Stop of ‘ora.asm’ on ‘a42ams1’ succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ‘a42ams1’
CRS-2677: Stop of ‘ora.cssd’ on ‘a42ams1’ succeeded
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘a42ams1’
CRS-2673: Attempting to stop ‘ora.evmd’ on ‘a42ams1’
CRS-2677: Stop of ‘ora.evmd’ on ‘a42ams1’ succeeded
CRS-2793: Shutdown of Oracle免费主机域名 High Availability Services-managed resources on ‘a42ams1’ has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully deconfigured Oracle Re免费主机域名start stack

–11.2.0.4已经不支持 (How to Convert a Single-Instance ASM to Cluster ASM (文档 ID 452758.1) )
[oracle@a42ams1 ~]$ cd $ORACLE_HOME/bin
[oracle@a42ams1 bin]$ dbca -silent -deleteASM
This is no longer a supported operation. Use Automatic Storage Management Configuration Assistant (ASMCA) from grid infrastructure/clusterware home to delete ASM.

–分离GI的ORACLE_HOME信息
[grid@a42ams1 ~]$
$ORACLE_HOME/oui/bin/runInstaller -silent -detachHome ORACLE_HOME=$ORACLE_HOME

——————————
1.4 新装GI/DB环境 (注意调整目录及环境变量)
——————————

–如果需要使用原有磁盘作为OCR磁盘,需要清空磁盘信息
[root@a42ams1 ~]# dd if=/dev/zero of=/dev/asm-ocr1 bs=1M count=100
[root@a42ams1 ~]# dd if=/dev/zero of=/dev/asm-ocr2 bs=1M count=100
[root@a42ams1 ~]# dd if=/dev/zero of=/dev/asm-ocr3 bs=1M count=100

—————————————————————————————————————-
2. 单机数据库转换集群数据库
—————————————————————————————————————-

——————————
2.1 挂载原有DG (两个节点都可以进行挂载)
——————————

[grid@a42ams1 ~]$ kfod a=’/dev/asm*’ disks=all ds=true o=all
[grid@a42ams1 ~]$ sqlplus / as sysasm
SQL> alter diskgroup A42AMSDATA1 mount;
SQL> alter diskgroup A42AMSARCH mount;

——————————
2.2 启动原有数据库 (需要修改oracle可执行程序权限,否则启动数据库时无法访问磁盘组)
——————————

–2.2.1 复制原有的参数文件和口令文件到新安装目录下,启动数据库
[oracle@a42ams1 ~]$ sqlplus / as sysdba
SQL> startup
ORA-01565: error in identifying file ‘+A42AMSDATA1/a42amsdb/spfilea42amsdb.ora’
ORA-17503: ksfdopn:2 Failed to open file +A42AMSDATA1/a42amsdb/spfilea42amsdb.ora
ORA-15001: diskgroup “A42AMSDATA1” does not exist or is not mounted
ORA-15040: diskgroup is incomplete

–2.2.2 调整oracle可执行程序文件权限
[oracle@a42ams1 trace]$ ls -la $ORACLE_HOME/bin/oracle
-rwsr-s–x 1 oracle oinstall 239626689 Jun 14 10:23 /oracle/app/oracle/product/11.2.0.4/db_1/bin/oracle
[root@a42ams1 bin]# /grid/app/11.2.0.4/grid/bin/setasmgidwrap o=/oracle/app/oracle/product/11.2.0.4/db_1/bin/oracle

–2.2.3 启动数据库
[oracle@a42ams1 ~]$ sqlplus / as sysdba
SQL> startup;

–2.2.4 将数据库加入crs资源中,并校验环境信息
[oracle@a42ams1 ~]$ srvctl add database -d a42amsdb -o /oracle/app/oracle/product/11.2.0.4/db_1 -p +A42AMSDATA1/a42amsdb/spfilea42amsdb.ora -c Single -x a42ams1
[oracle@a42ams1 ~]$ srvctl config database -d a42amsdb

——————————
2.3 进行rac数据库转换 (MOS ID 1362116.1)
——————————
[oracle@a42ams1 ~]$ cd $ORACLE_HOME/assistants/rconfig/sampleXMLs
[oracle@a42ams1 sampleXMLs]$ cp ConvertToRAC_AdminManaged.xml ~

–2.3.1 替换转换信息
[oracle@a42ams1 ~]$ vi ConvertToRAC_AdminManaged.xml
–转换路径信息 (配置文件中提示源和目标的目录可以一致)

:%s#/oracle/product/11.2.0/db_1#/oracle/app/oracle/product/11.2.0.4/db_1#g

–实例信息

替换为:

–节点信息



替换为:



–实例前缀信息
sales
替换为:
a42amsdb

–DG信息调整 (由于不需要进行数据迁移,DG信息置空)
+ASMDG
替换为:

+ASMDG
替换为:

–2.3.2 修改sys用户口令为oracle
SQL> alter user sys identified by oracle;

–2.3.3 对转换文件进行校验
[oracle@a42ams1 ~]$ vi ConvertToRAC_AdminManaged.xml


替换为:

[oracle@a42ams1 ~]$ $ORACLE_HOME/bin/rconfig ./ConvertToRAC_AdminManaged.xml

–2.3.4 执行转换

[oracle@a42ams1 ~]$ vi ConvertToRAC_AdminManaged.xml


替换为:

[oracle@a42ams1 ~]$ $ORACLE_HOME/bin/rconfig ./ConvertToRAC_AdminManaged.xml
Converting Database “a42amsdb” to Cluster Database. Target Oracle Home: /oracle/app/oracle/product/11.2.0.4/db_1. Database Role: PRIMARY.
Setting Data Files and Control Files
Adding Database Instances
Adding Redo Logs
Enabling threads for all Database Instances
Setting TEMP tablespace
Adding UNDO tablespaces
Adding Trace files
Setting Fast Recovery Area
Updating Oratab
Creating Password file(s)
Configuring Listeners
Configuring related CRS resources
Starting Cluster Database

–2.3.5 执行转换检查转换结果,修改环境变量
[oracle@a42ams1 ~]$ srvctl config database -d a42amsdb
[oracle@a42ams1 ~]$ crsctl stat res ora.a42amsdb.db -t
[oracle@a42ams1 ~]$ ps -ef | grep ora_smon
[oracle@a42ams2 ~]$ ps -ef | grep ora_smon
感谢各位的阅读,以上就是“单实例GI环境怎么转换为集群环境”的内容了,经过本文的学习后,相信大家对单实例GI环境怎么转换为集群环境这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是云技术,小编将为大家推送更多相关知识点的文章,欢迎关注!

相关推荐: mysql8.0怎么进行降序索引

本篇内容介绍了“mysql8.0怎么进行降序索引”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!MySQL支持降序索引:DESC在索引定义中不再被忽略,但会导致按…

文章页内容下
赞(0) 打赏
版权声明:本站采用知识共享、学习交流,不允许用于商业用途;文章由发布者自行承担一切责任,与本站无关。
文章页正文下
文章页评论上

云服务器、web空间可免费试用

宝塔面板主机、支持php,mysql等,SSL部署;安全高速企业专供99.999%稳定,另有高防主机、不限制内容等类型,具体可咨询QQ:360163164,Tel同微信:18905205712

主机选购导航云服务器试用

登录

找回密码

注册