11.2.0.4 upgrade to 19.3.0.0
本文的環境都使用相同的作業系統:Oracle Linux 7.5。11g資料檔案存放在檔案系統上,而19c的資料檔案存放在ASM上,中間使用NFS暫存資料檔案,然後透過rman的可傳輸表空間特性進行遷移。
1、源端檢查
由於rman不能自動遷移目錄、外部表以及BFILEs,所以必須使用下面的命令進行檢查,然後手工在目標端建立:
[oracle@rhndb ~]$ sqlplus "/as sysdba" SQL> set serveroutput on; SQL> declare x boolean;begin x:=dbms_tdb.check_external;end; 2 / The following directories exist in the database: SYS.DMP, SYS.XMLDIR, SYS.ORACLE_OCM_CONFIG_DIR2, SYS.ORACLE_OCM_CONFIG_DIR, SYS.DATA_PUMP_DIR PL/SQL procedure successfully completed. SQL> set linesize 300 SQL> col directory_name for a25 SQL> col directory_path for a70 SQL> select directory_name,directory_path from dba_directories;
2、重啟資料庫至只讀狀態
SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount ORACLE instance started. Total System Global Area 3206836224 bytes Fixed Size 2257520 bytes Variable Size 738200976 bytes Database Buffers 2449473536 bytes Redo Buffers 16904192 bytes Database mounted. SQL> alter database open read only; Database altered.
3、DBMS_TDB.CHECK_DB檢查資料庫狀態
SQL> set serveroutput on; SQL> declare db_ready boolean; 2 begin 3 db_ready :=dbms_tdb.check_db('Linux x86 64-bit',dbms_tdb.skip_none); 4 end; 5 / PL/SQL procedure successfully completed.
4、列出需要轉換和不需要轉換的資料檔案
SQL> select file_name "Datafiles requiring Conversion" from dba_data_files where tablespace_name in (select distinct tablespace_name from dba_rollback_segs); Datafiles requiring Conversion ------------------------------------------------------------ /u02/oradata/rhndb/undotbs01.dbf /u02/oradata/rhndb/system01.dbf SQL> select file_name "Files NOT requiring Conversion" from dba_data_files where tablespace_name not in (select distinct tablespace_name from dba_rollback_segs); Files NOT requiring Conversion ------------------------------------------------------------ /u02/oradata/rhndb/users01.dbf /u02/oradata/rhndb/sysaux01.dbf /u02/oradata/rhndb/spw01.dbf
5、複製源資料庫的資料檔案至目標端
這裡的目標端使用了ASM,所以不能直接存放。因此使用了NFS檔案系統臨時存放源端資料檔案。
[oracle@rhndb ~]$ cp /u02/oradata/rhndb/* /u03/orabak
6、建立目標庫引數檔案並啟動至nomont
SQL> create pfile='/tmp/initrhndb.ora' from spfile; [oracle@rhndb ~]$ scp /tmp/initrhndb.ora db02:$ORACLE_HOME/dbs --修改引數檔案中的audit_file_dest,control_files,db_name,db_recover_file_dest,diagnostic_dest [oracle@rhndb ~]$ vi $ORACLE_HOME/dbs/initrhndb.ora rhndb.__db_cache_size=2516582400 rhndb.__java_pool_size=16777216 rhndb.__large_pool_size=33554432 rhndb.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment rhndb.__pga_aggregate_target=1073741824 rhndb.__sga_target=3221225472 rhndb.__shared_io_pool_size=0 rhndb.__shared_pool_size=620756992 rhndb.__streams_pool_size=0 *.audit_file_dest='/u01/app/oracle/admin/rhndb/adump' *.audit_trail='db' *.compatible='11.2.0.4.0' *.control_files='+DATA/rhndb/controlfile/control01.ctl','+FRA/rhndb/controlfile/control02.ctl' *.db_block_size=8192 *.db_domain='' *.db_name='rhndb' *.db_recovery_file_dest='+FRA' *.db_recovery_file_dest_size=4385144832 *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=rhndbXDB)' *.open_cursors=300 *.pga_aggregate_target=1073741824 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=3221225472 *.undo_tablespace='UNDOTBS1' *._allow_resetlogs_corruption=true --啟動時nomount狀態 [oracle@db02 ~]$ sqlplus "/as sysdba" SQL> startup nomount pfile=/tmp/initrhndb.ora ORACLE instance started. Total System Global Area 3221222464 bytes Fixed Size 8901696 bytes Variable Size 671088640 bytes Database Buffers 2533359616 bytes Redo Buffers 7872512 bytes
7、資料檔案轉換
不論兩個平臺的endian format是否相同,都需要進行轉換操作。根據第四步的資訊,在rman中執行轉換操作,如下:
[oracle@db02 ~]$ rman target / --轉換操作 RMAN> convert from platform 'Linux x86 64-bit' parallelism 2 2> datafile '/u03/orabak/system01.dbf' format '+data' 3> datafile '/u03/orabak/undotbs01.dbf' format '+data'; Starting conversion at target at 28-APR-2019 19:03:38 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=135 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=198 device type=DISK channel ORA_DISK_1: starting datafile conversion input file name=/u03/orabak/undotbs01.dbf channel ORA_DISK_2: starting datafile conversion input file name=/u03/orabak/system01.dbf converted datafile=+DATA/RHNDB/DATAFILE/system.258.1006801423 channel ORA_DISK_2: datafile conversion complete, elapsed time: 00:01:35 converted datafile=+DATA/RHNDB/DATAFILE/undotbs1.257.1006801423 channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:01:55 Finished conversion at target at 28-APR-2019 19:05:36 --透過rman複製資料檔案至ASM磁碟組 RMAN> convert parallelism 3 2> datafile '/u03/orabak/users01.dbf' format '+data' 3> datafile '/u03/orabak/sysaux01.dbf' format '+data' 4> datafile '/u03/orabak/spw01.dbf' format '+data'; Starting conversion at target at 28-APR-2019 19:07:32 using channel ORA_DISK_1 using channel ORA_DISK_2 allocated channel: ORA_DISK_3 channel ORA_DISK_3: SID=2 device type=DISK channel ORA_DISK_1: starting datafile conversion input file name=/u03/orabak/spw01.dbf channel ORA_DISK_2: starting datafile conversion input file name=/u03/orabak/sysaux01.dbf channel ORA_DISK_3: starting datafile conversion input file name=/u03/orabak/users01.dbf converted datafile=+DATA/RHNDB/DATAFILE/users.261.1006801653 channel ORA_DISK_3: datafile conversion complete, elapsed time: 00:00:03 converted datafile=+DATA/RHNDB/DATAFILE/sysaux.260.1006801653 channel ORA_DISK_2: datafile conversion complete, elapsed time: 00:00:25 converted datafile=+DATA/RHNDB/DATAFILE/spacewalk.259.1006801653 channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:01:35 Finished conversion at target at 28-APR-2019 19:09:08 RMAN> exit
8、建立目標端的控制檔案
在源端使用下面的命令建立目標端的控制檔案:
SQL> alter database backup controlfile to trace resetlogs;
生成的trace檔案路徑可以透過alter日誌進行檢視,然後根據實際情況進行修改。修改完後在目標端執行,如下:
[oracle@db02 ~]$ sqlplus "/as sysdba" SQL*Plus: Release 19.0.0.0.0 - Production on Sun Apr 28 19:14:24 2019 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> CREATE CONTROLFILE REUSE DATABASE "RHNDB" RESETLOGS NOARCHIVELOG 2 MAXLOGFILES 16 3 MAXLOGMEMBERS 3 4 MAXDATAFILES 100 5 MAXINSTANCES 8 6 MAXLOGHISTORY 2920 7 LOGFILE 8 GROUP 1 '+DATA/rhndb/redo01.log' SIZE 50M BLOCKSIZE 512, 9 GROUP 2 '+DATA/rhndb/redo02.log' SIZE 50M BLOCKSIZE 512, 10 GROUP 3 '+DATA/rhndb/redo03.log' SIZE 50M BLOCKSIZE 512 11 -- STANDBY LOGFILE 12 DATAFILE 13 '+DATA/RHNDB/DATAFILE/system.258.1006801423', 14 '+DATA/RHNDB/DATAFILE/undotbs1.257.1006801423', 15 '+DATA/RHNDB/DATAFILE/users.261.1006801653', 16 '+DATA/RHNDB/DATAFILE/sysaux.260.1006801653', 17 '+DATA/RHNDB/DATAFILE/spacewalk.259.1006801653' 18 CHARACTER SET AL32UTF8; Control file created.
另外複製源庫的密碼檔案至目標庫的指定目錄:
[oracle@rhndb dbs]$ scp orapwrhndb db02:/u01/app/oracle/product/19.0.0/db_1/dbs/
9、以 resetlogs upgrade 方式開啟資料庫並建立臨時表空間
SQL> startup mount ORACLE instance started. Total System Global Area 3221222464 bytes Fixed Size 8901696 bytes Variable Size 671088640 bytes Database Buffers 2533359616 bytes Redo Buffers 7872512 bytes Database mounted. SQL> alter database open resetlogs upgrade; Database altered. SQL> alter tablespace temp add tempfile '+data' size 50M autoextend on next 100m maxsize unlimited; Tablespace altered.
10、建立SPFILE
SQL> create spfile='+data' from pfile; --新建的spfile名稱可以在asm磁碟組中檢視 [oracle@rhndb dbs]$ mv initrhndb.ora initrhndb.ora.old [oracle@db02 dbs]$ echo 'SPFILE='+data/rhndb/parameterfile/spfile.267.1006905749''>initrhndb.ora
11、執行upgrade
使用dbupgrade進行升級操作:
[oracle@db02 ~]$ dbupgrade -u sys
在升級過程中,會遇到下面的錯誤:
ORA-02290: check constraint (SYS.JAVA_DEV_DISABLED) violated
dbupgrade會話結束後,使用下面的命令啟用:
SQL> exec dbms_java_dev.enable;
此命令執行完後,會重啟資料庫至migrate模式,然後執行下面的命令即可完成升級。
SQL> @?/rdbms/admin/utlirp.sql SQL> shutdown immediate SQL> startup SQL> @?/rdbms/admin/utlrp.sql
如果還有java相關的invalid物件,請參考官方的metalink(文件 ID 2262919.1)。
使用下面的命令檢查元件資訊:
SQL> col comp_name for a40 SQL> set wrap off SQL> set pagesize 999 SQL> select comp_name,version, status from dba_registry;
12、註冊資料庫資源(可選)
[oracle@db02 ~]$ srvctl add database -db rhndb -oraclehome /u01/app/oracle/product/19.0.0/db_1 -spfile '+data/rhndb/parameterfile/spfile.267.1006814727' -pwfile /u01/app/oracle/product/19.0.0/db_1/dbs/orapwrhndb -role primary -dbname rhndb -diskgroup 'data,fra' [oracle@db02 ~]$ srvctl config database -db rhndb Database unique name: rhndb Database name: rhndb Oracle home: /u01/app/oracle/product/19.0.0/db_1 Oracle user: oracle Spfile: +data/rhndb/parameterfile/spfile.267.1006814727 Password file: /u01/app/oracle/product/19.0.0/db_1/dbs/orapwrhndb Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Disk Groups: DATA,FRA Services: OSDBA group: OSOPER group: Database instance: rhndb
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31490526/viewspace-2662935/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- upgrade 10.2.0.5 to 11.2.0.4 on linuxLinux
- ORACLE rac 11.2.0.4 for rhel7.8 upgrade to 19.11.1 報錯ORA-29516處理Oracle
- helm upgrade
- 2.3.3.3 Application UpgradeAPP
- PostgreSQL DBA(91) - PG upgradeSQL
- 2.3.3.3.1 How an Application Upgrade WorksAPP
- Cisco ACI APIC upgrade downgrade pathAPI
- apt的update和upgrade區別APT
- windows10 upgrade可以刪除嗎_win10系統如何刪除upgrade資料夾WindowsWin10
- centos7-kernel-upgrade-核心升級CentOS
- MYSQL 8.0 Upgrade &Downgrade的幾點注意MySql
- linux下使用yum upgrade軟體包Linux
- CentOS 7.6 安裝11.2.0.4 RACCentOS
- Oracle 10.2.0.5升級至11.2.0.4Oracle
- ORACLE 11.2.0.4 DG(Broker) for linux 部署OracleLinux
- oracle之 11.2.0.4 bbed安裝Oracle
- win10 upgrade檔案能刪除嗎 win10系統怎麼刪除upgrade檔案Win10
- RAC安裝【AIX 7 + 11.2.0.4 + ASM】AIASM
- oracle rac 11.2.0.3 升級到11.2.0.4Oracle
- linux 中 yum makecache 、yum update、yum upgrade的作用Linux
- Poor Performance On Certain Dictionary Queries After Upgrade To 10gORMAI
- AnolisOS 7.9 靜默安裝Oacle 11.2.0.4
- Solaris下Oracle RAC 11.2.0.4 安裝方法Oracle
- Oracle 11.2.0.4 Dataguard兩則故障處理Oracle
- 使用 nuxi upgrade 升級現有nuxt專案版本UX
- Oracle案例04——ORA-39700: database must be opened with UPGRADE optionOracleDatabase
- 11.2.0.4 Dataguard臨時讀寫三種方法
- DG:11.2.0.4 RAC線上duplicate恢復DG
- oracle資料庫11.2.0.3升級到11.2.0.4Oracle資料庫
- Oracle 11.2.0.4 physical dataguard和snapshot dataguard切換Oracle
- Oracle:Oracle RAC 11.2.0.4 升級為 19cOracle
- oracle 11.2.0.4 rac叢集等待事件enq: TM - contentionOracle事件ENQ
- redhat7.2靜默安裝Oracle11.2.0.4RedhatOracle
- Windows 11.2.0.4 RAC安裝配置以及RAC新增節點Windows
- Oracle資料庫 11.2.0.4 EMON程式持續消耗CPUOracle資料庫
- Oracle 11.2.0.4 awr過期快照無法自動清理Oracle
- 【UPGRADE】升級到Oracle18c基本步驟參考(留存)Oracle
- Oracle 18c - 配置只讀 OracleHome / DBCA / Patching / Upgrade (文件 ID 2469646.1)Oracle