Windows_Oracle_10g到Linux_Oracle19c_RAC的升级实现

Windows_Oracle_10g到Linux_Oracle19c_RAC的升级实现


2024年5月23日发(作者:)

NO.14

科技资讯

2023

SCIENCE & TECHNOLOGY INFORMATION

DOI: 10.16661/.1672-3791.2211-5042-5005

信息与智能

Windows Oracle 10g到Linux Oracle19c RAC的

升级实现

雷姣惠 李思琳 李捷波 肖文博 徐正雄

*

(联勤保障部队第九二〇医院信息科 云南昆明 650032)

摘要: 目的 探讨Oracle数据库系统跨版本跨平台升级实现的可行性方案。方法 从制订方案、方案实

施、数据验证方面,详细介绍了Oracle数据库升级的具体实施方法与技术要点。结果 实现Oracle数据库从

10g for Windows到19c RAC for Linux的跨多版本系统升级,系统稳定运行。结论 采用数据泵(expdp/im‐

pdp)工具,通过建立中间库的方式升级,安全可靠,可操作性强,对相同功能需求具有参考借鉴价值。

关键词: Oracle数据库 跨多版本 跨操作系统 升级 医院信息系统

中图分类号: TP316.7文献标识码: A 文章编号: 1672-3791(2023)14-0017-05

Implementation of Upgrading from Windows Oracle 10g to Linux

Oracle 19c RAC

LEI Jiaohui LI Silin LI Jiebo XIAO Wenbo XU Zhengxiong

*

(Information Department, the 920th Hospital of the Joint Logistics Support Force of PLA, Kunming, Yunnan

Province, 650032 China)

Abstract: Objective To discuss the feasible plan of the implementation of the cross-version and cross-platform

upgrade of the Oracle database system. Methods The specific implementation methods and technical points of the

upgrade of the Oracle database are introduced in detail from the aspects of the plan formulation, plan implementa‐

tion and data verification. Results The upgrade of the cross-muti-version system of the Oracle database from 10g

for windows to 19c RAC for linux is realized, and the system runs stably. Conclusion The data pump (expdp/im‐

pdp) tool is used, and the upgrade is made by establishing intermediate libraries, which is secure and reliable, has

strong operability, and has reference value for the same functional requirements.

Key Words: Oracle database; Cross multi-version; Cross operating system; Upgrade; Hospital information system

对医院信息化建设工作也提出了更高的要求

[2]

笔者医院信息系统(

Hospital Information System,

展,

HIS)数据库为基于Windows 2008系统的Oracle 10.2.0.5

版本,数据量为800 G,单机运行。硬件设备老化,系统

稳定性差,随着医院业务量的不断增加扩展,硬件和软

件都难以支撑日益增长的业务量和数据流

[1]

,存在严

重的系统与数据安全隐患。随着经济和社会的不断发

HIS数据作为医院的核心业务数据

[3]

,确保数据信息软

硬件的安全,运用科学的存储方式来保护数据信息,避

免遭受恶意或者意外损坏,防止数据信息的丢失

[4]

,是

医院信息系统安全工作的重中之重,因此对HIS升级

迫在眉睫。

作者简介: 雷姣惠(1987—),女,本科,工程师,研究方向为医院信息系统管理。

通信作者: 徐正雄(1973—),男,硕士,高级工程师,研究方向为数据库管理,E-mail:****************。

科技资讯SCIENCE & TECHNOLOGY INFORMATION

17

Copyright©博看网. All Rights Reserved.

信息与智能

1 升级方案

为解决上述问题,经过充分测试及论证,决定采用

数据泵(expdp/impdp)工具,通过建立中间库的方式,

实现HIS系统Oracle数据库从10g for Windows到19c

RAC for Linux的跨多版本系统升级。本升级方案的制

订,重点解决了Oralce10g到19c,Windows到Linux,单

2023 NO.14

SCIENCE & TECHNOLOGY INFORMATION

科技资讯

2.1.2 数据准备

