如何把Oracle 数据库从 RAC 集群迁移到单机环境

目录
  • 一、系统环境
  • 二、源数据库的操作
  • 三、目标数据库的操作
  • 四、开始恢复数据库
  • 五、启动数据库

把 Oracle 数据库从 RAC 集群迁移到单机环境

一、系统环境

1、源数据库

db_name:hisdb
SID:hisdb1、hisdb2
IP: 192.168.1.101、192.168.1.102
os:CentOS Linux release 7.3.1611 (Core)

2、目标数据库

IP: 192.168.1.15
os:CentOS Linux release 7.3.1611 (Core)
安装 Oracle 软件, 不创建实例

二、源数据库的操作

1、创建 pfile 文件

SQL> create pfile='/home/oracle/pfile0728.ora' from spfile;
File created.

2、查看生成的 pfile 文件

[oracle@rac1 ~]$ pwd
/home/oracle
[oracle@rac1 ~]$ ll
total 2487204
drwxr-xr-x  2 oracle oinstall        111 Jun 24 21:30 data-bak
drwxr-xr-x  7 oracle oinstall        136 Aug 27  2013 database
-rw-r--r--. 1 oracle oinstall 1395582860 Jan  7  2020 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r--. 1 oracle oinstall 1151304589 Jan  7  2020 p13390677_112040_Linux-x86-64_2of7.zip
-rw-r--r--  1 oracle asmadmin       1547 Jul 28 08:27 pfile0728.ora

3、将 pfile 文件传到目标数据库的 $ORACLE_HOME/dbs/ 目录下

[oracle@rac1 ~]$ scp pfile0728.ora oracle@192.168.1.15:/home/oracle/
The authenticity of host '192.168.1.15 (192.168.1.15)' can't be established.
ECDSA key fingerprint is 5c:31:ec:3c:ee:9c:6d:22:f3:60:dc:15:72:fd:67:91.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.15' (ECDSA) to the list of known hosts.
oracle@192.168.1.15's password:
pfile0728.ora                                 100% 1547     1.5KB/s   00:00
[oracle@rac1 ~]$ 

# 切换到目标主机
[oracle@mysql bin]$ cd ~

[oracle@mysql ~]$ ls
db_install.rsp  pfile0728.ora

[oracle@mysql ~]$ cp pfile0728.ora $ORACLE_HOME/dbs/
[oracle@mysql ~]$ ls $ORACLE_HOME/dbs/p*
/usr/local/oracle/product/11.2.0/db_1/dbs/pfile0728.ora

4、备份源数据库

(1)创建备份目录

[root@rac1 ~]# mkdir /arch/bk0729 -p

[root@rac1 ~]# chown -R oracle:oinstall /arch/bk0729

[root@rac1 ~]# ll /arch/
总用量 0
drwxr-xr-x 2 oracle oinstall 6 7月  30 18:58 bk0729

(2)用RMAN 全备数据库:

