没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
环境描述:
原有双节点 RAC 集群由于数据库故障,导致不能启动,经综合评估,备份软件有 10 天前的备
份,经过分析和用户的沟通,最终用户选择了,
1.由备份软件恢复数据库到一台单机,恢复成功后,备份软件对新的单机做定期备份。单机
采用 IP 为 dbscan IP 这样对应用基本没有影响。
2.单机运行 2 个周,确保数据正常的情况下,将原有 RAC 集群清理,重新搭建 RAC 环境。
3.将单机数据库生产数据数据迁移至新的 RAC 环境。备份软件对新的 RAC 环境设置定期备份
策略。
本次文章,中间环节忽略,只做第 3 个步骤的数据库迁移。
环境:
单机生产库: 172.19.4.15/24 root/WWW.root123
RAC 目标库: root/Huawei@123
#public ip ent1
172.19.4.11 rac01
172.19.4.12 rac02
#priv ip ent2
10.10.10.1 rac01prv
10.10.10.2 rac02prv
#vip ip
172.19.4.13 rac01vip
172.19.4.14 rac02vip
#scan ip
172.19.4.15 racscan
注意:由于环境有 IP 冲突的问题,有些步骤是按非常规处理。
迁移步骤:
2024-09-15 晚上
1.对 RAC02 数据库服务器更改 root 密码
2.备份现有单机数据库 racdb 全备(几小时)
2024-09-16 早上
1.传输文件到 rac 节点 1(速率较低,不影响业务,等待即可)
2.对数据库服务器执行第二次增量备份
3.关闭数据库,此时已经影响业务。(因为假期,可停机时间足以满足整体迁移,所以此步停
业务迁移)
4.对 RAC 环境做调整,清空原有数据库信息。
5.执行异机恢复,使用归档做二次追加推到最新时间点
6.做集群后续调整
7.开启集群服务
8.应用测试数据库,检查数据情况
--创建数据库全备
$mkdir -p /oracle/app/oracle/bak240915/racdb
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name RACDB are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD
TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO
'/oracle/app/oracle/product/11.2.0/db_1/dbs/snapcf_racdb.f'; # default
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> CONFIGURE BACKUP OPTIMIZATION ON;
RMAN> show all;
RMAN configuration parameters for database with db_unique_name RACDB are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD
TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO
'/oracle/app/oracle/product/11.2.0/db_1/dbs/snapcf_racdb.f'; # default
RMAN>
[oracle@racdb:/home/oracle]$sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Sun Sep 15 00:36:57 2024
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select name,open_mode from v$database;
NAME OPEN_MODE
--------- --------------------
RACDB READ WRITE
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oracle/app/oracle/oradata/archive
Oldest online log sequence 448
Next log sequence to archive 452
Current log sequence 452
SQL>
[root@racdb ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 90G 20G 66G 24% /
tmpfs 64G 300K 64G 1% /dev/shm
/dev/sda1 1008M 62M 896M 7% /boot
/dev/mapper/datavg-oradatalv 1007G 255G 702G 27% /oracle/app/oracle/oradata
--备份数据库
rman target /
crosscheck archivelog all;
crosscheck backup;
delete expired archivelog all;
delete expired backup;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> CONFIGURE BACKUP OPTIMIZATION ON;
--备份脚本
run
{
allocate channel d1 type disk;
sql 'alter system archive log current';
backup format '/bak/racdb/racdbfull_%U' database include current controlfile plus
archivelog ;
release channel d1;
}
--查看备份进度
SELECT SID, SERIAL#, OPNAME,
TO_CHAR(START_TIME, 'YYYY-MM-DD HH24:MI:SS') START_TIME,
SOFAR, TOTALWORK,
CEIL(ELAPSED_SECONDS/60) ELAPSED_MI,
ROUND(SOFAR/TOTALWORK*100,2) "%COMPLETE"
FROM V$SESSION_LONGOPS
WHERE OPNAME LIKE 'RMAN%'
AND SOFAR <> TOTALWORK
AND TOTALWORK <> 0
ORDER BY START_TIME ASC;
---------
[oracle@racdb:/bak]$rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Sep 15 01:39:57 2024
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: RACDB (DBID=983004276)
RMAN> run
2> {
3> allocate channel d1 type disk;
4> sql 'alter system archive log current';
5> backup format '/bak/racdb/racdbfull_%U' database include current controlfile plus
archivelog ;
6> release channel d1;
7> }
using target database control file instead of recovery catalog
allocated channel: d1
channel d1: SID=6607 device type=DISK
sql statement: alter system archive log current
Starting backup at 2024-09-15 01:40:06
current log archived
skipping archived logs of thread 1 from sequence 370 to 457; already backed up
channel d1: starting archived log backup set
channel d1: specifying archived log(s) in backup set
input archived log thread=1 sequence=458 RECID=461 STAMP=1179711606
input archived log thread=1 sequence=459 RECID=462 STAMP=1179711606
channel d1: starting piece 1 at 2024-09-15 01:40:06
channel d1: finished piece 1 at 2024-09-15 01:40:07
piece handle=/bak/racdb/racdbfull_3o351u3m_1_1 tag=TAG20240915T014006
comment=NONE
channel d1: backup set complete, elapsed time: 00:00:01
Finished backup at 2024-09-15 01:40:07
Starting backup at 2024-09-15 01:40:07
channel d1: starting full datafile backup set
channel d1: specifying datafile(s) in backup set
input datafile file number=00002
name=/oracle/app/oracle/oradata/df2_sysaux.263.985387525
input datafile file number=00006
name=/oracle/app/oracle/oradata/df6_ts_zsj_d01.dbf
input datafile file number=00007
name=/oracle/app/oracle/oradata/df7_dev_odi_user01.dbf
input datafile file number=00013 name=/oracle/app/oracle/oradata/df2_sysaux02
input datafile file number=00010
name=/oracle/app/oracle/oradata/df10_dev_odi_user02.dbf
input datafile file number=00004
name=/oracle/app/oracle/oradata/df4_undotbs2.266.985387551
input datafile file number=00001
name=/oracle/app/oracle/oradata/df1_system.262.985387513
input datafile file number=00003
name=/oracle/app/oracle/oradata/df3_undotbs1.264.985387537
input datafile file number=00012
name=/oracle/app/oracle/oradata/df12_ts_zsj_d02.dbf
input datafile file number=00008 name=/oracle/app/oracle/oradata/df8_combanc.dbf
input datafile file number=00009 name=/oracle/app/oracle/oradata/df9_uum.dbf
input datafile file number=00011
name=/oracle/app/oracle/oradata/df11_dev1_odi_user.281.1101743941
剩余51页未读,继续阅读
资源评论
king01299
- 粉丝: 388
- 资源: 384
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功