【博客文章2025】Oracle Database 23ai(23.5.0.24.07)RAC集群(数据库部分)
1. 起始环境:
2. 操作系统---准备安装目录(本操作,不需在其他节点进行):
[oracle@station11 ~]$ mkdir -p /u01/app/oracle/product/23.5.0/dbhome_1 |
在第集群第1个节点的/u01/app/oracle/product/23.5.0/dbhome_1下,以oracle用户解压缩23ai DATABASE软件:
[oracle@station11 dbhome_1]$ unzip /stage/DATABASE/V1043785-01.zip |
3. 安装23ai数据库软件:
4. 19c RAC数据库一定要成为插件数据库才能升级成23ai:
4.1 将scp改动成如下这样(所有节点都要操作一遍!): 在RHEL8系列,dbca建19c库,为避免oracle用户ssh报错:
[root@station11 ~]# cd /usr/bin[root@station11 bin]# mv scp scp.ori[root@station11 bin]# cat scp /usr/bin/scp.ori -T $* [root@station11 bin]#chmod +x scp
|
4.2 为了防止dbca报错,解锁/etc/oratab:
[root@station11 ~]# chattr -i /etc/oratab |
[root@station12 ~]# chattr -i /etc/oratab
|
4.3 dbca,创建19c根容器cdb1:
5. /etc/oratab:
[root@station11 ~]# cat /etc/oratab #Backup file is /u01/app/grid/crsdata/station11/output/oratab.bak.station11.grid line added by Agent #
# This file is used by ORACLE utilities. It is created by root.sh # and updated by either Database Configuration Assistant while creating # a database or ASM Configuration Assistant while creating ASM instance.
# A colon, ':', is used as the field terminator. A new line terminates # the entry. Lines beginning with a pound sign, '#', are comments. # # Entries are of the form: # $ORACLE_SID:$ORACLE_HOME:: # # The first and second fields are the system identifier and home # directory of the database respectively. The third field indicates # to the dbstart utility that the database should , "Y", or should not, # "N", be brought up at system boot time. # # Multiple entries with the same $ORACLE_SID are not allowed. # # +ASM1:/u01/app/23.5.0/grid:N racorcl1:/u01/app/oracle/product/19.3.0/dbhome_1:N cdb11:/u01/app/oracle/product/19.3.0/dbhome_1:N |
暂时锁住/etc/oratab:
[root@station11 ~]# chattr +i /etc/oratab
|
[root@station12 ~]# cat /etc/oratab #Backup file is /u01/app/grid/crsdata/station11/output/oratab.bak.station11.grid line added by Agent #
# This file is used by ORACLE utilities. It is created by root.sh # and updated by either Database Configuration Assistant while creating # a database or ASM Configuration Assistant while creating ASM instance.
# A colon, ':', is used as the field terminator. A new line terminates # the entry. Lines beginning with a pound sign, '#', are comments. # # Entries are of the form: # $ORACLE_SID:$ORACLE_HOME:: # # The first and second fields are the system identifier and home # directory of the database respectively. The third field indicates # to the dbstart utility that the database should , "Y", or should not, # "N", be brought up at system boot time. # # Multiple entries with the same $ORACLE_SID are not allowed. # # +ASM2:/u01/app/23.5.0/grid:N racorcl2:/u01/app/oracle/product/19.3.0/dbhome_1:N cdb12:/u01/app/oracle/product/19.3.0/dbhome_1:N |
暂时锁住/etc/oratab:
[root@station12 ~]# chattr +i /etc/oratab
|
6. DATABASE---DB实例增加"_exadata_feature_on"参数:
[oracle@station11 ~]$ . oraenv ORACLE_SID = [racorcl1] ? cdb11 The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 8 17:22:52 2025 Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> conn / as sysdba Connected. SQL> alter system set "_exadata_feature_on"=true scope=spfile;
System altered.
SQL> exit Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0
|
7. DATABASE---反注册所有19c RAC数据库(racorcl和cdb1):
racorcl的注册信息:
[oracle@station11 ~]$ . oraenv ORACLE_SID = [racorcl1] ? The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ srvctl config database -d racorcl Database unique name: racorcl Database name: racorcl Oracle home: /u01/app/oracle/product/19.3.0/dbhome_1 Oracle user: oracle Spfile: +data/RACORCL/PARAMETERFILE/spfile.292.1162980609 Password file: +data/RACORCL/PASSWORD/pwdracorcl.291.1162980283 Domain: example.com Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: Disk Groups: FRA,DATA Mount point paths: Services: Type: RAC Start concurrency: Stop concurrency: OSDBA group: dba OSOPER group: oper Database instances: racorcl1,racorcl2 Configured nodes: station11,station12 CSS critical: no CPU count: 0 Memory target: 0 Maximum memory: 0 Default network number for database services: Database is administrator managed
|
racorcl暂时改成非集群库:
[oracle@station11 ~]$ . oraenv ORACLE_SID = [racorcl1] ? The Oracle base remains unchanged with value /u01/app/oracle[oracle@station11 ~]$ sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 8 17:34:27 2025 Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> conn / as sysdba Connected. SQL> alter system set cluster_database=false scope=spfile;
System altered.
|
反注册racorcl:
[oracle@station11 ~]$ . oraenv ORACLE_SID = [racorcl1] ? The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ srvctl stop database -d racorcl [oracle@station11 ~]$ srvctl remove instance -i racorcl1 -d racorcl Remove instance from the database racorcl? (y/[n]) y [oracle@station11 ~]$ srvctl remove instance -i racorcl2 -d racorcl Remove instance from the database racorcl? (y/[n]) y [oracle@station11 ~]$ srvctl remove database -d racorcl Remove the database racorcl? (y/[n]) y [oracle@station11 ~]$ vim /u01/app/oracle/product/23.5.0/dbhome_1/dbs/initracorcl1.ora [oracle@station11 ~]$ cat /u01/app/oracle/product/23.5.0/dbhome_1/dbs/initracorcl1.ora spfile=+data/RACORCL/PARAMETERFILE/spfile.292.1162980609 [oracle@station11 ~]$ cp /u01/app/oracle/product/23.5.0/dbhome_1/dbs/initracorcl1.ora /u01/app/oracle/product/19.3.0/dbhome_1/dbs/initracorcl1.ora
|
cdb1的注册信息:
[oracle@station11 ~]$ . oraenv ORACLE_SID = [cdb1] ? cdb11 The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ srvctl config database -d cdb1 Database unique name: cdb1 Database name: cdb1 Oracle home: /u01/app/oracle/product/19.3.0/dbhome_1 Oracle user: oracle Spfile: +DATA/CDB1/PARAMETERFILE/spfile.278.1195232311 Password file: +DATA/CDB1/PASSWORD/pwdcdb1.260.1195231639 Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: Disk Groups: FRA,DATA Mount point paths: Services: Type: RAC Start concurrency: Stop concurrency: OSDBA group: dba OSOPER group: oper Database instances: cdb11,cdb12 Configured nodes: station11,station12 CSS critical: no CPU count: 0 Memory target: 0 Maximum memory: 0 Default network number for database services: Database is administrator managed
|
cdb1暂时改成非集群库:
[oracle@station11 ~]$ . oraenv ORACLE_SID = [cdb1] ? cdb11 The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 8 17:46:44 2025 Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> conn / as sysdba Connected. SQL> alter system set cluster_database=false scope=spfile;
System altered.
|
反注册cdb1:
[oracle@station11 ~]$ . oraenv ORACLE_SID = [cdb11] ? The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ srvctl stop database -d cdb1 [oracle@station11 ~]$ srvctl remove instance -i cdb11 -d cdb1 Remove instance from the database cdb1? (y/[n]) y [oracle@station11 ~]$ srvctl remove instance -i cdb12 -d cdb1 Remove instance from the database cdb1? (y/[n]) y [oracle@station11 ~]$ srvctl remove database -d cdb1 Remove the database cdb1? (y/[n]) y [oracle@station11 ~]$ vim /u01/app/oracle/product/23.5.0/dbhome_1/dbs/initcdb11.ora [oracle@station11 ~]$ cat /u01/app/oracle/product/23.5.0/dbhome_1/dbs/initcdb11.ora spfile=+DATA/CDB1/PARAMETERFILE/spfile.278.1195232311 [oracle@station11 ~]$ cp /u01/app/oracle/product/23.5.0/dbhome_1/dbs/initcdb11.ora /u01/app/oracle/product/19.3.0/dbhome_1/dbs/initcdb11.ora
|
8. DATABASE---将racorcl插入cdb1:
8.1 以只读方式打开racorcl数据库:
[oracle@station11 ~]$ . oraenv ORACLE_SID = [racorcl1] ? The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 8 17:57:50 2025 Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> conn / as sysdba Connected to an idle instance. SQL> startup mount ORACLE instance started.
Total System Global Area 4949276568 bytes Fixed Size 8906648 bytes Variable Size 973078528 bytes Database Buffers 3959422976 bytes Redo Buffers 7868416 bytes Database mounted. SQL> alter database open read only;
Database altered.
SQL> exec dbms_pdb.describe('/home/oracle/racorcl.xml');
PL/SQL procedure successfully completed.
|
8.2 打开cdb1数据库:
[oracle@station11 ~]$ . oraenv ORACLE_SID = [cdb1] ? cdb11 The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 8 18:02:15 2025 Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> conn / as sysdba Connected to an idle instance. SQL> startup ORACLE instance started.
Total System Global Area 4949277936 bytes Fixed Size 9145584 bytes Variable Size 1006632960 bytes Database Buffers 3925868544 bytes Redo Buffers 7630848 bytes Database mounted. Database opened. SQL> set linesize 1000 SQL> select con_id, name, open_mode, restricted from v$pdbs;
CON_ID NAME OPEN_MODE RES ---------- -------------------------------------------------------------------------------------------------------------------------------- ---------- --- 2 PDB$SEED READ ONLY NO
|
8.3 将racorcl插入cdb1:
SQL> create pluggable database pdb1_1 using '/home/oracle/racorcl.xml' nocopy;
Pluggable database created.
|
执行noncdb_to_pdb.sql:
SQL> alter session set container=pdb1_1;
Session altered.
SQL> show con_name
CON_NAME ------------------------------ PDB1_1 SQL> select con_id, name, open_mode, restricted from v$pdbs;
CON_ID NAME OPEN_MODE RES ---------- -------------------------------------------------------------------------------------------------------------------------------- ---------- --- 3 PDB1_1 MOUNTED
SQL> @/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/noncdb_to_pdb.sql SQL> SET FEEDBACK 1 SQL> SET NUMWIDTH 10 SQL> SET LINESIZE 80 SQL> SET TRIMSPOOL ON SQL> SET TAB OFF SQL> SET PAGESIZE 100 SQL> SET VERIFY OFF SQL> SQL> -- save settings SQL> STORE SET ncdb2pdb.settings.sql REPLACE Wrote file ncdb2pdb.settings.sql SQL> SQL> SET TIME ON 18:07:48 SQL> SET TIMING ON 18:07:48 SQL> 18:07:48 SQL> WHENEVER SQLERROR EXIT; 18:07:48 SQL> 18:07:48 SQL> DOC 18:07:48 DOC>####################################################################### 18:07:48 DOC>####################################################################### 18:07:48 DOC> The following statement will cause an "ORA-01403: no data found" 18:07:48 DOC> error if we're not in a PDB. 18:07:48 DOC> This script is intended to be run right after plugin of a PDB, 18:07:48 DOC> while inside the PDB. 18:07:48 DOC>####################################################################### 18:07:48 DOC>####################################################################### 18:07:48 DOC># 18:07:48 SQL> ...... 18:12:44 SQL> set recsep WRAP 18:12:44 SQL> set recsepchar " " 18:12:44 SQL> set rowlimit OFF 18:12:44 SQL> set rowprefetch 1 18:12:44 SQL> set securedcol OFF 18:12:44 SQL> set serveroutput OFF 18:12:44 SQL> set shiftinout invisible 18:12:44 SQL> set showmode OFF 18:12:44 SQL> set sqlblanklines OFF 18:12:44 SQL> set sqlcase MIXED 18:12:44 SQL> set sqlcontinue "> " 18:12:44 SQL> set sqlnumber ON 18:12:44 SQL> set sqlpluscompatibility 19.0.0 18:12:44 SQL> set sqlprefix "#" 18:12:44 SQL> set sqlprompt "SQL> " 18:12:44 SQL> set sqlterminator ";" 18:12:44 SQL> set statementcache 0 18:12:44 SQL> set suffix "sql" 18:12:44 SQL> set tab OFF 18:12:44 SQL> set termout ON 18:12:44 SQL> set time OFF SQL> set timing OFF SQL> set trimout ON SQL> set trimspool ON SQL> set underline "-" SQL> set verify OFF SQL> set wrap ON SQL> set xmloptimizationcheck OFF
|
查看插入结果:
[oracle@station11 ~]$ . oraenv ORACLE_SID = [cdb11] ? The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 8 18:15:22 2025 Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> conn / as sysdba Connected. SQL> set linesize 1000 SQL> select con_id, name, open_mode, restricted from v$pdbs;
CON_ID NAME OPEN_MODE RES ---------- -------------------------------------------------------------------------------------------------------------------------------- ---------- --- 2 PDB$SEED READ ONLY NO 3 PDB1_1 MOUNTED
SQL> alter pluggable database pdb1_1 open;
Pluggable database altered.
SQL> select con_id, name, open_mode, restricted from v$pdbs;
CON_ID NAME OPEN_MODE RES ---------- -------------------------------------------------------------------------------------------------------------------------------- ---------- --- 2 PDB$SEED READ ONLY NO 3 PDB1_1 READ WRITE NO
|
8.4 关闭racorcl和cdb1:
[oracle@station11 ~]$ . oraenv ORACLE_SID = [cdb11] ? racorcl1 The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 8 18:17:58 2025 Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> conn / as sysdba Connected. SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> exit Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 [oracle@station11 ~]$ . oraenv ORACLE_SID = [racorcl1] ? cdb11 The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 8 18:19:54 2025 Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> conn / as sysdba Connected. SQL> set linesize 1000 SQL> select con_id, name, open_mode, restricted from v$pdbs;
CON_ID NAME OPEN_MODE RES ---------- -------------------------------------------------------------------------------------------------------------------------------- ---------- --- 2 PDB$SEED READ ONLY NO 3 PDB1_1 READ WRITE NO
SQL> alter pluggable database all close immediate;
Pluggable database altered.
SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down.
|
9. DATABASE--用23ai升级cdb1:
9.1 为了使用23ai版本启动升级过程,修改/etc/oratab:
[root@station11 ~]# chattr -i /etc/oratab [root@station11 ~]# vim /etc/oratab [root@station11 ~]# cat /etc/oratab #Backup file is /u01/app/grid/crsdata/station11/output/oratab.bak.station11.oracle line added by Agent #
# This file is used by ORACLE utilities. It is created by root.sh # and updated by either Database Configuration Assistant while creating # a database or ASM Configuration Assistant while creating ASM instance.
# A colon, ':', is used as the field terminator. A new line terminates # the entry. Lines beginning with a pound sign, '#', are comments. # # Entries are of the form: # $ORACLE_SID:$ORACLE_HOME:: # # The first and second fields are the system identifier and home # directory of the database respectively. The third field indicates # to the dbstart utility that the database should , "Y", or should not, # "N", be brought up at system boot time. # # Multiple entries with the same $ORACLE_SID are not allowed. # # +ASM1:/u01/app/23.5.0/grid:N cdb11:/u01/app/oracle/product/23.5.0/dbhome_1:N [root@station11 ~]# chattr +i /etc/oratab |
9.2 upgrade启动(一定要保证插件数据库open upgrade): [oracle@station11 ~]$ . oraenv ORACLE_SID = [racorcl1] ? cdb11 The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ sqlplus /nolog
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sat Mar 8 18:34:48 2025 Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
SQL> conn / as sysdba Connected to an idle instance. SQL> startup upgrade ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance ORACLE instance started.
Total System Global Area 4946727568 bytes Fixed Size 5370512 bytes Variable Size 956301312 bytes Database Buffers 3976200192 bytes Redo Buffers 8855552 bytes Database mounted. Database opened. SQL> alter pluggable database all open upgrade;
Pluggable database altered.
SQL> set linesize 1000 SQL> select con_id, name, open_mode, restricted from v$pdbs;
CON_ID NAME OPEN_MODE RES ----------
--------------------------------------------------------------------------------------------------------------------------------
---------- --- 2 PDB$SEED MIGRATE YES 3 PDB1_1
|
9.3 执行dbupgrade:
[oracle@station11 ~]$ . oraenv ORACLE_SID = [cdb11] ? The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ dbupgrade -n 8 Manual
upgrade using dbupgrade is desupported as of Oracle Database 23.4.
Oracle recommends using AutoUpgrade to upgrade your database. Refer to
My Oracle Support Note 2485457.1 for details on AutoUpgrade.
Argument list for [/u01/app/oracle/product/23.5.0/dbhome_1/rdbms/admin/catctl.pl] For Oracle internal use only A = 0 Run in c = 0 Do not run in C = 0 Input Directory d = 0 Echo OFF e = 1 Simulate E = 0 Forced cleanup F = 0 Log Id i = 0 Child Process I = 0 Log Dir l = 0 Priority List Name L = 0 Upgrade Mode active M = 0 SQL Process Count n = 8 SQL PDB Process Count N = 0 Open Mode Normal o = 0 Start Phase p = 0 End Phase P = 0 Reverse Order r = 0 AutoUpgrade Resume R = 0 Script s = 0 Serial Run S = 0 Classic Upgrade t = 0 RO User Tablespaces T = 0 Zip Logs w = 0 Upgrade PDBs in Upgrade mode x = 0 Display Phases y = 0 Debug catcon.pm z = 0 Debug catctl.pl Z = 0 Manual
upgrade using catctl.pl is desupported as of Oracle Database 23.4.
Oracle recommends using AutoUpgrade to upgrade your database.
catctl.pl VERSION: [23.0.0.0.0] STATUS: [Lim] BUILD: [RDBMS_23.5.0.24.07DBRU_LINUX.X64_240710]
/u01/app/oracle/product/23.5.0/dbhome_1/rdbms/admin/orahome = [/u01/app/oracle/product/23.5.0/dbhome_1] /u01/app/oracle/product/23.5.0/dbhome_1/bin/orabasehome = [/u01/app/oracle/product/23.5.0/dbhome_1] catctlGetOraBaseLogDir = [/u01/app/oracle/product/23.5.0/dbhome_1]
Analyzing file /u01/app/oracle/product/23.5.0/dbhome_1/rdbms/admin/catupgrd.sql
Log file directory = [/u01/app/oracle/product/23.5.0/dbhome_1/cfgtoollogs/upgrade20250308183821]
catcon::set_log_file_base_path:
ALL catcon-related output will be written to
[/u01/app/oracle/product/23.5.0/dbhome_1/cfgtoollogs/upgrade20250308183821/catupgrd_catcon_186331.lst]
catcon::set_log_file_base_path:
catcon: See
[/u01/app/oracle/product/23.5.0/dbhome_1/cfgtoollogs/upgrade20250308183821/catupgrd*.log]
files for output generated by scripts
catcon::set_log_file_base_path:
catcon: See
[/u01/app/oracle/product/23.5.0/dbhome_1/cfgtoollogs/upgrade20250308183821/catupgrd_*.lst]
files for spool files, if any
Number of Cpus = 8 Database Name = cdb1 DataBase Version = 19.0.0.0.0 catcon::set_log_file_base_path:
ALL catcon-related output will be written to
[/u01/app/oracle/product/23.5.0/dbhome_1/cfgtoollogs/cdb1/upgrade20250308183822/catupgrdcdbroot_catcon_186331.lst]
catcon::set_log_file_base_path:
catcon: See
[/u01/app/oracle/product/23.5.0/dbhome_1/cfgtoollogs/cdb1/upgrade20250308183822/catupgrdcdbroot*.log]
files for output generated by scripts
catcon::set_log_file_base_path:
catcon: See
[/u01/app/oracle/product/23.5.0/dbhome_1/cfgtoollogs/cdb1/upgrade20250308183822/catupgrdcdbroot_*.lst]
files for spool files, if any
Log file directory = [/u01/app/oracle/product/23.5.0/dbhome_1/cfgtoollogs/cdb1/upgrade20250308183822]
Parallel SQL Process Count (PDB) = 2 Parallel SQL Process Count (CDB$ROOT) = 8 Generated PDB Inclusion:[PDB$SEED PDB1_1] Components in [CDB$ROOT] Installed [APS CATALOG CATJAVA CATPROC CONTEXT DV JAVAVM OLS ORDIM OWM RAC SDO XDB XML XOQ] Not Installed [APEX EM LCTR MGW ODM WK] DataBase Version = 19.0.0.0.0
------------------------------------------------------ Phases [0-106] Start Time:[2025_03_08 18:38:23] Container Lists Inclusion:[CDB$ROOT] Exclusion:[NONE] ------------------------------------------------------ *********** Executing Change Scripts *********** Serial Phase #:0 [CDB$ROOT] Files:1 ...... ***************** Upgrading SDO **************** Serial Phase #:77 [PDB$SEED] Files:1 Time: 29s Serial Phase #:78 [PDB$SEED] Files:2 Time: 0s Serial Phase #:80 [PDB$SEED] Files:1 Time: 4s Parallel Phase #:82 [PDB$SEED] Files:3 Time: 15s Serial Phase #:84 [PDB$SEED] Files:1 Time: 4s Serial Phase #:86 [PDB$SEED] Files:1 Time: 5s Parallel Phase #:88 [PDB$SEED] Files:4 Time: 43s Serial Phase #:90 [PDB$SEED] Files:1 Time: 0s Serial Phase #:92 [PDB$SEED] Files:2 Time: 24s **** Upgrading ODM, WK, EXF, RUL, XOQ, LCTR **** Serial Phase #:94 [PDB$SEED] Files:1 Time: 0s *********** Final Component scripts *********** Serial Phase #:96 [PDB$SEED] Files:1 Time: 1s ************* Final Upgrade scripts ************ Serial Phase #:97 [PDB$SEED] Files:1 Time: 1s ******************* Migration ****************** Serial Phase #:98 [PDB$SEED] Files:1 Time: 2s *** End PDB Application Upgrade Pre-Shutdown *** Serial Phase #:99 [PDB$SEED] Files:1 Time: 0s ****** Bounce the database post-migration ****** ***************** Post Upgrade ***************** **************** Summary report **************** Serial Phase #:103 [PDB$SEED] Files:1 Time: 1s *** End PDB Application Upgrade Post-Shutdown ** Serial Phase #:104 [PDB$SEED] Files:2 Time: 0s
Grand Total Time: 1294s [PDB1_1]
LOG FILES: (/u01/app/oracle/product/23.5.0/dbhome_1/cfgtoollogs/cdb1/upgrade20250308183822/catupgrdpdb1_1*.log)
Upgrade Summary Report Located in: /u01/app/oracle/product/23.5.0/dbhome_1/cfgtoollogs/cdb1/upgrade20250308183822/upg_summary.log CDB$ROOT Open Mode = [OPEN]
Grand Total Time: 1785s [PDB$SEED]
LOG FILES: (/u01/app/oracle/product/23.5.0/dbhome_1/cfgtoollogs/cdb1/upgrade20250308183822/catupgrdpdb_seed*.log)
Upgrade Summary Report Located in: /u01/app/oracle/product/23.5.0/dbhome_1/cfgtoollogs/cdb1/upgrade20250308183822/upg_summary.log
Time: 1592s For CDB$ROOT Time: 1843s For PDB(s)
Grand Total Time: 3435s
LOG FILES: (/u01/app/oracle/product/23.5.0/dbhome_1/cfgtoollogs/cdb1/upgrade20250308183822/catupgrdcdbroot*.log)
Upgrade Summary Report Located in: /u01/app/oracle/product/23.5.0/dbhome_1/cfgtoollogs/cdb1/upgrade20250308183822/upg_summary.log
Grand Total Upgrade Time: [0d:0h:57m:15s] |
[oracle@station11 ~]$ . oraenv ORACLE_SID = [cdb11] ? The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ echo $ORACLE_HOME /u01/app/oracle/product/23.5.0/dbhome_1 [oracle@station11 ~]$ sqlplus /nolog
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sun Mar 9 06:18:07 2025 Version 23.5.0.24.07---------------------------------------------------------------------------------------------------------------------------------
Copyright (c) 1982, 2024, Oracle. All rights reserved.
SQL> conn / as sysdba Connected. SQL> @?/rdbms/admin/utlrp.sql
Session altered.
TIMESTAMP -------------------------------------------------------------------------------- COMP_TIMESTAMP UTLRP_BGN 2025-03-09 06:18:35
DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid DOC> objects in the database. Recompilation time is proportional to the DOC> number of invalid objects in the database, so this command may take DOC> a long time to execute on a database with a large number of invalid DOC> objects. DOC> DOC> Use the following queries to track recompilation progress: DOC> DOC> 1. Query returning the number of invalid objects remaining. This DOC> number should decrease with time. DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6); DOC> DOC> 2. Query returning the number of objects compiled so far. This number DOC> should increase with time. DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED; DOC> DOC> This script automatically chooses serial or parallel recompilation DOC> based on the number of CPUs available (parameter cpu_count) multiplied DOC> by the number of threads per CPU (parameter parallel_threads_per_cpu). DOC> On RAC, this number is added across all RAC nodes. DOC> DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel DOC> recompilation. Jobs are created without instance affinity so that they DOC> can migrate across RAC nodes. Use the following queries to verify DOC> whether UTL_RECOMP jobs are being created and run correctly: DOC> DOC> 1. Query showing jobs created by UTL_RECOMP DOC> SELECT job_name FROM dba_scheduler_jobs DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%'; DOC> DOC> 2. Query showing UTL_RECOMP jobs that are running DOC> SELECT job_name FROM dba_scheduler_running_jobs DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%'; DOC>#
PL/SQL procedure successfully completed.
TIMESTAMP -------------------------------------------------------------------------------- COMP_TIMESTAMP UTLRP_END 2025-03-09 06:18:40
DOC> The following query reports the number of invalid objects. DOC> DOC> If the number is higher than expected, please examine the error DOC> messages reported with each object (using SHOW ERRORS) to see if they DOC> point to system misconfiguration or resource constraints that must be DOC> fixed before attempting to recompile these objects. DOC>#
OBJECTS WITH ERRORS ------------------- 0
DOC> The following query reports the number of exceptions caught during DOC> recompilation. If this number is non-zero, please query the error DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors DOC> are due to misconfiguration or resource constraints that must be DOC> fixed before objects can compile successfully. DOC> Note: Typical compilation errors (due to coding errors) are not DOC> logged into this table: they go into DBA_ERRORS instead. DOC>#
ERRORS DURING RECOMPILATION --------------------------- 0
Function created.
PL/SQL procedure successfully completed.
Function dropped.
PL/SQL procedure successfully completed.
SQL>
SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. |
9.5 cdb1改成集群库:[oracle@station11 ~]$ . oraenv ORACLE_SID = [cdb11] ? The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ sqlplus /nolog
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sun Mar 9 07:03:25 2025 Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
SQL> conn / as sysdba Connected to an idle instance. SQL> startup nomount ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance ORACLE instance started.
Total System Global Area 4946727568 bytes Fixed Size 5370512 bytes Variable Size 1140850688 bytes Database Buffers 3791650816 bytes Redo Buffers 8855552 bytes SQL> show parameter spfile
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string +DATA/CDB1/PARAMETERFILE/spfil e.278.1195232311 SQL> alter system set cluster_database=true scope=spfile;
System altered.
SQL> shutdown immediate ORA-01507: database not mounted Help: https://docs.oracle.com/error-help/db/ora-01507/
ORACLE instance shut down.
|
9.6 注册cdb1集群库:
[oracle@station11 ~]$ . oraenv ORACLE_SID = [cdb11] ? The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ srvctl add database -d cdb1 -o /u01/app/oracle/product/23.5.0/dbhome_1 -spfile +DATA/CDB1/PARAMETERFILE/spfile.278.1195232311 -dbtype RAC -pwfile +DATA/CDB1/PASSWORD/pwdcdb1.260.1195231639 [oracle@station11 ~]$ srvctl add instance -d cdb1 -i cdb11 -n station11 [oracle@station11 ~]$ srvctl add instance -d cdb1 -i cdb12 -n station12 [oracle@station11 ~]$ srvctl start database -d cdb1 [oracle@station11 ~]$ srvctl status database -d cdb1 -v Instance cdb11 is running on node station11. Instance status: Open,HOME=/u01/app/oracle/product/23.5.0/dbhome_1. Instance cdb12 is running on node station12. Instance status: Open,HOME=/u01/app/oracle/product/23.5.0/dbhome_1.
|
9.7 注册pdb1_1插件集群库:
[oracle@station11 ~]$ . oraenv ORACLE_SID = [racorcl1] ? cdb11 The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 ~]$ sqlplus /nolog
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sun Mar 9 07:22:43 2025 Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
SQL> conn / as sysdba Connected. SQL> alter pluggable database all open instances=all;
Pluggable database altered.
SQL> set linesize 1000 SQL> select con_id, name, open_mode, restricted from v$pdbs;
CON_ID NAME OPEN_MODE RES ---------- -------------------------------------------------------------------------------------------------------------------------------- ---------- --- 2 PDB$SEED READ ONLY NO 3 PDB1_1 READ WRITE NO |
10. RAC 23ai成品:
10.1 集群资源列表:
[grid@station11 ~]$ . oraenv ORACLE_SID = [+ASM1] ? The Oracle base remains unchanged with value /u01/app/grid [grid@station11 ~]$ crsctl status res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE station11 STABLE ONLINE ONLINE station12 STABLE ora.chad ONLINE ONLINE station11 STABLE ONLINE ONLINE station12 STABLE ora.helper OFFLINE OFFLINE station11 IDLE,STABLE OFFLINE OFFLINE station12 IDLE,STABLE ora.net1.network ONLINE ONLINE station11 STABLE ONLINE ONLINE station12 STABLE ora.ons ONLINE ONLINE station11 STABLE ONLINE ONLINE station12 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup) 1 ONLINE ONLINE station11 STABLE 2 ONLINE ONLINE station12 STABLE ora.DATA.dg(ora.asmgroup) 1 ONLINE ONLINE station11 STABLE 2 ONLINE ONLINE station12 STABLE ora.FRA.dg(ora.asmgroup) 1 ONLINE ONLINE station11 STABLE 2 ONLINE ONLINE station12 STABLE ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE station11 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE station11 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE station12 STABLE ora.asm(ora.asmgroup) 1 ONLINE ONLINE station11 Started,STABLE 2 ONLINE ONLINE station12 Started,STABLE ora.asmnet1.asmnetwork(ora.asmgroup) 1 ONLINE ONLINE station11 STABLE 2 ONLINE ONLINE station12 STABLE ora.cdb1.db 1 ONLINE ONLINE station11 Open,HOME=/u01/app/o racle/product/23.5.0 /dbhome_1,STABLE 2 ONLINE ONLINE station12 Open,HOME=/u01/app/o racle/product/23.5.0 /dbhome_1,STABLE ora.cdb1.pdb1_1.pdb 1 ONLINE ONLINE station11 READ WRITE,STABLE 2 ONLINE ONLINE station12 READ WRITE,STABLE ora.cdp1.cdp 1 ONLINE ONLINE station11 STABLE ora.cdp2.cdp 1 ONLINE ONLINE station11 STABLE ora.cdp3.cdp 1 ONLINE ONLINE station12 STABLE ora.cvu 1 ONLINE ONLINE station11 STABLE ora.rhpserver 1 OFFLINE OFFLINE STABLE ora.scan1.vip 1 ONLINE ONLINE station11 STABLE ora.scan2.vip 1 ONLINE ONLINE station11 STABLE ora.scan3.vip 1 ONLINE ONLINE station12 STABLE ora.station11.vip 1 ONLINE ONLINE station11 STABLE ora.station12.vip 1 ONLINE ONLINE station12 STABLE -------------------------------------------------------------------------------- |
10.2 TNS条目:
[oracle@station11 admin]$ pwd /u01/app/oracle/product/23.5.0/dbhome_1/network/admin [oracle@station11 admin]$ cat tnsnames.ora # tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.3.0/dbhome_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools.
#LABS ADD
CDB1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan11.lab.example.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = cdb1) ) )
RCAT = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.25.250.254)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = rcat.example.com) ) )
RACORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan11.lab.example.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racorcl.example.com) ) )
PDB1_1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan11.lab.example.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pdb1_1) ) )
|
10.3 验证数据库选项都是有效的:
[oracle@station11 admin]$ . oraenv ORACLE_SID = [cdb11] ? The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 admin]$ sqlplus /nolog
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sun Mar 9 07:33:35 2025 Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
SQL> conn sys/cloud_4U@cdb1 as sysdba Connected. SQL> conn sys/cloud_4U@pdb1_1 as sysdba Connected. SQL> col COMP_NAME format a30 trunc SQL> select COMP_NAME, STATUS from dba_registry;
COMP_NAME STATUS ------------------------------ ----------- Oracle Database Catalog Views VALID Oracle Database Packages and T VALID Oracle Real Application Cluste VALID JServer JAVA Virtual Machine VALID Oracle XDK VALID Oracle Database Java Packages VALID OLAP Analytic Workspace VALID Oracle XML Database VALID Oracle Workspace Manager VALID Oracle Text VALID Spatial VALID
COMP_NAME STATUS ------------------------------ ----------- Oracle OLAP API VALID Oracle Label Security VALID Oracle Database Vault VALID
14 rows selected.
SQL> select * from v$version;
BANNER BANNER_FULL BANNER_LEGACY CON_ID --------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------- ---------- Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems 0 Version 23.5.0.24.07 |
10.4 改动COMPATIBLE:
[oracle@station11 admin]$ . oraenv ORACLE_SID = [cdb11] ? The Oracle base remains unchanged with value /u01/app/oracle [oracle@station11 admin]$ sqlplus /nolog
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sun Mar 9 07:33:35 2025 Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
SQL> conn / as sysdba Connected. SQL> select model_name, algorithm, mining_function from user_mining_models; no rows selected SQL> create table t1( a vector ) ; create table t1( a vector ) * ERROR at line 1: ORA-00406: COMPATIBLE parameter needs to be 23.4.0.0.0 or greater ORA-00722: Feature "SQL VECTOR data type" Help: https://docs.oracle.com/error-help/db/ora-00406/
SQL> show parameter compat
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ compatible string 19.0.0 noncdb_compatible boolean FALSE plsql_v2_compatibility boolean FALSE SQL> alter system set compatible='23.5.0.0.0' scope=spfile;
System altered.
SQL> exit Disconnected from Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems Version 23.5.0.24.07 [oracle@station11 ~]$ srvctl stop database -d cdb1 [oracle@station11 ~]$ srvctl start database -d cdb1 [oracle@station11 ~]$ sqlplus /nolog
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sun Mar 9 08:13:56 2025 Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
SQL> conn / as sysdba Connected. SQL> create table t1( a vector ) ;
Table created.
SQL> desc t1 Name Null? Type ----------------------------------------- -------- ---------------------------- A VECTOR(*, *) |
|