1、環境準備
環境準備工作,需要在升級前完成,這裏不做過多介紹。
我的環境如下:
虛擬機:rhel 7.4
升級前數據庫版本:oracle 12.1.0.2
升級後數據庫版本:oracle 12.2.0.1
參考文檔:https://docs.oracle.com/en/database/oracle/oracle-database/12.2/upgrd/checklists-for-oracle-database-upgrade.html#GUID-5FAA2A12-87C5-4D65-B7AE-C9D67FA4F05F
2、升級前工作
1、升級前一定要先備份數據,防止升級失敗。
2、創建測試數據
SQL> create user ogg identified by ogg;
User created.
SQL> ant dba to ogg;
Grant succeeded.
SQL> create table ogg.a (
2 dd nvarchar2(11),
3 aa nvarchar2(11)
4 )
5 ;
Table created.
SQL>
SQL> insert into ogg.a VALUES ('aa','22');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from ogg.a;
DD AA
----------- -----------
aa 22
SQL> exit
3、安裝升級
切換到oracle12.2.0.1的安裝目錄執行runInstaller
[oracle@test1 ~]$ cd /soft/database/
[oracle@test1 database]$ ./runInstaller
1、取消安全更新,下一步
2、選擇升級現有數據庫。
3、下一步
4、指定oracle12.2軟件的安裝目錄。
5、下一步
6、下一步
7、安裝
8、另外一個窗口以root用戶執行腳本
[root@test1 soft]# /u01/app/oracle/product/12.2.0/dbhome_1/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/12.2.0/dbhome_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The contents of "coraenv" have not changed. No need to overwrite.
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Do you want to setup Oracle Trace File Analyzer (TFA) now ? yes|[no] :
y
Installing Oracle Trace File Analyzer (TFA).
Log File: /u01/app/oracle/product/12.2.0/dbhome_1/install/root_test1_2020-06-22_13-57-40-716080198.log
Finished installing Oracle Trace File Analyzer (TFA)
[root@test1 soft]#
9、輸入原庫的sys用戶和密碼。
10、下一步
11、默認,下一步。
12、如果之前有手動備份數據,選擇第三項,沒有備份選擇第二項進行數據備份。
12、默認監聽,下一步。
13、下一步。
14、下一步,完成
15、等待升級完成。
16、等待完成即可。
17、修改環境變量到新的ORACLE_HOME
18、驗證數據是否一致。