#=设置备份参数:备份到磁盘,6 个通道 ======================================
configure device type disk parallelism 6 backup type to backupset;
#=设置备份参数:设置备份文件的位置及文件名格式 ==================================
configure channel device type disk format '/arch/bk0729/%d_%I_%s_%p_%T.bkp';
# 备份控制文件 ============================================
backup current controlfile format ='/arch/bk0729/control_bak_%s.bak';
# 备份数据库 ============================================
backup as compressed backupset database;
# 下面的备份命令可以同时备份数据库和控制文件
backup incremental level 0 format '/rmanbackup/orcl_full_%U' database include current controlfile;
#= 设置备份文件格式:===========================================
configure channel device type disk format '/arch/bk0729/ctl_%d_%I_%s_%p_%T.bkp';
#= 备份归档日志:===========================================
backup as compressed backupset archivelog all;
#=设置备份参数:备份到磁盘,6 个通道 ======================================
RMAN> configure device type disk parallelism 6 backup type to backupset;
old RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 6;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 6 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters are successfully stored
#=设置备份参数:设置备份文件的位置及文件名格式 ==================================
RMAN> configure channel device type disk format '/arch/bk0729/%d_%I_%s_%p_%T.bkp';
old RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/arch/bk0729/%d_%I_%s_%p_%T.bkp';
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/arch/bk0729/%d_%I_%s_%p_%T.bkp';
new RMAN configuration parameters are successfully stored
# 备份控制文件 ============================================
RMAN> backup current controlfile format ='/arch/bk0729/control_bak_%s.bak';
Starting backup at 30-JUL-22
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=31 instance=hisdb1 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=125 instance=hisdb1 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=158 instance=hisdb1 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=159 instance=hisdb1 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=162 instance=hisdb1 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=36 instance=hisdb1 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 30-JUL-22
channel ORA_DISK_1: finished piece 1 at 30-JUL-22
piece handle=/arch/bk0729/control_bak_32.bak tag=TAG20220730T193424 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 30-JUL-22
# 备份数据库 ============================================
RMAN> backup as compressed backupset database;
Starting backup at 30-JUL-22
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/hisdb/datafile/system.278.1107994145
channel ORA_DISK_1: starting piece 1 at 30-JUL-22
channel ORA_DISK_2: starting compressed full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA/hisdb/datafile/sysaux.279.1107994147
input datafile file number=00004 name=+DATA/hisdb/datafile/users.270.1107994131
channel ORA_DISK_2: starting piece 1 at 30-JUL-22
channel ORA_DISK_3: starting compressed full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00003 name=+DATA/hisdb/datafile/undotbs1.271.1107994123
input datafile file number=00006 name=+DATA/hisdb/datafile/ts001.277.1107994139
channel ORA_DISK_3: starting piece 1 at 30-JUL-22
channel ORA_DISK_4: starting compressed full datafile backup set
channel ORA_DISK_4: specifying datafile(s) in backup set
input datafile file number=00007 name=+DATA/hisdb/datafile/undotbs2.284.1108022905
input datafile file number=00005 name=+DATA/hisdb/datafile/ts001.276.1107994131
channel ORA_DISK_4: starting piece 1 at 30-JUL-22
channel ORA_DISK_5: starting compressed full datafile backup set
channel ORA_DISK_5: specifying datafile(s) in backup set
channel ORA_DISK_6: starting compressed full datafile backup set
channel ORA_DISK_6: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_6: starting piece 1 at 30-JUL-22
channel ORA_DISK_3: finished piece 1 at 30-JUL-22
piece handle=/arch/bk0729/HISDB_2002805648_35_1_20220730.bkp tag=TAG20220730T193500 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:54
channel ORA_DISK_6: finished piece 1 at 30-JUL-22
piece handle=/arch/bk0729/HISDB_2002805648_38_1_20220730.bkp tag=TAG20220730T193500 comment=NONE
channel ORA_DISK_6: backup set complete, elapsed time: 00:00:27
channel ORA_DISK_1: finished piece 1 at 30-JUL-22
piece handle=/arch/bk0729/HISDB_2002805648_33_1_20220730.bkp tag=TAG20220730T193500 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:26
channel ORA_DISK_2: finished piece 1 at 30-JUL-22
piece handle=/arch/bk0729/HISDB_2002805648_34_1_20220730.bkp tag=TAG20220730T193500 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:01:26
channel ORA_DISK_4: finished piece 1 at 30-JUL-22
piece handle=/arch/bk0729/HISDB_2002805648_36_1_20220730.bkp tag=TAG20220730T193500 comment=NONE
channel ORA_DISK_4: backup set complete, elapsed time: 00:00:45
including current control file in backup set
channel ORA_DISK_5: starting piece 1 at 30-JUL-22
channel ORA_DISK_5: finished piece 1 at 30-JUL-22
piece handle=/arch/bk0729/HISDB_2002805648_37_1_20220730.bkp tag=TAG20220730T193500 comment=NONE
channel ORA_DISK_5: backup set complete, elapsed time: 00:00:01
Finished backup at 30-JUL-22
# 查看备份的文件
[root@rac1 bk0729]# pwd
/arch/bk0729
[root@rac1 bk0729]# ll -h
总用量 325M
-rw-r----- 1 oracle asmadmin 9.4M 7月  30 19:34 control_bak_32.bak
-rw-r----- 1 oracle asmadmin 213M 7月  30 20:24 HISDB_2002805648_45_1_20220730.bkp
-rw-r----- 1 oracle asmadmin  99M 7月  30 20:24 HISDB_2002805648_46_1_20220730.bkp
-rw-r----- 1 oracle asmadmin 1.6M 7月  30 20:23 HISDB_2002805648_47_1_20220730.bkp
-rw-r----- 1 oracle asmadmin 1.1M 7月  30 20:23 HISDB_2002805648_48_1_20220730.bkp
-rw-r----- 1 oracle asmadmin 1.1M 7月  30 20:24 HISDB_2002805648_49_1_20220730.bkp
-rw-r----- 1 oracle asmadmin  96K 7月  30 20:23 HISDB_2002805648_50_1_20220730.bkp
#= 设置备份文件格式:===========================================
RMAN> configure channel device type disk format '/arch/bk0729/ctl_%d_%I_%s_%p_%T.bkp';
old RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/arch/bk0729/%d_%I_%s_%p_%T.bkp';
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/arch/bk0729/ctl_%d_%I_%s_%p_%T.bkp';
new RMAN configuration parameters are successfully stored
released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_DISK_3
released channel: ORA_DISK_4
released channel: ORA_DISK_5
released channel: ORA_DISK_6
#= 备份归档日志:===========================================
RMAN> backup as compressed backupset archivelog all;
Starting backup at 30-JUL-22
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=98 RECID=13 STAMP=1111432401
channel ORA_DISK_1: starting piece 1 at 30-JUL-22
channel ORA_DISK_2: starting compressed archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=99 RECID=14 STAMP=1111432403
channel ORA_DISK_2: starting piece 1 at 30-JUL-22
channel ORA_DISK_3: starting compressed archived log backup set
channel ORA_DISK_3: specifying archived log(s) in backup set
input archived log thread=1 sequence=100 RECID=15 STAMP=1111432904
channel ORA_DISK_3: starting piece 1 at 30-JUL-22
channel ORA_DISK_4: starting compressed archived log backup set
channel ORA_DISK_4: specifying archived log(s) in backup set
input archived log thread=1 sequence=101 RECID=16 STAMP=1111432905
channel ORA_DISK_4: starting piece 1 at 30-JUL-22
channel ORA_DISK_5: starting compressed archived log backup set
channel ORA_DISK_5: specifying archived log(s) in backup set
input archived log thread=1 sequence=102 RECID=17 STAMP=1111433394
channel ORA_DISK_5: starting piece 1 at 30-JUL-22
channel ORA_DISK_6: starting compressed archived log backup set
channel ORA_DISK_6: specifying archived log(s) in backup set
input archived log thread=1 sequence=103 RECID=18 STAMP=1111433805
channel ORA_DISK_6: starting piece 1 at 30-JUL-22
channel ORA_DISK_1: finished piece 1 at 30-JUL-22
piece handle=/arch/bk0729/HISDB_2002805648_39_1_20220730.bkp tag=TAG20220730T193645 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:00
channel ORA_DISK_2: finished piece 1 at 30-JUL-22
piece handle=/arch/bk0729/HISDB_2002805648_40_1_20220730.bkp tag=TAG20220730T193645 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:00
channel ORA_DISK_3: finished piece 1 at 30-JUL-22
piece handle=/arch/bk0729/HISDB_2002805648_41_1_20220730.bkp tag=TAG20220730T193645 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:00
channel ORA_DISK_4: finished piece 1 at 30-JUL-22
piece handle=/arch/bk0729/HISDB_2002805648_42_1_20220730.bkp tag=TAG20220730T193645 comment=NONE
channel ORA_DISK_4: backup set complete, elapsed time: 00:00:00
channel ORA_DISK_5: finished piece 1 at 30-JUL-22
piece handle=/arch/bk0729/HISDB_2002805648_43_1_20220730.bkp tag=TAG20220730T193645 comment=NONE
channel ORA_DISK_5: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_6: finished piece 1 at 30-JUL-22
piece handle=/arch/bk0729/HISDB_2002805648_44_1_20220730.bkp tag=TAG20220730T193645 comment=NONE
channel ORA_DISK_6: backup set complete, elapsed time: 00:00:01
Finished backup at 30-JUL-22
# 查看备份的文件
[root@rac1 bk0729]# ll -h
总用量 328M
-rw-r----- 1 oracle asmadmin 9.4M 7月  30 19:34 control_bak_32.bak
-rw-r----- 1 oracle asmadmin 1.5M 7月  30 20:26 ctl_HISDB_2002805648_51_1_20220730.bkp
-rw-r----- 1 oracle asmadmin 169K 7月  30 20:26 ctl_HISDB_2002805648_52_1_20220730.bkp
-rw-r----- 1 oracle asmadmin 218K 7月  30 20:26 ctl_HISDB_2002805648_53_1_20220730.bkp
-rw-r----- 1 oracle asmadmin 1.7M 7月  30 20:26 ctl_HISDB_2002805648_54_1_20220730.bkp
-rw-r----- 1 oracle asmadmin 213M 7月  30 20:24 HISDB_2002805648_45_1_20220730.bkp
-rw-r----- 1 oracle asmadmin  99M 7月  30 20:24 HISDB_2002805648_46_1_20220730.bkp
-rw-r----- 1 oracle asmadmin 1.6M 7月  30 20:23 HISDB_2002805648_47_1_20220730.bkp
-rw-r----- 1 oracle asmadmin 1.1M 7月  30 20:23 HISDB_2002805648_48_1_20220730.bkp
-rw-r----- 1 oracle asmadmin 1.1M 7月  30 20:24 HISDB_2002805648_49_1_20220730.bkp
-rw-r----- 1 oracle asmadmin  96K 7月  30 20:23 HISDB_2002805648_50_1_20220730.bkp