源数据库利用RMAN工具进行数据库全备份:

RMAN> backup database;

在中转库上通过RMAN工具恢复数据:

RMAN> restore database;

RMAN> recover database;

机模式到RAC模式跨多版本跨平台升级的技术难点;

2.2 升级过程

升级时间选择业务量较小,对业务应用影响最小

数据迁移是医院信息系统数据库版本升级工作的核心

环节

[5]

,采用数据泵(expdp/impdp)工具进行数据导入/

导出保证升级过程简单可靠,采取基于高性能硬件设

备建立中转库的方案设计主要解决源数据库设备老旧

性能低下的问题,最大限度地缩短系统停机时间。此

方案对源数据库不做任何修改,如升级不成功,回退方

便快捷。升级流程如图1所示。

的时间段。此次升级选择周五23:00开始,此时医院业

务量少,降低升级中可能出现的问题对业务的影响。

并做好手工业务方案,提前通知各应用单位计划停机

时间为4 h。

2.2.1 停止应用

由于HIS系统客户端采用CS架构,采取停止源数

据库监听服务和KILL前端会话的方式停止数据库

应用。

2.2.2 拷贝归档文件到中转库

从源数据库拷贝归档文件至中转库:

Sql>alter database checkpoint;

Sql>alter system switch logfile;

2.2.3 中转库上应用归档日志

在中转库上应用归档日志并打开数据库:

RMAN>catalog start with ‘Y:archivelog’;

RMAN>recover database until cancel;

Sql>alter database open resetlogs;

2.2.4 中转库上导出数据

中转库上使用expdp工具导出数据expdp parfile=

parfile1,parfile脚本提前写好,数据通过NFS直接导出

到目标库的/data/backup目录。

2.2.5 在目标库上导入源数据

Impdpparfile=parfile1

exclude=table_data

双活集群搭建

Oracle 19.14 RAC集群

全闪存储

源数据库

Oracle

10.2.05

中转库(虚拟机)

Oracle

10.2.05

HIS DB1

HIS DB2

2 具体方案实施

医院信息系统是医院诊疗业务平稳开展的基本保

障,其数据库升级工作需做好升级前、升级实施中以及

升级后的各项工作。

2.1 准备工作

准备工作不影响业务,有充分的准备时间。在测

试环境中对每一个步骤与技术要点进行模拟,根据测

试报告得出准确的技术方案与升级实施时间计划。

2.1.1 系统准备

在中转库服务器安装操作系统及数据库版本与源

数据库一致的Oracle 10.2.0.5版本数据库;目标库服务

器安装CENTOS7.9版本操作系统和Oracle 19.4 RAC

集群。

在目标库服务器上配置NFS并挂载到中转库服务

器。配置目标服务器为NFS的服务器端;配置中转库

为NFS的目标端;把目标服务器的/data/backup目录映

射到中转库的Y盘目录。

[6]

图1 数据库升级流程

18

科技资讯SCIENCE & TECHNOLOGY INFORMATION

Copyright©博看网. All Rights Reserved.

NO.14

科技资讯

2023

SCIENCE & TECHNOLOGY INFORMATION

2.2.6 在目标库上禁止约束和触发器

select 'alter table '||owner||'.'||table_name||' disable

constraint '||constraint_name||';' from dba_constraints

where owner in ('AMDB_USER','ESB_USER','X5SYS_

SYS','DOC_SYS','APOI_SYS') and constraint_name not

like 'BIN%' and status='ENABLED';

select 'alter trigger '||owner||'.'||trigger_name||' dis‐

able;' from dba_triggerswhere owner in ('AMDB_USER',

'ESB_USER','X5SYS_SYS','DOC_SYS','APOI_SYS') and

status='ENABLED';

2.2.7 在目标数据库导入表数据

Impdpparfile=parfile1

include=table_data

2.2.8 启用约束和触发器

select 'alter table '||owner||'.'||table_name||' enable

constraint '||constraint_name||';' from dba_constraints

