当前位置:网站首页>Migrate Oracle database from windows system to Linux Oracle RAC cluster environment (2) -- convert database to cluster mode
Migrate Oracle database from windows system to Linux Oracle RAC cluster environment (2) -- convert database to cluster mode
2022-06-25 02:24:00 【Rsda DBA_ WGX】
hold Oracle Database from Windows System migration to Linux Oracle Rac Cluster environment (2)—— Convert the database to cluster mode
Catalog
One 、 View database cluster properties
-- View database cluster properties
SQL> show parameter cluster
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean FALSE -- Cluster switch : close
cluster_database_instances integer 1 -- The number of instances is 1
cluster_interconnects string
-- View the instance properties
SQL> show parameter instance
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
active_instance_count integer
cluster_database_instances integer 1
instance_groups string
instance_name string hisdb1
instance_number integer 0 -- Instances of exclusive Edition
instance_type string RDBMS
open_links_per_instance integer 4
parallel_instance_group string
parallel_server_instances integer 1
Two 、 Modify cluster parameters
1、 At the node rac1 Execute the following command above
-- =================================================================================
alter system set cluster_database=true scope=spfile;
alter system set cluster_database_instances=2 scope=spfile;
alter system set instance_number=1 scope=spfile sid='hisdb1';
alter system set thread=1 scope=spfile sid='hisdb1';
alter system set undo_tablespace=undotbs1 scope=spfile sid='hisdb1';
-- =================================================================================
-- =================================================================================
-- =================================================================================
SQL>
alter system set cluster_database=true scope=spfile;
alter system set cluster_database_instances=2 scope=spfile;
alter system set instance_number=1 scope=spfile sid='hisdb1';
alter system set thread=1 scope=spfile sid='hisdb1';
alter system set undo_tablespace=undotbs1 scope=spfile sid='hisdb1';
System altered.
2、 Create nodes rac2 The required undo Table space
SQL> show parameter db_creat
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest string
db_create_online_log_dest_1 string
db_create_online_log_dest_2 string
db_create_online_log_dest_3 string
db_create_online_log_dest_4 string
db_create_online_log_dest_5 string
-- Is used to specify the Oracle The default path for the database server to create data files
SQL> alter system set db_create_file_dest='+DATA';
System altered.
-- Create tablespace undotbs2
SQL> create undo tablespace undotbs2 datafile size 500M;
Tablespace created.
-- View data files
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA/hisdb/datafile/system.270.1107594961
+DATA/hisdb/datafile/sysaux.271.1107594961
+DATA/hisdb/datafile/undotbs1.272.1107594961
+DATA/hisdb/datafile/users.275.1107594963
+DATA/hisdb/datafile/ts001.273.1107594963
+DATA/hisdb/datafile/ts001.274.1107594963
+DATA/hisdb/datafile/undotbs2.280.1107605935
7 rows selected.
3、 Create nodes rac2 Required log files
-- view log file
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
+DATA/hisdb/onlinelog/redo05a.log
+DATA/hisdb/onlinelog/redo06a.log
+DATA/hisdb/onlinelog/redo07a.log
-- Create a log file
alter database add logfile thread 2 group 1 '+data/hisdb/onlinelog/redo01.log' size 50m;
alter database add logfile thread 2 group 2 '+data/hisdb/onlinelog/redo02.log' size 50m;
alter database add logfile thread 2 group 3 '+data/hisdb/onlinelog/redo03.log' size 50m;
-- view log file
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
+DATA/hisdb/onlinelog/redo01.log
+DATA/hisdb/onlinelog/redo02.log
+DATA/hisdb/onlinelog/redo05a.log
+DATA/hisdb/onlinelog/redo06a.log
+DATA/hisdb/onlinelog/redo07a.log
+DATA/hisdb/onlinelog/redo03.log
6 rows selected.
4、 Set nodes rac2 Cluster properties for
-- ============================================================================================
alter system set instance_number=2 scope=spfile sid='hisdb2';
alter system set thread=2 scope=spfile sid='hisdb2';
alter system set undo_tablespace=undotbs2 scope=spfile sid='hisdb2';
alter database enable thread 2;
-- ============================================================================================
-- ============================================================================================
SQL> alter system set instance_number=2 scope=spfile sid='hisdb2';
SQL> alter system set thread=2 scope=spfile sid='hisdb2';
SQL> alter system set undo_tablespace=undotbs2 scope=spfile sid='hisdb2';
SQL> alter database enable thread 2;
5、 At the node rac1 Restart instance , And then in rac2 Boot instance
-- node 1
-- Stop storage
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
-- Boot instance
SQL> startup
ORACLE instance started.
Total System Global Area 638853120 bytes
Fixed Size 2255952 bytes
Variable Size 494928816 bytes
Database Buffers 134217728 bytes
Redo Buffers 7450624 bytes
Database mounted.
Database opened.
-- node 2
SQL> startup
ORACLE instance started.
Total System Global Area 638853120 bytes
Fixed Size 2255952 bytes
Variable Size 494928816 bytes
Database Buffers 134217728 bytes
Redo Buffers 7450624 bytes
Database mounted.
Database opened.
3、 ... and 、 Add database and instance information to srvctl
about dbca Database created ,srvctl Database and instance information are included in . But for databases restored through backup ,srvctl Database and instance information are not included in . therefore , Need to manually database Information and instance information are added to srvctl Manager .
[[email protected] ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.BAK.dg ora....up.type ONLINE ONLINE rac1
ora.DATA.dg ora....up.type ONLINE ONLINE rac1
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type ONLINE ONLINE rac1
ora.OCR.dg ora....up.type ONLINE ONLINE rac1
ora.asm ora.asm.type ONLINE ONLINE rac1
ora.cvu ora.cvu.type ONLINE ONLINE rac1
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora.mydb.db ora....se.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type ONLINE ONLINE rac1
ora.ons ora.ons.type ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora.scan1.vip ora....ip.type ONLINE ONLINE rac1
Do the following , Must be in oracle Execute under the user :
# Switch to a oracle user
[[email protected] admin]$ su - oracle
Password:
Last login: Mon Jun 20 17:38:23 CST 2022 on pts/0
# Delete the original database information
[[email protected] dbs]$ srvctl remove database -d mydb
Remove the database mydb? (y/[n]) y
# Add database information
[[email protected] ~]$ srvctl add database -d hisdb -o /u01/app/oracle/product/11.2.0/db_1 -p +DATA/hisdb/spfilehisdb.ora
# -d db_unique_name; -o oracle_home; -p spfile_path
# Add instance information
[[email protected] ~]$ srvctl add instance -d hisdb -i hisdb1 -n rac1
[[email protected] ~]$ srvctl add instance -d hisdb -i hisdb2 -n rac2
# Start database
[[email protected] dbs]$ srvctl start database -d hisdb
# Make the database and instance start automatically
[[email protected] ~]$ srvctl enable database -d hisdb
PRCC-1010 : hisdb was already enabled
PRCR-1002 : Resource ora.hisdb.db is already enabled
[[email protected] ~]$ srvctl enable instance -d hisdb -i hisdb1
[[email protected] ~]$ srvctl enable instance -d hisdb -i hisdb2
[[email protected] ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.BAK.dg ora....up.type ONLINE ONLINE rac1
ora.DATA.dg ora....up.type ONLINE ONLINE rac1
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type ONLINE ONLINE rac1
ora.OCR.dg ora....up.type ONLINE ONLINE rac1
ora.asm ora.asm.type ONLINE ONLINE rac1
ora.cvu ora.cvu.type ONLINE ONLINE rac1
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora.hisdb.db ora....se.type ONLINE ONLINE rac1
ora....network ora....rk.type ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type ONLINE ONLINE rac1
ora.ons ora.ons.type ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora.scan1.vip ora....ip.type ONLINE ONLINE rac1
Four 、 Generate password file
# node 1
cd $ORACLE_HOME/dbs
orapwd file=orapwhisdb1 password=oracle
# node 2
cd $ORACLE_HOME/dbs
orapwd file=orapwhisdb2 password=oracle
边栏推荐
- Multimodal emotion recognition_ Research on emotion recognition based on multimodal fusion
- 指南针靠谱吗?开证券账户安全吗?
- 商城项目 pc----商品详情页
- 进入阿里做测试员遥不可及?这里或许有你想要的答案
- jwt
- 中信证券手机开户是靠谱的吗?安全吗
- Android物联网应用程序开发(智慧园区)—— 设置传感器阈值对话框界面
- qt打包exe文件,解决“无法定位程序输入点_ZdaPvj于动态链接库Qt5Cored.dll”
- LINQ 查询(3)
- [I.MX6UL] U-Boot移植(六) 网络驱动修改 LAN8720A
猜你喜欢
![[analysis of STL source code] functions and applications of six STL components (directory)](/img/f2/872fd93ef52b1424343ba634be24f6.png)
[analysis of STL source code] functions and applications of six STL components (directory)

Pit entry machine learning: I. Introduction

What are the reasons for the abnormal playback of the online channel of the channel accessed by easycvr national standard protocol?

Left hand dreams right hand responsibilities GAC Honda not only pays attention to sales but also children's safety

It's 2022, and you still don't know what performance testing is?
Cusdis - lightweight, privacy first open source comment system | chain of the city

入职一家新公司,如何快速熟悉代码?

【Proteus仿真】Arduino UNO+数码管显示4x4键盘矩阵按键

I've been doing software testing for two years. I'd like to give some advice to girls who are still hesitating

进入阿里做测试员遥不可及?这里或许有你想要的答案
随机推荐
Beescms website penetration test and repair comments "suggestions collection"
Kaggle 专利匹配比赛金牌方案赛后总结
Basic layout -qhboxlayout class, qvboxlayout class, qgridlayout class
[day 26] given the ascending array nums of n elements, find a function to find the subscript of target in nums | learn binary search
Processon producer process (customized)
How can Huatai Securities open an account to achieve one in ten thousand? Are securities accounts safe and reliable
分布式事务解决方案和代码落地
折叠屏将成国产手机分食苹果市场的重要武器
探索C语言程序奥秘——C语言程序编译与预处理
高速缓存Cache详解(西电考研向)
Computing service network: a systematic revolution of multi integration
random list随机生成不重复数
华泰证券如何开户能做到万分之一?证券开户安全可靠吗
把 Oracle 数据库从 Windows 系统迁移到 Linux Oracle Rac 集群环境(3)—— 把数据库设置为归档模式
Multimodal emotion recognition_ Research on emotion recognition based on multimodal fusion
Test / development programmers, 30, do you feel confused? And where to go
Sumati gamefi ecological overview, element design in the magical world
Exploring the mystery of C language program -- C language program compilation and preprocessing
Hashcat 的使用
It's 2022, and you still don't know what performance testing is?