三、目标数据库的操作

1、修改参数文件

(1)源数据库的参数文件内容如下:

[oracle@rac1 ~]$ vi pfile0728.ora 

hisdb2.__db_cache_size=192937984
hisdb1.__db_cache_size=201326592
hisdb2.__java_pool_size=4194304
hisdb1.__java_pool_size=4194304
hisdb2.__large_pool_size=8388608
hisdb1.__large_pool_size=8388608
hisdb1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
hisdb2.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
hisdb2.__pga_aggregate_target=222298112
hisdb1.__pga_aggregate_target=222298112
hisdb2.__sga_target=419430400
hisdb1.__sga_target=419430400
hisdb2.__shared_io_pool_size=0
hisdb2.__db_cache_size=192937984
hisdb1.__db_cache_size=201326592
hisdb2.__java_pool_size=4194304
hisdb1.__java_pool_size=4194304
hisdb2.__large_pool_size=8388608
hisdb1.__large_pool_size=8388608
hisdb1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
hisdb2.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
hisdb2.__pga_aggregate_target=222298112
hisdb1.__pga_aggregate_target=222298112
hisdb2.__sga_target=419430400
hisdb1.__sga_target=419430400
hisdb2.__shared_io_pool_size=0
hisdb1.__shared_io_pool_size=0
hisdb2.__shared_pool_size=201326592
hisdb1.__shared_pool_size=192937984
hisdb2.__streams_pool_size=0
hisdb1.__streams_pool_size=0
# 以上内容全部删除
# 创建如下目录
mkdir -p /usr/local/oracle/admin/hisdb/adump
mkdir -p /usr/local/oracle/controlfile/
mkdir -p /data/oracle/controlfile/
mkdir -p /data/oracle/flash_recovery_area
mkdir -p /data/oracle/arch
mkdir -p /data/oracle/oradata

# *.audit_file_dest='/u01/app/oracle/admin/hisdb/adump'  --修改此行内容如下
*.audit_file_dest='/usr/local/oracle/admin/hisdb/adump'

# *.cluster_database=TRUE          # 删除此行
# *.cluster_database_instances=2   # 删除此行

*.compatible='11.2.0.4.0'          # 此行不变

#*.control_files='+DATA/hisdb/controlfile/control01.ctl','+BAK/hisdb/controlfile/control02.ctl'
--修改此行内容如下
*.control_files='/usr/local/oracle/controlfile/control01.ctl','/data/oracle/controlfile/control02.ctl'
*.db_block_size=8192               # 此行不变

# *.db_create_file_dest='+DATA'    # 删除此行
# *.db_domain=''                   # 删除此行
*.db_name='hisdb'                  # 此行不变

# *.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area' --修改此行内容如下
*.db_recovery_file_dest='/data/oracle/flash_recovery_area'

*.db_recovery_file_dest_size=4102029312              # 此行不变

#*.diagnostic_dest='/u01/app/oracle'    --修改此行内容如下
*.diagnostic_dest='/usr/local/oracle'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=hisdbXDB)'         # 此行不变

# hisdb1.instance_number=1                # 删除此行
# hisdb2.instance_number=2                # 删除此行
# *.log_archive_dest_1='location=+BAK'   --修改此行内容如下
*.log_archive_dest_1='location=/data/oracle/arch'
*.log_archive_format='%t_%s_%r.dbf

