首页 » ORACLE 9i-23ai » Oracle升级利用从standalone到RAC standby switchover后,转换RAC和timezone时区升级?

Oracle升级利用从standalone到RAC standby switchover后,转换RAC和timezone时区升级?

 最近,我们的一位客户需要将其 Oracle 11.2.0.1 环境从 Windows 平台迁移到 Oracle 11.2.0.4 RAC on Linux 平台。当前数据库大小为 3TB,基于数据量和停机时间的考虑,因为 Windows 和 Linux x86 同为小字节序,并且 Oracle 支持这两个异构平台之间的 Data Guard(Physical Standby),我们最终决定采用 Oracle Data Guard 的方案。

迁移过程将包括以下步骤:

  1. 将原生产环境从 Windows 单实例切换为 Linux 平台上的 Oracle RAC。
  2. 升级数据库版本到 11.2.0.4。

在此过程中,需要注意的是由于数据字典是从原单实例同步的,可能会忽视当前 RAC 库缺少 RAC 组件的问题。此外,还需确认时区是否需要进行升级。

单实例转换RAC

缺少RAC 组件,是需要安装的。catclust.sql脚本可以发现比如重建与实例相关的view、Package等。也是缺少单实例转换RAC的步骤,以下有几个方法可以转换single instance database 到 RAC:

  • Manual Method
  • Using rconfig (from 10gR2)
  • Using DBCA
  • Using grid control

rconfig中使用了rman backup as copy的方式,所以会导致本地占用增加1倍空间,增加了停机时间,这里我们采用Manual Method。

手动处理的方法
1, 编辑spfile
2,恢复RAC 目标实例
3,switchover到RAC实例为Primary(读写)
4, 增加其它实例redo thread logfile ,并enable redo thread

e.g.
alter database add logfile thread 2 group 4 ('+DATA','+FLASH') size 50m ;
...
alter database enable public thread 2;

5, 增加其它实例UNDO TABLESPACE
6, 修改spfile增加其它实例属性

e.g.
*.cluster_database_instances=2
*.cluster_database=true
anbob1.instance_number=1
anbob2.instance_number=2
anbob1.thread=1
anbob2.thread=2
anbob1.undo_tablespace='UNDOTBS1'
anbob2.undo_tablespace='UNDOTBS2'

7, 复制pfile 和password文件到新实例

8, 运行RAC组件创建脚本catclust.sql (≈ 1min)

e.g.

@?/rdbms/admin/catclust.sql

COMP_ID    COMP_NAME                           STATUS     VERSION
---------- ----------------------------------- ---------- ----------
RAC        Oracle Real Application Clusters    VALID      11.2.0.4.0

9, 增加database \instance 到 OCR

srvctl add database -d anbob -o $ORACLE_HOME -p "+DATA/anbob/PARAMETERFILE/spfileanbob.ora"
srvctl add instance -d anbob -i anbob1 -n dbnode1
srvctl add instance -d anbob -i anbob2 -n dbnode2

DBCA方法可以参考 How to convert a non-RAC database to RAC database using dbca (文档 ID 2125586.1)

 

timezone时区文件是否升级?

升级后时区文件版本可能会发生变化,在11g没有发现不升级timezone文件带来的问题,在19c中可能会有一些已知bug.

查看timezone版本

SELECT version FROM v$timezone_file;

Countries occasionally change their time zones, or alter the way they handle daylight saving time (DST). From Oracle 11gR2 onward, new time zone files are shipped with upgrades and patches, but they are not automatically applied to the database.

Applying a change to the database time zone file not only affects the way new data is handled, but potentially alters data stored in TIMESTAMP WITH TIME ZONE columns, so you need to consider the impact of this before upgrading the time zone file.

Remember, if you only deal with dates in your country, and your country has not altered its time zone or daylight saving time policy, this upgrade may not be necessary.

通过上面的描述,实际上timezone文件是可以不用升的。与之相关的两个脚本 upg_tzv_check.sql 和upg_tzv_apply.sql, upg_tzv_check是仅做检查不会对数据库有任何修改。upg_tzv_apply(≈ 2min)是用于升级timezone, 但是这个脚本会重启2次数据库,增加了停机时间。 时区补丁不经常应用的一个原因.

查找最新的TZ补丁

MOS Note: 412160.1 – Updated DST Transitions and New Time Zones in Oracle RDBMS and OJVM Time Zone File Patches

 

 

打赏

目前这篇文章还没有评论(Rss)

我要评论