1.系统环境检查
Oracle版本:
[oracle@MES ~]$ sqlplus -v
Linux版本:
[oracle@MES ~]$ cat /etc/redhat-release
📣 2.检查升级条件
[oracle@MES ~]$ sqlplus / as sysdba
SYS@PROD> startup
SYS@PROD> col comp_name for a35
SYS@PROD> col version for a20
SYS@PROD> col name for a20
SYS@PROD> set linesize 1000
SYS@PROD> set pagesize 1000
SYS@PROD> SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;
--兼容性查看
SYS@PROD> col name for a40
SYS@PROD> col value for a30
SYS@PROD> SELECT name, value FROM v$parameter WHERE name = 'compatible';
📣 3、数据库全备
✨ 3.1 RMAN备份
确认归档是否打开:
SYS@PROD> archive log list
[oracle@MES ~]$ rman target /
RMAN> backup database plus archivelog delete input format ‘/home/bak/full_%U.dbf’;
RMAN> list backup;
RMAN> list archivelog all;
✨ 3.2 EXPDP备份
[root@MES ~]# mkdir -p /home/oracle/DEMP_EXP
[root@MES oracle]# chown -R oracle:oinstall /home/oracle/DEMP_EXP
[root@MES oracle]# ll
SYS@PROD> create directory expdp as '/home/oracle/DEMP_EXP';
SYS@PROD> grant read,write on directory EXPDP to SCOTT;
SYS@PROD> select * from dba_directories;
[oracle@MES ~]$ expdp scott/tiger directory=expdp dumpfile=full.dmp full=y logfile=full.log
📣 4、关闭数据库和监听
✨ 4.1 关闭数据库
SYS@PROD> shutdown immediate
✨ 4.2 关闭监听
[oracle@MES ~]$ lsnrctl status
[oracle@MES ~]$ lsnrctl stop
📣 5、备份Oracle目录
[oracle@MES ~]$ env | grep ora
[oracle@MES ~]$ tar -cvf product.zip /u01/app/oracle/product/
[oracle@MES ~]$ ll
[oracle@MES ~]$ tar -cvf oralnventory.zip /u01/app/oraInventory/
📣 6、解压11.2.0.4的安装包
[root@MES ~]# mkdir /soft
[root@MES soft]# unzip p13390677_112040_Linux-x86-64_1of7.zip
[root@MES soft]# unzip p13390677_112040_Linux-x86-64_2of7.zip
✨ 6.1 修改权限
[root@MES soft]# chown -R oracle:oinstall database/
[root@MES soft]# chmod -R +x database/
✨ 6.2 执行安装
在oracle 用户执行安装操作
[oracle@MES ~]$ cd /soft/database/
[oracle@MES database]$ ll
[oracle@MES database]$ ./runInstaller
📣 7、修改环境变量
[oracle@MES ~]$ vi .bash_profile
[oracle@MES ~]$ source .bash_profile
📣 8、查看版本号
SQL> col comp_name for a35
SQL> col version for a20
SQL> col name for a20
SQL> set linesize 1000
SQL> set pagesize 1000
SQL> SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;
✨ 8.1 处理OWB版本问题
SQL> @?/owb/UnifiedRepos/clean_owbsys.sql
SQL> @?/owb/UnifiedRepos/cat_owb.sql
SQL> @?/owb/UnifiedRepos/reset_owbcc_home.sql
再次查看:
✨ 8.2 检查无效对象
SQL> select * from dba_objects where status'VALID';
至此,数据库升级全部完成,验证数据库是否正常!
SQL> select * from v$version;
SQL> select status from v$instance;
————————————————
版权声明:本文为CSDN博主「IT邦德」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_41645135/article/details/131347178