# *.memory_target=638588928         # 删除此行
*.open_cursors=300      # 此行不变
*.processes=150      # 此行不变
#*.remote_listener='my-racscan:1521'  # 删除此行
*.remote_login_passwordfile='EXCLUSIVE'
# hisdb1.thread=1  # 删除此行
# hisdb2.thread=2  # 删除此行
*.undo_tablespace='UNDOTBS1'   # 此行不变
# hisdb1.undo_tablespace='UNDOTBS1'  # 删除此行
# hisdb2.undo_tablespace='UNDOTBS2'  # 删除此行

(2)修改后的参数文件内容如下:

*.audit_file_dest='/usr/local/oracle/admin/hisdb/adump'
*.compatible='11.2.0.4.0'
*.control_files='/usr/local/oracle/controlfile/control01.ctl','/data/oracle/controlfile/control02.ctl'*.db_block_size=8192
*.db_name='hisdb'
*.db_recovery_file_dest='/data/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.diagnostic_dest='/usr/local/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=hisdbXDB)'
*.log_archive_dest_1='location=/data/oracle/arch'
*.log_archive_format='%t_%s_%r.dbf
'*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='exclusive'
*.undo_tablespace='UNDOTBS1'
*.log_file_name_convert=('+DATA/hisdb/onlinelog','/data/oracle/oradata')
*.db_file_name_convert=('+DATA/hisdb/datafile','/data/oracle/oradata')
*.db_file_name_convert=('+DATA/hisdb/tempfile','/data/oracle/oradata')

2、使用修改后的参数文件启动数据库到 nomount

SQL> startup nomount pfile='/home/oracle/pfile0729.ora';
ORACLE instance started.

Total System Global Area  233861120 bytes
Fixed Size		    2251976 bytes
Variable Size		  176161592 bytes
Database Buffers	   50331648 bytes
Redo Buffers		    5115904 bytes

3、生成 spfile 文件,关闭数据库,然后重新启动到 nomount

SQL> create spfile from pfile='/home/oracle/pfile0729.ora';

File created.

SQL> shutdown immediate;
ORA-01507: database not mounted

ORACLE instance shut down.
SQL> startup m
SP2-0714: invalid combination of STARTUP options
SQL> startup nomount;
ORACLE instance started.

Total System Global Area  233861120 bytes
Fixed Size		    2251976 bytes
Variable Size		  176161592 bytes
Database Buffers	   50331648 bytes
Redo Buffers		    5115904 bytes
SQL>

4、启动 rman,恢复控制文件

[oracle@host-192-168-20-5 oracle]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 31 00:20:01 2022

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: HISDB (not mounted)

-- 恢复控制文件
RMAN> restore controlfile from '/data/backup/control_bak_331659.bak';

Starting restore at 31-JUL-22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=189 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
output file name=/usr/local/oracle/controlfile/control01.ctl
output file name=/data/oracle/controlfile/control02.ctl
Finished restore at 31-JUL-22

5、启动数据库到 mount

SQL> alter database mount;
Database altered.

6、查看控制文件中的数据文件与临时文件信息

RMAN> report schema;

四、开始恢复数据库

1、核对备份文件

RMAN> crosscheck backup;
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/c-1947403592-20220722-06 RECID=323878 STAMP=1110743343
....
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/c-1947403592-20220729-09 RECID=327567 STAMP=1111356921
Crosschecked 45 objects

2、删除失效的备份文件

RMAN> delete expired backup;
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
.......
/oracle/app/oracle/product/11.2.0/db_1/dbs/c-1947403592-20220729-09
##  选择yes 删除 #########
Do you really want to delete the above objects (enter YES or NO)? yes
####################################
deleted backup piece
backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/c-1947403592-20220722-06
.......
backup piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/c-1947403592-20220729-09 RECID=327567 STAMP=1111356921
Deleted 45 EXPIRED objects

3、更新备份文件

RMAN> catalog start with '/data/backup/';

4、查看备份片信息

RMAN> list backup;

5、恢复数据库