where owner in ('AMDB_USER','ESB_USER','X5SYS_

SYS','DOC_SYS','APOI_SYS') and constraint_name not

like 'BIN%' and status='DISABLED' and constraint_name

<>'FK_RESOURCES_REF_EQUIPMENTS'

select 'alter trigger '||owner||'.'||trigger_name||' enable;

' from dba_triggerswhere owner in ('AMDB_USER',

'ESB_USER','X5SYS_SYS','DOC_SYS','APOI_SYS') and

status='DISABLED';

2.2.9 更改scanip

srvctl stop scan_listener

srvctl stop scan

srvctl modify scan -n 191.53.21.10

srvctl start scan

srvctl start scan_listener

2.2.10 应用测试

通过客户应用端测试各业务系统运行是否正常,

数据提取、回写是否正确。

2.2.11 修改目标库IP

以上步骤完成后,验证数据无问题,修改目标库IP

地址,使其与生产库IP地址一致。

信息与智能

SQL> insert into etime select to_char

(sysdate, 'yyyymmdd HH24:mi:ss') time from dual;

SQL> exit

(2)中转库以resetlogs打开后查询前插入的数据

是否能查询到:

SQL>Database altered.

SQL> alter database open resetlogs;

SQL>select * from etime;

(3)目标库数据导入完成后查询之前插入的数据

是否能查询到:

SQL>select * from etime;

3.2 源端数据库、目标数据库权限比对

具体如下:

SET FEEDBACK ON

set long 999999

SET PAGESIZE 10000

set heading off

set echo off

col sql_txt for a100

---grant role

select 'grant ' || D_ROLE || ' to ' || s.

grantee || ';' sql_txt

from dba_role_privs@xttslink s

where e not in (select username from

oracle_default_users)

and _option = 'NO'

and not exists (select 1

from dba_role_privs ss

where E = E

and D_ROLE = D_ROLE

and _OPTION = _OPTION)

union

---grant role with admin

select 'grant ' || D_ROLE || ' to ' || s.

grantee ||

' with admin option;' sql_txt

from dba_role_privs@xttslink s

where e not in (select username from

oracle_default_users)

and _option = 'YES'

and not exists (select 1

科技资讯SCIENCE & TECHNOLOGY INFORMATION

3 数据验证

3.1 模拟最新数据查询验证

(1)迁移前在老的数据库插入当前的时间:

SQL>TIME

19

Copyright©博看网. All Rights Reserved.

信息与智能

from dba_role_privs ss

where E = E

and D_ROLE = D_ROLE

and _OPTION = _OPTION)

union

---grant system privilege

select 'grant ' || ege || ' to ' || e || ';'

sql_txt

from dba_sys_privs@xttslink S

where e not in (select username from

oracle_default_users)

and _option = 'NO'

and not exists (select 1

from dba_sys_privs ss

where E = E

and EGE = EGE

and _OPTION = _OPTION)

union

---grant sys privilege with admin

select 'grant ' || privilege || ' to ' || grantee || ' with

admin option;' sql_txt

from dba_sys_privs@xttslink S

where e not in (select username from

oracle_default_users)

and _option = 'YES'

and not exists (select 1

from dba_sys_privs ss

where E = E

and EGE = EGE

and _OPTION = _OPTION)

union

---grant table privilege to user or role

select 'grant ' || ege || ' on ' || || '.' || s.

table_name ||

' to ' || e || ';' sql_txt

from dba_tab_privs@xttslink s

where e not in (select username from

oracle_default_users)

and not in (select username from oracle_de‐

fault_users)

and ble = 'NO'

and not exists (select 1

20

科技资讯SCIENCE & TECHNOLOGY INFORMATION

2023 NO.14

SCIENCE & TECHNOLOGY INFORMATION

科技资讯

from dba_tab_privs ss

where E = E

and =

and _name=_name

and r=r

and ege=ege

and BLE=BLE

and CHY=CHY)

union

---grant table privilege to user or role with grantable

