当前位置:网站首页>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
边栏推荐
- Please run IDA with elevated permissons for local debugging.
- Beescms website penetration test and repair comments "suggestions collection"
- Intranet learning notes (6)
- 把 Oracle 数据库从 Windows 系统迁移到 Linux Oracle Rac 集群环境(1)——迁移数据到节点1
- npm包发布详细教程
- 高速缓存Cache详解(西电考研向)
- Chrysanthemum chain (winter vacation daily question 39)
- DDD concept is complex and difficult to understand. How to design code implementation model in practice?
- beescms网站渗透测试和修复意见「建议收藏」
- Folding screen will become an important weapon for domestic mobile phones to share the apple market
猜你喜欢

转行软件测试2年了,给还在犹豫的女生一点建议

Use of hashcat

疫情防控,居家办公,网上授课之心得 | 社区征文

DDD concept is complex and difficult to understand. How to design code implementation model in practice?

Exploring the mystery of C language program -- C language program compilation and preprocessing

AI服装生成,帮你完成服装设计的最后一步

ProcessOn制作ER过程(自定义)

【STL源码剖析】配置器(待补充)

Rod and Schwartz cooperated with ZhongGuanCun pan Lianyuan Institute to carry out 6G technology research and early verification

【STL源码剖析】STL六大组件功能与运用(目录)
随机推荐
internship:svn的使用
Exploring the mystery of C language program -- C language program compilation and preprocessing
E - Average and Median(二分)
Talking about the advantages of flying book in development work | community essay solicitation
计算机三级(数据库)备考题目知识点总结
Using qdomdocument to manipulate XML files in QT
ida中交叉引用的解析
random list随机生成不重复数
Can automate - 10k, can automate - 20K, do you understand automated testing?
Cusdis - 轻量级、隐私优先的开源评论系统 | 倾城之链
When they are in private, they have a sense of propriety
数据库系统概论必背知识
[live review] battle code pioneer phase 7: how third-party application developers contribute to open source
把 Oracle 数据库从 Windows 系统迁移到 Linux Oracle Rac 集群环境(3)—— 把数据库设置为归档模式
F - spices (linear basis)
做软件安全测试的作用,如何寻找软件安全测试公司出具报告?
Experience of epidemic prevention and control, home office and online teaching | community essay solicitation
Kaggle 专利匹配比赛赛后总结
内网学习笔记(6)
Test / development programmers, 30, do you feel confused? And where to go