run{
set newname for datafile 1 to '/data/oracle/oradata/system01';
set newname for datafile 2 to '/data/oracle/oradata/sysaux01';
set newname for datafile 3 to '/data/oracle/oradata/undotbs01';
set newname for datafile 4 to '/data/oracle/oradata/users01';
set newname for datafile 5 to '/data/oracle/oradata/undotbs02';
set newname for datafile 6 to '/data/oracle/oradata/audit_tbs01';
set newname for datafile 7 to '/data/oracle/oradata/data_ais01';
set newname for datafile 8 to '/data/oracle/oradata/data_applyout01';
set newname for datafile 9 to '/data/oracle/oradata/data_aqu01';
set newname for datafile 10 to '/data/oracle/oradata/data_cas01';
set newname for datafile 11 to '/data/oracle/oradata/data_com01';
set newname for datafile 12 to '/data/oracle/oradata/data_emr01';
set newname for datafile 13 to '/data/oracle/oradata/data_execdrug01';
set newname for datafile 14 to '/data/oracle/oradata/data_execundrug02';
set newname for datafile 15 to '/data/oracle/oradata/data_feedetail01';
set newname for datafile 16 to '/data/oracle/oradata/data_feeinfo01';
set newname for datafile 17 to '/data/oracle/oradata/data_fin.31401';
set newname for datafile 18 to '/data/oracle/oradata/data_goa.31301';
set newname for datafile 19 to '/data/oracle/oradata/data_itemlist01';
set newname for datafile 20 to '/data/oracle/oradata/data_lis311';
set newname for datafile 21 to '/data/oracle/oradata/data_log3101034788143';
set newname for datafile 22 to '/data/oracle/oradata/data_medicinelist3091034788143';
set newname for datafile 23 to '/data/oracle/oradata/data_met3081034788157';
set newname for datafile 24 to '/data/oracle/oradata/data_order3071034788169';
set newname for datafile 25 to '/data/oracle/oradata/data_order3061034788197';
set newname for datafile 26 to '/data/oracle/oradata/data_order3051034788225';
set newname for datafile 27 to '/data/oracle/oradata/data_order3041034788243';
set newname for datafile 28 to '/data/oracle/oradata/data_other3031034788255';
set newname for datafile 29 to '/data/oracle/oradata/data_output3021034788255';
set newname for datafile 30 to '/data/oracle/oradata/data_pha3011034788271';
set newname for datafile 31 to '/data/oracle/oradata/data_recipedetail3001034788275';
set newname for datafile 32 to '/data/oracle/oradata/data_record2991034788281';
set newname for datafile 33 to '/data/oracle/oradata/data_sem2981034788293';
set newname for datafile 34 to '/data/oracle/oradata/data_user2971034788293';
set newname for datafile 35 to '/data/oracle/oradata/index_ais2961034788297';
set newname for datafile 36 to '/data/oracle/oradata/index_applyout2951034788297';
set newname for datafile 37 to '/data/oracle/oradata/index_aqu2941034788309';
set newname for datafile 38 to '/data/oracle/oradata/index_cas2931034788309';
set newname for datafile 39 to '/data/oracle/oradata/index_com2921034788309';
set newname for datafile 40 to '/data/oracle/oradata/index_emr2911034788311';
set newname for datafile 41 to '/data/oracle/oradata/index_execdrug2901034788311';
set newname for datafile 42 to '/data/oracle/oradata/index_execundrug2891034788317';
set newname for datafile 43 to '/data/oracle/oradata/index_feedetail2881034788321';
set newname for datafile 44 to '/data/oracle/oradata/index_feeinfo2871034788329';
set newname for datafile 45 to '/data/oracle/oradata/index_fin2861034788337';
set newname for datafile 46 to '/data/oracle/oradata/index_goa2851034788343';
set newname for datafile 47 to '/data/oracle/oradata/index_itemlist2841034788343';
set newname for datafile 48 to '/data/oracle/oradata/index_lis.2831034788355';
set newname for datafile 49 to '/data/oracle/oradata/index_log.2821034788355';
set newname for datafile 50 to '/data/oracle/oradata/index_medicinelist2811034788355';
set newname for datafile 51 to '/data/oracle/oradata/index_met2801034788361';
set newname for datafile 52 to '/data/oracle/oradata/index_order2791034788369';
set newname for datafile 53 to '/data/oracle/oradata/index_other2781034788375';
set newname for datafile 54 to '/data/oracle/oradata/index_output2771034788375';
set newname for datafile 55 to '/data/oracle/oradata/index_pha2761034788381';
set newname for datafile 56 to '/data/oracle/oradata/index_recipedetail2581034788387';
set newname for datafile 57 to '/data/oracle/oradata/index_record3251034788389';
set newname for datafile 58 to '/data/oracle/oradata/index_sem2681034788391';
set newname for datafile 59 to '/data/oracle/oradata/index_user2711034788391';
set newname for datafile 60 to '/data/oracle/oradata/data_order2.dbf';
set newname for datafile 61 to '/data/oracle/oradata/data_order3.dbf';
set newname for datafile 62 to '/data/oracle/oradata/nfemr.dbf';
set newname for datafile 63 to '/data/oracle/oradata/emr5.dbf';
set newname for datafile 64 to '/data/oracle/oradata/emr52012.dbf';
set newname for datafile 65 to '/data/oracle/oradata/emr52013.dbf';
set newname for datafile 66 to '/data/oracle/oradata/emr52014.dbf';
set newname for datafile 67 to '/data/oracle/oradata/emr52015.dbf';
set newname for datafile 68 to '/data/oracle/oradata/emr52016.dbf';
set newname for datafile 69 to '/data/oracle/oradata/emr52017.dbf';
set newname for datafile 70 to '/data/oracle/oradata/emr52018.dbf';
set newname for datafile 71 to '/data/oracle/oradata/emr52019.dbf';
set newname for datafile 72 to '/data/oracle/oradata/emr52020.dbf';
set newname for datafile 73 to '/data/oracle/oradata/emr5202001.dbf';
set newname for datafile 74 to '/data/oracle/oradata/emr5202002.dbf';
set newname for datafile 75 to '/data/oracle/oradata/emr501.dbf';
set newname for datafile 76 to '/data/oracle/oradata/neuicu_data1';
set newname for datafile 77 to '/data/oracle/oradata/neucbus_data1';
set newname for datafile 78 to '/data/oracle/oradata/ntsdata01.dbf';
set newname for datafile 79 to '/data/oracle/oradata/emr5202003.dbf';
set newname for datafile 80 to '/data/oracle/oradata/emr5202101.dbf';
set newname for datafile 81 to '/data/oracle/oradata/emr5202102.dbf';
set newname for datafile 82 to '/data/oracle/oradata/emr5202103.dbf';
set newname for datafile 83 to '/data/oracle/oradata/ndqsdata01.dbf';
set newname for datafile 84 to '/data/oracle/oradata/emr520210401.dbf';
set newname for datafile 85 to '/data/oracle/oradata/emr5202104.dbf';
set newname for datafile 86 to '/data/oracle/oradata/emr5202105.dbf';
set newname for datafile 87 to '/data/oracle/oradata/emr5202106.dbf';
set newname for datafile 88 to '/data/oracle/oradata/emr502.dbf';
set newname for datafile 89 to '/data/oracle/oradata/emr503.dbf';
set newname for datafile 90 to '/data/oracle/oradata/sysaux001';
set newname for datafile 91 to '/data/oracle/oradata/emr5202201.dbf';
set newname for datafile 92 to '/data/oracle/oradata/neuicu_data11';
set newname for datafile 93 to '/data/oracle/oradata/emr_bak.dbf';
set newname for datafile 94 to '/data/oracle/oradata/sysaux002';
set newname for datafile 95 to '/data/oracle/oradata/system_bak';
set newname for datafile 96 to '/data/oracle/oradata/system_bak02';
set newname for datafile 97 to '/data/oracle/oradata/system_bak03';
set newname for datafile 98 to '/data/oracle/oradata/system_bak04';
set newname for datafile 99 to '/data/oracle/oradata/undotbs1_bak01';
set newname for datafile 100 to '/data/oracle/oradata/undotbs1_bak02';
set newname for datafile 101 to '/data/oracle/oradata/undotbs1_bak03';
set newname for datafile 102 to '/data/oracle/oradata/undotbs2_bak01';
set newname for datafile 103 to '/data/oracle/oradata/undotbs2_bak02';
set newname for datafile 104 to '/data/oracle/oradata/undotbs2_bak03';
set newname for datafile 105 to '/data/oracle/oradata/users02';
set newname for datafile 106 to '/data/oracle/oradata/users03';
set newname for datafile 107 to '/data/oracle/oradata/users04';
set newname for datafile 108 to '/data/oracle/oradata/emr5202202.dbf';
set newname for datafile 109 to '/data/oracle/oradata/emr5202203.dbf';
set newname for datafile 110 to '/data/oracle/oradata/emr5202204.dbf';
set newname for datafile 111 to '/data/oracle/oradata/emr5202205.dbf';
set newname for datafile 112 to '/data/oracle/oradata/neucbus_data2';
set newname for tempfile 1 to '/data/oracle/oradata/temp01';
set newname for tempfile 2 to '/data/oracle/oradata/temp02';
restore database;
switch datafile all;
switch tempfile all;
recover database;
}

