oracle12c到19c adg搭建(六)切换后12c备库服务器安装19c软件在19c主库升级数据字典后尝试同步

一、安装19c软件

参考文章oracle12c到19c adg搭建(三)oracle19c数据库软件安装

二、原主库尝试通过19c软件启动数据库

2.1复制12c的相关参数文件和密码文件到19c目录

注意:密码文件需要从已切换主库19c传过来

oracle@o12u19p \~\]$ cd /u01/app/oracle/product/12.1.0.2/dbhome_1/dbs/ \[oracle@o12u19p dbs\]$ ls hc_orcl.dat init.ora initorcl.ora lkORCL orapworcl snapcf_orcl.f spfileorcl.ora \[oracle@o12u19p dbs\]$ cp \* /u01/app/oracle/product/19.3.0.0/dbhome_1/dbs/ \[oracle@o12u19p dbs\]$ cd /u01/app/oracle/product/19.3.0.0/dbhome_1/dbs/ \[oracle@o12u19p dbs\]$ ls hc_orcl.dat init.ora initorcl.ora lkORCL orapworcl snapcf_orcl.f spfileorcl.ora \[oracle@o12u19p dbs\]$ ### 2.2主库生成控制文件 SQL\> ALTER DATABASE CREATE standby controlfile AS '/backup/orcl.ctl'; Database altered. \[oracle@o12u19s backup\]$ scp orcl.ctl oracle@o12u19p:/backup![](https://img-blog.csdnimg.cn/direct/9deb13284d574c2bbb85a60b8f97749c.png) ### 2.3恢复控制文件 \[oracle@o12u19p backup\]$ sqlplus / as sysdba SQL\*Plus: Release 19.0.0.0.0 - Production on Wed Jun 19 10:02:39 2024 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to an idle instance. SQL\> startup nomount ORACLE instance started. Total System Global Area 6174013840 bytes Fixed Size 9148816 bytes Variable Size 1056964608 bytes Database Buffers 5100273664 bytes Redo Buffers 7626752 bytes SQL\> RMAN\> restore controlfile from'/backup/orcl.ctl'; Starting restore at 19-JUN-24 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=21 device type=DISK channel ORA_DISK_1: copied control file copy output file name=/u01/app/oracle/oradata/orcl/control01.ctl output file name=/u01/app/oracle/fast_recovery_area/orcl/control02.ctl Finished restore at 19-JUN-24 RMAN\> ### 2.4复制12c监听文件到19c目录下并启动监听文件 \[oracle@o12u19p admin\]$ cd /u01/app/oracle/product/12.1.0.2/dbhome_1/network/admin/ \[oracle@o12u19p admin\]$ scp \* /u01/app/oracle/product/19.3.0.0/dbhome_1/network/admin/ cp: omitting directory 'samples' \[oracle@o12u19p admin\]$ ls listener.ora samples shrept.lst sqlnet.ora tnsnames.ora \[oracle@o12u19p admin\]$ lsnrclt start bash: lsnrclt: command not found... \[oracle@o12u19p admin\]$ lsnrctl start ![](https://img-blog.csdnimg.cn/direct/a0e2a8104eef4a5d83da7a4e92b13ca7.png) ### 2.5备库开库 \[oracle@o12u19p admin\]$ sqlplus / as sysdba SQL\*Plus: Release 19.0.0.0.0 - Production on Wed Jun 19 10:29:44 2024 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL\> alter database open 2 ; 报错: ![](https://img-blog.csdnimg.cn/direct/e3072693e7404612b30f88e7577f29e0.png) ![](https://img-blog.csdnimg.cn/direct/c72add861d0149f3826e1a1f81c10b38.png) 由于控制文件的scn和数据文件的scn差异过大导致 ### 2.6尝试从主库拷贝一些日志到备库 备库尝试日志应用 \[oracle@o12u19s backup\]$ cd /u01/app/oracle/oradata/ \[oracle@o12u19s oradata\]$ ls orcl orcldg \[oracle@o12u19s oradata\]$ cd orcldg/ \[oracle@o12u19s orcldg\]$ ls arch pdb1 pdbseed sysaux01.dbf system01.dbf temp01.dbf undotbs01.dbf users01.dbf \[oracle@o12u19s orcldg\]$ cd arch/ \[oracle@o12u19s arch\]$ ls ![](https://img-blog.csdnimg.cn/direct/8e2667c7f19a4b658916f24e7c401c47.png) 备库日志到1-27 ![](https://img-blog.csdnimg.cn/direct/0a6df3f90fda4ee0ab538056c8e1be7a.png) 主库从1-28开始拷贝 \[oracle@o12u19s arch\]$ scp 1_28_1171969607.dbf 1_28_1171991791.dbf 1_29_1171991791.dbf 1_30_1171991791.dbf 1_31_1171991791.dbf oracle@o12u19p:/u01/app/oracle/oradata/orcl/arch ![](https://img-blog.csdnimg.cn/direct/43f94103d0704a3d9fb2e94915a2258c.png) ### 2.7开启日志应用 alter database recover managed standby database using current logfile disconnect from session; ![](https://img-blog.csdnimg.cn/direct/81f92d6d35ab41dfbe2b85d730973a6f.png) ### 2.8主备库打开pdb SQL\> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB1 MOUNTED SQL\> alter pluggable database pdb1 open; Pluggable database altered. ## 三、主备库同步检查 主库查看seq SQL\> select sequence#,applied from v$archived_log order by sequence# asc; ![](https://img-blog.csdnimg.cn/direct/c845a92552d34b98b44e44e966221541.png) 备库查看seq ![](https://img-blog.csdnimg.cn/direct/cce4eb204afb4ae7b2951666990ce522.png) 可以看到备库已经开始同步主库的日志从283开始。 至此我们完成了12c到19cadg的搭建及12c滚动升级到19c的过程

相关推荐
漫谈网络3 分钟前
什么是RDMA?—— 一场网络通信的范式革命
运维·服务器·网络
程序边界21 分钟前
国产之光!金仓数据库KingbaseES Oracle兼容性深度体验大赏
数据库·oracle
tt666qq43 分钟前
linux文件系统学习
linux·运维·学习
杨云龙UP1 小时前
SQL Server数据库事务日志问题的诊断与解法(从膨胀到瘦身)
运维·数据库·sql·sqlserver·serverless
七七七七071 小时前
【Linux系统】进程替换
linux·运维·服务器
霍格沃兹软件测试开发3 小时前
Playwright MCP浏览器自动化详解指南
运维·自动化
前行居士3 小时前
Sub-process /usr/bin/dpkg returned an error code (1)
linux·运维·windows
蒋星熠3 小时前
爬虫与自动化技术深度解析:从数据采集到智能运维的完整实战指南
运维·人工智能·爬虫·python·深度学习·机器学习·自动化
迎風吹頭髮4 小时前
UNIX下C语言编程与实践19-UNIX 三级索引结构:直接索引、一级/二级/三级间接索引的文件存储计算
运维·云计算·unix
数智顾问4 小时前
AI自动化测试:接口测试全流程自动化的实现方法——从需求到落地的全链路实践
运维·人工智能·自动化