哈喽!大家好,我是【IT邦德】,江湖人称jeames007,10余年DBA及大数据工作经验
一位上进心十足的【大数据领域博主】!
中国DBA联盟(ACDU)成员,目前服务于工业互联网
擅长主流Oracle、MySQL、PG、高斯及Greenplum运维开发,备份恢复,安装迁移,性能优化、故障应急处理等。
✨ 如果有对【数据库】感兴趣的【小可爱】,欢迎关注【IT邦德】
❤️❤️❤️感谢各位大可爱小可爱!❤️❤️❤️
Oracle版本:
[oracle@MES ~]$ sqlplus -v
Linux版本:
[oracle@MES ~]$ cat /etc/redhat-release
[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';
确认归档是否打开:
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;
[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
SYS@PROD> shutdown immediate
[oracle@MES ~]$ lsnrctl status
[oracle@MES ~]$ lsnrctl stop
[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/
[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
[root@MES soft]# chown -R oracle:oinstall database/
[root@MES soft]# chmod -R +x database/
在oracle 用户执行安装操作
[oracle@MES ~]$ cd /soft/database/
[oracle@MES database]$ ll
[oracle@MES database]$ ./runInstaller
[oracle@MES ~]$ vi .bash_profile
[oracle@MES ~]$ source .bash_profile
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;
SQL> @?/owb/UnifiedRepos/clean_owbsys.sql
SQL> @?/owb/UnifiedRepos/cat_owb.sql
SQL> @?/owb/UnifiedRepos/reset_owbcc_home.sql
再次查看:
SQL> select * from dba_objects where status<>'VALID';
至此,数据库升级全部完成,验证数据库是否正常!
SQL> select * from v$version;
SQL> select status from v$instance;