6、修改日志文件

(1)查看日志文件

SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/data/oracle/data/group_601
/data/oracle/data/group_501
/data/oracle/data/group_201
/data/oracle/data/group_101
/data/oracle/data/group_301
/data/oracle/data/group_401
/data/oracle/data/group_701
/data/oracle/data/group_801
/data/oracle/data/group_2101
/data/oracle/data/group_2201
/data/oracle/data/group_2301
/data/oracle/data/group_2401
/data/oracle/data/group_2501
/data/oracle/data/group_3101
/data/oracle/data/group_3201
/data/oracle/data/group_3301
/data/oracle/data/group_3401
/data/oracle/data/group_3501
18 rows selected.

(2)修改日志文件

alter database rename file '+DATA/hisdb/onlinelog/group_6.267.1034787531' to '/data/oracle/data/group_601';
alter database rename file '+DATA/hisdb/onlinelog/group_5.327.1034787531' to '/data/oracle/data/group_501';
alter database rename file '+DATA/hisdb/onlinelog/group_2.262.1034787531' to '/data/oracle/data/group_201';
alter database rename file '+DATA/hisdb/onlinelog/group_1.270.1034787531' to '/data/oracle/data/group_101';
alter database rename file '+DATA/hisdb/onlinelog/group_3.269.1034787679' to '/data/oracle/data/group_301';
alter database rename file '+DATA/hisdb/onlinelog/group_4.257.1034787679' to '/data/oracle/data/group_401';
alter database rename file '+DATA/hisdb/onlinelog/group_7.272.1034787679' to '/data/oracle/data/group_701';
alter database rename file '+DATA/hisdb/onlinelog/group_8.261.1034787679' to '/data/oracle/data/group_801';
alter database rename file '+DATA/hisdb/onlinelog/group_21.344.1042904185' to '/data/oracle/data/group_2101';
alter database rename file '+DATA/hisdb/onlinelog/group_22.345.1042904185' to '/data/oracle/data/group_2201';
alter database rename file '+DATA/hisdb/onlinelog/group_23.346.1042904185' to '/data/oracle/data/group_2301';
alter database rename file '+DATA/hisdb/onlinelog/group_24.347.1042904187' to '/data/oracle/data/group_2401';
alter database rename file '+DATA/hisdb/onlinelog/group_25.348.1042904187' to '/data/oracle/data/group_2501';
alter database rename file '+DATA/hisdb/onlinelog/group_31.349.1042904199' to '/data/oracle/data/group_3101';
alter database rename file '+DATA/hisdb/onlinelog/group_32.350.1042904199' to '/data/oracle/data/group_3201';
alter database rename file '+DATA/hisdb/onlinelog/group_33.351.1042904199' to '/data/oracle/data/group_3301';
alter database rename file '+DATA/hisdb/onlinelog/group_34.352.1042904199' to '/data/oracle/data/group_3401';
alter database rename file '+DATA/hisdb/onlinelog/group_35.353.1042904201' to '/data/oracle/data/group_3501';

五、启动数据库

1、打开数据库

RMAN> alter database open resetlogs;
database opened

2、查看 redo log 信息,删除无效日志组(节点2日志)

SQL> select THREAD#, STATUS, ENABLED from v$thread;
   THREAD# STATUS ENABLED
---------- ------ --------
	 1 OPEN   PUBLIC
	 2 CLOSED PUBLIC
SQL> select group# from v$log where THREAD#=2;
    GROUP#
----------
	 3
	 4
	 7
	 8
/*
alter database drop logfile group 3;
alter database drop logfile group 4;
alter database drop logfile group 7;
alter database drop logfile group 8;
*/
SQL> alter database disable thread 2;
Database altered.
SQL>  alter database drop logfile group 3;
  2
SQL> alter database drop logfile group 3;
Database altered.
SQL> alter database drop logfile group 4;
Database altered.
SQL> alter database drop logfile group 7;
Database altered.
SQL> alter database drop logfile group 8;
Database altered.
SQL>  select THREAD#, STATUS, ENABLED from v$thread;
   THREAD# STATUS ENABLED
---------- ------ --------
	 1 OPEN   PUBLIC
SQL> select group#,member from v$logfile;
    GROUP#          MEMBER
--------------------------------------------------------------------------------
	 6          /data/oracle/data/group_601
	 5          /data/oracle/data/group_501
	 2          /data/oracle/data/group_201
	 1          /data/oracle/data/group_101
SQL> select * from v$log;
    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE	  MEMBERS ARC
