当前位置:网站首页>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
边栏推荐
- [STL source code analysis] configurator (to be supplemented)
- [mobile terminal] design size of mobile phone interface
- [live review] battle code pioneer phase 7: how third-party application developers contribute to open source
- 算力服务网络:一场多元融合的系统革命
- 调用系统函数安全方案
- 【移动端】手机界面的设计尺寸
- June 24, 2022: golang multiple choice question, what does the following golang code output? A:1; B:3; C:4; D: Compilation failed. package main import ( “f
- 2022年云计算应用关键威胁调查
- Experience of epidemic prevention and control, home office and online teaching | community essay solicitation
- 罗德与施瓦茨与中关村泛联院合作开展6G技术研究与早期验证
猜你喜欢
数据库系统概论必背知识
常用的软件测试工具清单,请查收。
EasyCVR平台EHOME协议接入,视频播放出现断流是什么原因?
jwt
Processon producer process (customized)
Once beego failed to find bee after passing the go get command Exe's pit
元宇宙的生态圈
一线城市软件测试工资——你拖后腿了吗
3 years of testing experience. I don't even understand what I really need on my resume. I need 20K to open my mouth?
高速缓存Cache详解(西电考研向)
随机推荐
Build and train your own dataset for pig face recognition
当人们用互联网式的思维和视角来看待产业互联网的时候,其实已陷入到了死胡同
Please run IDA with elevated permissons for local debugging.
How to quickly familiarize yourself with the code when you join a new company?
Investigation on key threats of cloud computing applications in 2022
Four characteristics of actual attack and defense drill
一线城市软件测试工资——你拖后腿了吗
Exploring the mystery of C language program -- C language program compilation and preprocessing
How to choose a regular and safe foreign exchange trading platform?
|遇到bug怎么分析,专业总结分析来了
Sumati gamefi ecological overview, element design in the magical world
Taishan Office Technology Lecture: a simple study of Chinese punctuation in vertical arrangement
Android物联网应用程序开发(智慧园区)—— 设置传感器阈值对话框界面
Experience of epidemic prevention and control, home office and online teaching | community essay solicitation
Android Internet of things application development (smart Park) - set sensor threshold dialog interface
测试/开发程序员,30而立,你是否觉得迷茫?又当何去何从......
对进程内存的实践和思考
把 Oracle 数据库从 Windows 系统迁移到 Linux Oracle Rac 集群环境(2)——将数据库转换为集群模式
EasyCVR平台EHOME协议接入,视频播放出现断流是什么原因?
Folding screen will become an important weapon for domestic mobile phones to share the apple market