='YES'

select 'grant ' || ege || ' on ' || || '.' || s.

table_name ||

' to ' || e || 'with grant option;' sql_txt

from dba_tab_privs@xttslink s

where e not in (select username from

oracle_default_users)

and not in (select username from oracle_de‐

fault_users)

and ble = 'YES'

and not exists (select 1

from dba_tab_privs ss

where E = E

and =

and _name=_name

and r=r

and ege=ege

and BLE=BLE

and CHY=CHY);

3.3 源数据库、目标数据库对象比对

获取缺少对象的ddl语句:

set long 100000

set pages 0

set linesize 200

col aa format a100

select dbms__ddl(_type,‐

ject_name,)||';' from dba_objects@xttslink s

where not in (select username from

oracle_default_users)

and <>'PUBLIC'

and _type<>'LOB'

and object_type not like 'JAVA%'

Copyright©博看网. All Rights Reserved.

NO.14

科技资讯

2023

SCIENCE & TECHNOLOGY INFORMATION

信息与智能

图2 日志数据对比

and object_name not like '%$%'

and substr(_name,1,4)<>'SYS_'

and not exists (select 1

from dba_objects ss

where _type = _type

and =

and _name = _name)

order by _type, , _name ;

3.4 expdp导出日志和impdp导入日志数据条数比对

系统数据库升级最重要的是保障升级前后数据的

一致性。导出日志会详细地记录导出每张表数据的

条数。导入日志也会显示导入每张表数据的条数,两

个数据要求要相等。日志数据对比如图2所示。

[7]

小,回退机制最佳且安全可靠的方案,并对升级方案进

行充分测试,对客户端可用性进行验证;升级中,严格

按照预演的方案进行升级,并对数据进行验证,确保数

据一致性和完整性;升级后,对各个应用程序进行充分

测试,保证业务系统应用正常。此方案在实际升级过

程中安全顺利,业务系统停机时间不到4 h,实现Oracle

数据库从10g for Windows到19c RAC for Linux的跨多

版本系统升级,系统升级后性能稳定,数据安全,可操

作性强,对相同功能需求具有参考借鉴价值。

参考文献

[1]伊永菊,梅甜,李银.使用RMAN方式实现医院信息系

统数据库升级实践[J].现代医院,2022,22(5):754-756.

[2]黄红军.医院计算机信息安全风险管理控制研究[J].

科技创新导报,2020,17(5):120-121.

[3]曹定舟,赵余.HIS数据库跨平台升级迁移实践[J].信

息与电脑(理论版),2020,32(21):122-125.

[4]郭东峰.数据信息安全研究[J].科技创新导报, 2020,

17(19):133-134,137.

[5]李雪峰,陈丽荣,陈洁,等.高校数字化校园核心数据库

升级研究与实践[J].中国教育信息化,2017(15):52-58.

践[J].中国卫生信息管理杂志,2020,17(2):215-217.

[7]潘天祥,张芳健.医院信息系统服务器及数据库升级的

过程管理[J].心电图杂志(电子版),2018,7(4):197-198.

科技资讯SCIENCE & TECHNOLOGY INFORMATION

4 升级后需注意的问题

(1)升级后,Oracle 8i以下版本的客户端不能正常

使用应用程序,需将客户端卸载后安装高版本Oracle,

医院安装的是Oracle10g以上版本的客户端。

(2)由于有的系统通过SID访问数据库,因此目标

库需要配置SID自动转化为服务名。

(3)在验证过程中发现WM_CONCAT函数失效,原

因是Oracle 19c不支持WM_CONCAT函数,需重新创建。

[6]余莎莎,肖辉.医院信息系统数据库跨版本升级实

5 结语

HIS数据库升级必须保障医院业务数据的连续

性。升级前,需对方案进行评估,选择对业务影响最

21

Copyright©博看网. All Rights Reserved.


发布者:admin,转转请注明出处:http://www.yc00.com/web/1716419759a2727780.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信