创建响应文件grID.rsp,内容如下:
oracle.install.responseFiLeversion=/oracle/install/rspfmt_crsinstall_response_schema_v19.0.0INVENTORY_LOCATION=/u01/app/oraInventoryoracle.install.option=HA_CONfigORACLE_BASE=/u01/app/grIDoracle.install.asm.OSDBA=asmdbaoracle.install.asm.OSOPER=asmoperoracle.install.asm.OSASM=asmadminoracle.install.crs.config.scanType=LOCAL_SCANoracle.install.crs.config.SCANClIEntDatafile=oracle.install.crs.config.gpnp.scanname=db-cluster-scanoracle.install.crs.config.gpnp.scanPort=1521oracle.install.crs.config.ClusterConfiguration=STANDALONEoracle.install.crs.config.configureAsExtendedCluster=falseoracle.install.crs.config.memberClusterManifestfile=oracle.install.crs.config.clustername=db-clusteroracle.install.crs.config.gpnp.configureGNS=falseoracle.install.crs.config.autoConfigureClusterNodeVIP=falseoracle.install.crs.config.gpnp.gnsOption=oracle.install.crs.config.gpnp.gnsClIEntDatafile=oracle.install.crs.config.gpnp.gnsSubDomain=oracle.install.crs.config.gpnp.gnsVIPAddress=oracle.install.crs.config.sites=oracle.install.crs.config.clusterNodes=oracle.install.crs.config.networkInterfaceList=oracle.install.crs.configureGIMR=falseoracle.install.asm.configureGIMRDataDG=falseoracle.install.crs.config.storageOption=oracle.install.crs.config.sharedfileSystemStorage.votingdiskLocations=oracle.install.crs.config.sharedfileSystemStorage.ocrLocations= oracle.install.crs.config.useIPMI=falseoracle.install.crs.config.ipmi.bmcUsername=oracle.install.crs.config.ipmi.bmcPassword=oracle.install.asm.SYSASMPassword=abcABC12oracle.install.asm.diskGroup.name=DATAoracle.install.asm.diskGroup.redundancy=EXTERNALoracle.install.asm.diskGroup.AUSize=4oracle.install.asm.diskGroup.FailureGroups=oracle.install.asm.diskGroup.disksWithFailureGroupnames=/dev/sdb,oracle.install.asm.diskGroup.disks=/dev/sdboracle.install.asm.diskGroup.quorumFailureGroupnames=oracle.install.asm.diskGroup.diskdiscoveryString=/dev/sd*oracle.install.asm.monitorPassword=abcABC12oracle.install.asm.gimrDG.name=oracle.install.asm.gimrDG.redundancy=oracle.install.asm.gimrDG.AUSize=1oracle.install.asm.gimrDG.FailureGroups=oracle.install.asm.gimrDG.disksWithFailureGroupnames=oracle.install.asm.gimrDG.disks=oracle.install.asm.gimrDG.quorumFailureGroupnames=oracle.install.asm.configureAFD=trueoracle.install.crs.configureRHPS=falseoracle.install.crs.config.ignoreDownNodes=false oracle.install.config.managementoption=NONEoracle.install.config.omsHost=oracle.install.config.omsPort=0oracle.install.config.emadminUser=oracle.install.config.emadminPassword=oracle.install.crs.rootconfig.executeRootScript=trueoracle.install.crs.rootconfig.configMethod=ROOToracle.install.crs.rootconfig.sudoPath=oracle.install.crs.rootconfig.sudoUsername=oracle.install.crs.config.batchinfo=oracle.install.crs.app.applicationAddress=oracle.install.crs.deleteNode.nodes=
如果使用AFD新特性,那么在安装之前,必须更改磁盘属主为grID用户,这里使用了两块磁盘:sdb和sdc,更改属主如下:
[[email protected] ~]# chown grID:oinstall /dev/sd{b,c}
使用下面的命令进行安装配置:
[[email protected] ~]$ cd $ORACLE_HOME[[email protected] grID]$ unzip /u02/software/19c/liNUX.x64_193000_grID_home.zip[[email protected] grID]$ ./grIDSetup.sh -silent -ignorePrereq -responsefile /tmp/grID.rsp
响应文件里,默认只创建了一个data磁盘组,如果还需要创建其他的磁盘组,以FRA磁盘组为例,使用下面的命令:
[[email protected] grID]$ asmca -silent -creatediskGroup -diskGroupname FRA -diskList /dev/sdc -redundancy EXTERNAL -au_size 4 -sysAsmPassword abcABC12--更改资源ora.driver.afd的组为oinstall,默认为asmadmin。[[email protected] ~]$ crsctl modify resource ora.driver.afd -attr "ACL=‘owner:grID:rwx,pgrp:oinstall:r-x,other::r--,user:grID:r-x‘ " -init[[email protected] ~]$ crsctl stat res ora.driver.afd -p|head -41.2 安装database组件
创建响应文件db.rsp,内容如下:
oracle.install.responseFiLeversion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0oracle.install.option=INSTALL_DB_SWONLYUNIX_GROUP_name=oinstallINVENTORY_LOCATION=/u01/app/oraInventoryORACLE_BASE=/u01/app/oracleoracle.install.db.InstallEdition=EEoracle.install.db.OSDBA_GROUP=dbaoracle.install.db.OSOPER_GROUP=operoracle.install.db.OSBACKUPDBA_GROUP=dbaoracle.install.db.OSDGDBA_GROUP=dbaoracle.install.db.OSKMDBA_GROUP=dbaoracle.install.db.OSRACDBA_GROUP=dbaoracle.install.db.CLUSTER_NODES=oracle.install.db.config.starterdb.type=GENERAL_PURPOSEoracle.install.db.config.starterdb.globalDBname=oracle.install.db.config.starterdb.SID=oracle.install.db.ConfigureAsContainerDB=falseoracle.install.db.config.PDBname=oracle.install.db.config.starterdb.characterSet=oracle.install.db.config.starterdb.memoryOption=falseoracle.install.db.config.starterdb.memorylimit=oracle.install.db.config.starterdb.installExampleSchemas=falseoracle.install.db.config.starterdb.password.ALL=oracle.install.db.config.starterdb.password.SYS=oracle.install.db.config.starterdb.password.SYstem=oracle.install.db.config.starterdb.password.DBSNMP=oracle.install.db.config.starterdb.password.PDBadmin=oracle.install.db.config.starterdb.managementoption=DEFAulToracle.install.db.config.starterdb.omsHost=oracle.install.db.config.starterdb.omsPort=0oracle.install.db.config.starterdb.emadminUser=oracle.install.db.config.starterdb.emadminPassword=oracle.install.db.config.starterdb.enableRecovery=falseoracle.install.db.config.starterdb.storageType=oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=oracle.install.db.config.asm.diskGroup=oracle.install.db.config.asm.ASMSNMPPassword=
使用下面的命令开始安装:
[[email protected] ~]$ cd $ORACLE_HOME[[email protected] db_1]$ unzip /u02/software/19c/liNUX.x64_193000_db_home.zip[[email protected] db_1]$ ./grIDSetup.sh -silent -ignorePrereq -responsefile /tmp/db.rsp[[email protected] ~]# /u01/app/oracle/product/19.0.0/db_1/root.sh
到此,整个19c的环境搭建完毕。
二、迁移准备工作注意:新旧环境的数据库实例名必须保持一致。
2.1 创建参数文件使用18c的spfile创建pfile,并复制到19c的目录。
sql> create pfile=‘/tmp/initcdb.ora‘ from spfile;[[email protected] ~]$ scp /tmp/initcdb.ora db03:$ORACLE_HOME/dbs2.2 拷贝密码文件
将18c的密码参数文件复制到19c的目录。
[[email protected] ~]$ scp $ORACLE_HOME/dbs/orapwcdb db03:$ORACLE_HOME/dbs2.3 创建adump目录
必须创建19c的adumo文件夹,否则使用pfile初次启动实例会报错。
[[email protected] ~]$ mkdir -p /u01/app/oracle/admin/cdb/adump2.4 备份18c数据库
[[email protected] ~]$ rman target /run {allocate channel c1 device type disk;backup database format ‘/u02/orabak/rhndb_%U‘;sql ‘alter system archive log current‘;backup format ‘/u02/orabak/%d_arch_%s_%p_%h‘ archivelog all delete all input;backup format ‘/u02/orabak/controlfile_%d_%s_%p‘ current controlfile;release channel c1;}
备份后的文件名如下图所示:
整个过程就是一个异机恢复过程。只不过在恢复完成后,要以upgrade方式打开数据库,完成后续升级 *** 作。
3.1 恢复控制文件[[email protected] ~]$ rman target /Recovery Manager: Release 19.0.0.0.0 - Production on Sun May 5 15:47:32 2019Version 19.3.0.0.0copyright (c) 1982,2019,Oracle and/or its affiliates. All rights reserved.connected to target database (not started)RMAN> set dbID 2122265785executing command: SET DBIDRMAN> startup nomount;Oracle instance startedTotal System Global Area 4294965360 bytesFixed Size 9144432 bytesVariable Size 771751936 bytesDatabase Buffers 3506438144 bytesRedo Buffers 7630848 bytesRMAN> restore controlfile from ‘/u02/orabak/controlfile_CDB_19_1‘;Starting restore at 05-MAY-2019 15:48:12using target database control file instead of recovery catalogallocated channel: ORA_disK_1channel ORA_disK_1: SID=773 device type=disKchannel ORA_disK_1: restoring control filechannel ORA_disK_1: restore complete,elapsed time: 00:00:04output file name=+DATA/CDB/CONTRolfile/current.257.1007480897output file name=+FRA/CDB/CONTRolfile/current.256.1007480897Finished restore at 05-MAY-2019 15:48:19RMAN> alter database mount;released channel: ORA_disK_1Statement processed3.2 创建spfile并注册资源
RMAN> create spfile=‘+data/cdb/spfilecdb.ora‘ from pfile;Statement processed[[email protected] ~]$ srvctl add database -db cdb -oraclehome /u01/app/oracle/product/19.0.0/db_1 -pwfile $ORACLE_HOME/dbs/orapwcdb -spfile ‘+DATA/CDB/spfilecdb.ora‘ -dbname cdb -diskgroup data,fra [[email protected] ~]$ echo ‘SPfile=‘+DATA/CDB/spfilecdb.ora‘‘ >$ORACLE_HOME/dbs/initcdb.ora3.3 恢复整个数据库
--在rman中运行如下命令进行全库恢复run { allocate channel c1 device type disk; restore database; recover database; release channel c1; }
恢复完成后,以upgrade方式打开数据库并向temp表空间添加数据文件:
RMAN> alter database open resetlogs upgrade;RMAN> alter tablespace temp add tempfile ‘+data‘ size 50M autoextend on next 100m maxsize unlimited;3.4 执行dbupgrade进行升级 *** 作
[[email protected] ~]$ dbupgrade -u sysArgument List for [/u01/app/oracle/product/19.0.0/db_1/rdbms/admin/catctl.pl]For Oracle internal use only A = 0Run in c = 0Do not run in C = 0input Directory d = 0Echo OFF e = 1Simulate E = 0Forced cleanup F = 0Log ID i = 0Child Process I = 0Log Dir l = 0Priority List name L = 0Upgrade Mode active M = 0sql Process Count n = 0sql PDB Process Count N = 0Open Mode normal o = 0Start Phase p = 0End Phase P = 0Reverse Order r = 0autoUpgrade Resume R = 0Script s = 0Serial Run S = 0RO User tablespaces T = 0display Phases y = 0DeBUG catcon.pm z = 0DeBUG catctl.pl Z = 0catctl.pl VERSION: [19.0.0.0.0] STATUS: [Production] BUILD: [RDBMS_19.3.0.0.0DBRU_liNUX.X64_190417]/u01/app/oracle/product/19.0.0/db_1/rdbms/admin/orahome = [/u01/app/oracle/product/19.0.0/db_1]/u01/app/oracle/product/19.0.0/db_1/bin/orabasehome = [/u01/app/oracle/product/19.0.0/db_1]catctlGetoraBaseLogDir = [/u01/app/oracle/product/19.0.0/db_1]Analyzing file /u01/app/oracle/product/19.0.0/db_1/rdbms/admin/catupGrd.sqlLog file directory = [/tmp/cfgtoollogs/upgrade20190505160915]catcon::set_log_file_base_path: ALL catcon-related output will be written to [/tmp/cfgtoollogs/upgrade20190505160915/catupGrd_catcon_44738.lst]catcon::set_log_file_base_path: catcon: See [/tmp/cfgtoollogs/upgrade20190505160915/catupGrd*.log] files for output generated by scriptscatcon::set_log_file_base_path: catcon: See [/tmp/cfgtoollogs/upgrade20190505160915/catupGrd_*.lst] files for spool files,if anyEnter Password: Number of cpus = 4Database name = cdbDataBase Version = 18.0.0.0.0catcon::set_log_file_base_path: ALL catcon-related output will be written to [/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/cdb/upgrade20190505160957/catupGrdcdbroot_catcon_44738.lst]catcon::set_log_file_base_path: catcon: See [/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/cdb/upgrade20190505160957/catupGrdcdbroot*.log] files for output generated by scriptscatcon::set_log_file_base_path: catcon: See [/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/cdb/upgrade20190505160957/catupGrdcdbroot_*.lst] files for spool files,if anyLog file directory = [/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/cdb/upgrade20190505160957]Parallel sql Process Count (PDB) = 2Parallel sql Process Count (CDB$ROOT) = 4Concurrent PDB Upgrades = 2Generated PDB Inclusion:[PDB$SEED RHNDB SPWDB]Components in [CDB$ROOT] Installed [APS CATALOG CATJAVA CATPROC CONTEXT DV JAVAVM olS ORDIM OWM SDO XDB XML XOQ]Not Installed [APEX EM MGW ODM RAC WK]......Grand Total Time: 2468s [SPWDB] LOG fileS: (/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/cdb/upgrade20190505160957/catupGrdspwdb*.log)Upgrade Summary Report Located in:/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/cdb/upgrade20190505160957/upg_summary.log Time: 1992s For CDB$ROOT Time: 4505s For PDB(s)Grand Total Time: 6497s LOG fileS: (/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/cdb/upgrade20190505160957/catupGrdcdbroot*.log)Upgrade Summary Report Located in:/u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/cdb/upgrade20190505160957/upg_summary.logGrand Total Upgrade Time: [0d:1h:48m:17s]
如果源库中存在多个pdb,那么这个升级过程会比较耗时。升级完成后,可以验证所有的组件以升级到19.0.0.0版本,如下图所示:
col comp_name for a40set wrap offset pagesize 999select comp_name,version,status from dba_registry;总结
以上是内存溢出为你收集整理的Migrating Oracle 18c To 19c全部内容,希望文章能够帮你解决Migrating Oracle 18c To 19c所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)