---------- ---------- ---------- ---------- ---------- ---------- ---
STATUS		 FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------------- ------------- --------- ------------ ---------
	 1	    1	       5  104857600	   512		1 NO
CURRENT 	    3.4711E+10 31-JUL-22   2.8147E+14
	 2	    1	       2  104857600	   512		1 YES
INACTIVE	    3.4711E+10 31-JUL-22   3.4711E+10 31-JUL-22
	 5	    1	       3  104857600	   512		1 YES
INACTIVE	    3.4711E+10 31-JUL-22   3.4711E+10 31-JUL-22
	 6	    1	       4  104857600	   512		1 YES
INACTIVE	    3.4711E+10 31-JUL-22   3.4711E+10 31-JUL-22

3、查看 undo 表空间,并删除节点2的 undo 表空间

SQL> sho parameter undo;

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
undo_management 		     string	 AUTO
undo_retention			     integer	 900
undo_tablespace 		     string	 UNDOTBS1
SQL>
SQL>
SQL>
SQL>  select tablespace_name from dba_tablespaces where contents='UNDO';

TABLESPACE_NAME
------------------------------
UNDOTBS1
UNDOTBS2

SQL> drop tablespace UNDOTBS2 including contents and datafiles;

Tablespace dropped.

4、创建临时表空间

SQL> select tablespace_name from dba_tablespaces where contents='TEMPORARY';

TABLESPACE_NAME
------------------------------
TEMP

SQL> create temporary tablespace TEMP1 tempfile '/data/oracle/oradata/temp01.dbf' size 50M;

Tablespace created.

SQL> alter database default temporary tablespace TEMP1;

Database altered.

SQL> drop tablespace TEMP including contents and datafiles;

Tablespace dropped.

5、重启数据库,OK!!

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  233861120 bytes
Fixed Size		    2251976 bytes
Variable Size		  176161592 bytes
Database Buffers	   50331648 bytes
Redo Buffers		    5115904 bytes
Database mounted.
Database opened.

到此这篇关于把 Oracle 数据库从 RAC 集群迁移到单机环境的文章就介绍到这了,更多相关Oracle  RAC 集群迁移到单机环境内容请搜索我们以前的文章或继续浏览下面的相关文章希望大家以后多多支持我们!

(0)

相关推荐

  • oracle 数据库数据迁移解决方案

    去年年底做了不少系统的数据迁移,大部分系统由于平台和版本的原因,做的是逻辑迁移,少部分做的是物理迁移,有一些心得体会,与大家分享. 首先说说迁移流程,在迁移之前,写好方案,特别是实施的方案步骤一定要写清楚,然后进行完整的测试.我们在迁移时,有的系统测试了四五次,通过测试来完善方案和流程. 针对物理迁移,也即通过RMAN备份来进行还原并应用归档的方式(这里不讨论通过dd方式进行的冷迁移),虽然注意的是要将数据库设为force logging的方式,在用RMAN做全备之前,一定要执行: 否则可能会产

  • mysql数据库迁移至Oracle数据库

    本文实例为大家分享了java获取不同路径的方法,供大家参考,具体内容如下 1.使用工具: (1) Navicat Premium (2) PL/SQL Developer 11.0 (3) Oracle SQL Developer 4.0.0.12.84(点击可进入下载页面) 特别说明:最初我用的一直是高版本的SQL Developer,但在数据库移植到大概两分钟的时候,总是报错,而错误信息又不明确.最后换成 Oracle SQL Developer 4.0.0.12.84,才把问题解决掉!如果

  • oracle数据迁移到db2数据库的实现方法(分享)

    1.表结构迁移 在plsql中选择表----->dbmsMetadata----->ddl 注意:这时表的创建.约束等信息将会显示在窗口中.可以将创建表的语句直接拷贝值sqldbx(连接db2数据库的工具)中修改字段的类型,如varchar2转化为varchar,number转化为integer.还有primary key.unique的变化. 2.表数据迁移 在Plsql中选择表------>右键------>qurey data(显示出所有数据)---->选择需要迁移的数

  • Oracle集群 diagwait的问题记录

    前言 对于Oracle集群,有关diagwait的解释可以很容易在网上搜到: 该问题只会出现在ORACLE 11.2 以前版本中,在 11G R2版本中,diagwait的值默认配置为13. 而针对11.2以前的版本,需要手工将diagwait修改为13,以推迟重启的时间便于将缓存中的日志信息有足够的时间写入到磁盘文件中,以及减少因为与OS交互允许时间太短而造成的重启可能. diagwait算是一个小知识点,但具有普遍性.因为现实中很多客户生产数据库版本低于11.2,同时diagwait没有正确

  • 深入ORACLE迁移到MYSQL的总结分析

    这两个星期里一直都在忙于一件事儿,就是数据库的迁移问题.没有做的时候感觉这是一件十分轻松的事儿,可是等到实实在在去做去实现的时候,自己傻眼了.这种纠结啊, 在这里先说下遇到的问题:1.数据库的表结构问题:数据类型不同需要解决varchar2------varchar.number-----int.date----datetime,建表的sql语句字段默认值.注释怎么解决. 2. oracle中没有所谓的敏感字段,可是mysql表中的敏感字段有好多.当时出错的时候很奇怪不知道是哪里错了.原来有个d

  • 直接拷贝数据文件实现Oracle数据迁移

    背景介绍 由于机房服务器变更,需要将 Oracle 迁移到一台新服务器上去. 以下是环境说明: 原服务器地址: 192.168.1.15 新服务器地址: 192.168.1.18 操作系统:都是 CentOS 6.5 数据库版本: 都是 11.2.0.1 新服务器上安装和配置 Oracle 192.168.1.18 在新服务器(192.168.1.18)上安装了Oracle,为了保险,主机名.数据库实例名.安装目录都和原数据库保持一致.具体安装方法可参考:centos 6.5下安装oracle

  • 如何把Oracle 数据库从 RAC 集群迁移到单机环境

    目录 一.系统环境 二.源数据库的操作 三.目标数据库的操作 四.开始恢复数据库 五.启动数据库 把 Oracle 数据库从 RAC 集群迁移到单机环境 一.系统环境 1.源数据库 db_name:hisdb SID:hisdb1.hisdb2 IP: 192.168.1.101.192.168.1.102 os:CentOS Linux release 7.3.1611 (Core) 2.目标数据库 IP: 192.168.1.15 os:CentOS Linux release 7.3.16

  • Oracle 数据库操作技巧集

    正在看的ORACLE教程是:Oracle 数据库操作技巧集.[编者注:]提起数据库,第一个想到的公司,一般都会是Oracle(即甲骨文公司).Oracle在数据库领域一直处于领先地位.Oracle关系数据库系统是目前世界上流行的关系数据库管理系统,系统可移植性好.使用方便.功能强,适用于各类大.中.小.微机环境.Oracle9i是Oracle于今年6月份正式推出的数据库最新产品.Oracle9i在可伸缩性.可靠性和完整性方面有着上佳的表现,一推出就获得了开发者的认同.它是一种高效率.可靠性好的适

  • MySQL 集群迁移到 Kubernetes操作步骤

    目录 背景 适用场景 前提条件 操作步骤 Step 1:自建集群开启 GTID Step 2:容器集群在线迁移全量数据 Step 3:进行增量同步 Step 4:同步数据到容器集群的其他节点 Step 5:业务切换 Step 6:停止同步 总结 背景 如果你有自建的 MySQL 集群,并且已经感受到了云原生的春风拂面,想将数据迁移到 Kubernetes 上,那么这篇文章可以给你一些思路. 文中将自建 MySQL 集群数据,在线迁移到 Kubernetes 的 MySQL 集群中,快速实现了 M

  • k8s入门-集群组件介绍

    目录 k8s是谷歌以Borg为前身,基于谷歌15年生产环境经验的基础上开源的一个项目. k8s致力于提供跨主机集群的自动部署.扩展.高可用以及运行应用程序容器的平台. k8s集群包含master节点和node节点,是一个主从架构,通常我们会用3台服务器已高可用的形式作为主节点,不进行业务部署(可以设置要不要在主节点上部署应用):从节点作为工作节点. 以下为集群组件及功能: master节点:集群的控制中枢 kube-apiserver:集群的控制中枢,各模块间信息交互需要经过kube-apise

  • k8s入门集群组件介绍及概念理解

    目录 master节点:集群的控制中枢 node节点:工作节点,也叫worker节点 kube-system命名空间:系统组件pod k8s是谷歌以Borg为前身,基于谷歌15年生产环境经验的基础上开源的一个项目. k8s致力于提供跨主机集群的自动部署.扩展.高可用以及运行应用程序容器的平台. k8s集群包含master节点和node节点,是一个主从架构,通常我们会用3台服务器已高可用的形式作为主节点,不进行业务部署(可以设置要不要在主节点上部署应用):从节点作为工作节点. 以下为集群组件及功能

  • 分布式文档存储数据库之MongoDB分片集群的问题

    前文我们聊到了mongodb的副本集以及配置副本集,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/13953598.html:今天我们来聊下mongodb的分片: 1.什么是分片?为什么要分片? 我们知道数据库服务器一般出现瓶颈是在磁盘io上,或者高并发网络io,又或者单台server的cpu.内存等等一系列原因:于是,为了解决这些瓶颈问题,我们就必须扩展服务器性能:通常扩展服务器有向上扩展和向外扩展:所谓向上扩展就是给服务器加更大的磁盘,使用更大更好的内

  • MySQL的集群配置的基本命令使用及一次操作过程实录

    1. 先了解一下你是否应该用MySQL集群. 减少数据中心结点压力和大数据量处理,采用把MySQL分布,一个或多个application对应一个MySQL数据库.把几个MySQL数据库公用的数据做出共享数据,例如购物车,用户对象等等,存在数据结点里面.其他不共享的数据还维持在各自分布的MySQL数据库本身中. 2. 集群MySQL中名称概念.(如上图) 1)Sql结点(SQL node--上图对应为MySQLd):分布式数据库.包括自身数据和查询中心结点数据. 2)数据结点(Data node

  • redis集群规范详解

    本文档翻译自 http://redis.io/topics/cluster-spec . 引言 这个文档是正在开发中的 Redis 集群功能的规范(specification)文档, 文档分为两个部分: 第一部分介绍目前已经在 unstable 分支中实现了的那些功能. 第二部分介绍目前仍未实现的那些功能. 文档各个部分的内容可能会随着集群功能的设计修改而发生改变, 其中, 未实现功能发生修改的几率比已实现功能发生修改的几率要高. 这个规范包含了编写客户端库(client library)所需的

  • Docker快速搭建Redis集群的方法示例

    什么是Redis集群 Redis集群是Redis提供的分布式数据库方案,集群通过分片(sharding)来进行数据共享,并提供复制和故障转移功能. 节点 一个Redis集群通常由多个节点(node)组成,在刚开始的时候,每个节点都是相互独立的,它们都处于一个只包含自己的集群当中,要组建一个真正可工作的集群,我们必须将各个独立的节点连接起来,构成一个包含多个节点的集群. 集群配置 配置文件 下载配置文件:https://raw.githubusercontent.com/antirez/redis

  • docker搭建redis哨兵集群并且整合springboot的实现

    目录 1.创建两个文件夹redis和sentinel文件夹用于存放docker-compose.yml文件 2.redis下的docker-compose.yml 3.sentinel下的docker-compose.yml文件以及sentinel.conf配置文件 4.spring boot整合redis哨兵 5.哨兵工作方式 6.Redis-Cluster集群 7.redis常见问题 1.创建两个文件夹redis和sentinel文件夹用于存放docker-compose.yml文件 2.r

随机推荐