Bu blog postumuzda Pdb’mizi içeren Multitenant yapıda 12cR1 standalone ortamımızı 12cR2 versiyonuna upgrade edelim. Öncelikle test makinama 12cR1’i kuruyorum. Ardından grid ve database’i upgrade ediyorum. Grid’i upgrade etmeden önce 21255373 patch’ini geçmemiz gerekiyor yoksa grid installer ekranında screen shot’daki  gibi uyarı verir ilerlemenize izin vermez. Upgrade öncesi ve sonrası kontrollerinizi (PreUpgrade, PostUpgrade scriptilerini çalıştırabilirsiniz) yapmanız önemli. Bunun için checklistiniz olsun.

Oracle Database 12c Release 1 Grid Infrastructure (12.1.0.2.0) for Linux x86-64 (linuxamd64_12102_grid_1of2.zip, linuxamd64_12102_grid_2of2.zip)
Oracle Database 12c Release 1 (12.1.0.2.0) for Linux x86-64   (linuxamd64_12102_database_1of2.zip, linuxamd64_12102_database_2of2.zip)
Oracle Database 12c Release 2 Grid Infrastructure (12.2.0.1.0) for Linux x86-64 (linuxx64_12201_grid_home.zip)
Oracle Database 12c Release 2 (12.2.0.1.0) for Linux x86-64    (linuxx64_12201_database.zip)
OPatch patch of version 12.2.0.1.9 for Oracle software releases 12.1.0.x (installer) and 12.2.0.x (MAY 2017)   (p6880880_122010_Linux-x86-64.zip)
Patch 21255373: CSSD : DUPLICATE RESPONSE IN GROUP DATA UPDATE  (p21255373_12102160119forOCW_Linux-x86-64.zip)

[oracle@tst01 ~]$ uname -a
Linux tst01.local 4.1.12-61.1.28.el6uek.x86_64 #2 SMP Thu Feb 23 20:03:53 PST 2017 x86_64 x86_64 x86_64 GNU/Linux
[oracle@tst01 ~]$

Root ile;

yum install oracle-rdbms-server-12cR1-preinstall -y

mkdir -p /oracle/app/oracle/product/12.1.0.2/dbhome_1
chown -R oracle:oinstall /oracle
chmod -R 775 /oracle
mkdir -p /oracle/app/grid
chown -R oracle:oinstall /oracle/app/grid
chmod -R 775 /oracle/app/grid

TST12CR1
pdb1

vi .bash_profile

export ORACLE_BASE=/oracle/app
export ORACLE_SID=TST12CR1
export ORACLE_UNQNAME=TST12CR1
export ORACLE_HOME=/oracle/app/oracle/product/12.2.0.1/dbhome_1

[oracle@tst01 ~]$ cd /backup/setup/12cR1

for grid -> ./runInstaller

+DATA

[oracle@tst01]$ ls -la asmdisk*
brw-rw—- 1 oracle dba 8, 21 Apr 24 17:18 asmdisk01
brw-rw—- 1 oracle dba 8, 22 Apr 24 17:18 asmdisk02
brw-rw—- 1 oracle dba 8, 23 Apr 24 17:11 asmdisk03
brw-rw—- 1 oracle dba 8, 24 Apr 24 17:11 asmdisk04
[oracle@tst01 dev]$

for db -> ./runInstaller

 

[oracle@tst01 ~]$ ps -ef | grep pmon
oracle 1635 1 0 12:15 ? 00:00:00 ora_pmon_TST12CR1
oracle 3078 26873 0 12:22 pts/1 00:00:00 grep pmon
oracle 26346 1 0 11:54 ? 00:00:00 asm_pmon_+ASM
[oracle@tst01 ~]$

 

 

 

 

 

12cR1 db’imizi kurduk, şimdi de 12cR2 versiyonuna upgrade edelim.

***** Çöp kutusunu temizle

SQL> PURGE DBA_RECYCLEBIN;

**** Oracle upgrade öncesi dict. istatistiklerin toplanmasını öneriyor

SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

***** Invalid objeler varmı, hangileri önceden bakılır, not edilir

select OWNER, OBJECT_NAME, OBJECT_TYPE, CREATED,LAST_DDL_TIME
from dba_objects where status like 'INVALID';

***** Upgrade’in hemen öncesinde db’nin hem export hem rman full backup’ı alınır

root ile;
cd /backup
tar cvf – /oracle/app/grid | gzip > /backup/grid_home_bck.tar.gz
tar cvf – /oracle/app/oracle | gzip > /backup/oracle_home_bck.tar.gz

 

mkdir -p /oracle/app/oracle/product/12.2.0.1/dbhome_1
mkdir -p /oracle/app/grid_2
chown -R oracle:oinstall /oracle/app/grid_2
chmod -R 775 /oracle/app/grid_2

12cR2 software’i kurulur;

export ORACLE_HOME=/oracle/app/oracle/product/12.2.0.1/dbhome_1

[oracle@tst01 ~]$ cd /backup/setup/12cR2/database/
[oracle@tst01 database]$ ./runInstaller

 

 

 

 

 

[oracle@tst01 ~]$ echo $ORACLE_SID
TST12CR1
[oracle@tst01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Fri Jul 28 15:16:56 2017

Copyright (c) 1982, 2014, Oracle. All rights reserved.

Connected.
SQL> shut abort;
ORACLE instance shut down.
SQL> exit
Disconnected
[oracle@tst01 ~]$

 

**** 21255373 patch’ini geçmemiz gerekiyor öncelikle, p21255373_12102160119forOCW_Linux-x86-64.zip -> /backup/patch012017/21255373
güncel opatch, p6880880_122010_Linux-x86-64.zip -> /backup/opatch/OPatch

root ile;
mv /oracle/app/grid/OPatch /oracle/app/grid/OPatch_28072017
mv /oracle/app/oracle/product/12.1.0.2/dbhome_1/OPatch /oracle/app/oracle/product/12.1.0.2/dbhome_1/OPatch_28072017

cp -R /backup/opatch/OPatch /oracle/app/grid
cp -R /backup/opatch/OPatch /oracle/app/oracle/product/12.1.0.2/dbhome_1
cd /oracle/app/grid
chown -R oracle:oinstall OPatch
chmod 755 OPatch
ls -la
/oracle/app/oracle/product/12.1.0.2/dbhome_1
chown -R oracle:oinstall OPatch
chmod 755 OPatch
ls -la

–mevcut olanlar;
/oracle/app/oracle/product/12.1.0.2/dbhome_1/OPatch/opatch lsinventory -detail -oh /oracle/app/oracle/product/12.1.0.2/dbhome_1
/oracle/app/grid/OPatch/opatch lsinventory -detail -oh /oracle/app/grid

Not: 12.2.0.1.5 ve sonraki Opatch sürümlerinde ../OPatch/ocm/bin altında emocmrsp file’ı yok, kullanmamıza gerek kalmıyor.

–patch for grid;

[root@tst01 ~]# export PATH=$PATH:/oracle/app/grid/OPatch
[root@tst01 ~]# cd /oracle/app/grid/OPatch
[root@tst01 OPatch]# opatchauto apply /backup/patch012017/21255373

OPatchauto session is initiated at Fri Jul 28 16:19:34 2017

System initialization log file is /oracle/app/grid/cfgtoollogs/opatchautodb/systemconfig2017-07-28_04-19-36PM.log.

Session log file is /oracle/app/grid/cfgtoollogs/opatchauto/opatchauto2017-07-28_04-19-41PM.log
The id for this session is NSFS

Executing OPatch prereq operations to verify patch applicability on home /oracle/app/oracle/product/12.1.0.2/dbhome_1
Patch applicability verified successfully on home /oracle/app/oracle/product/12.1.0.2/dbhome_1

Verifying SQL patch applicability on home /oracle/app/oracle/product/12.1.0.2/dbhome_1
SQL patch applicability verified successfully on home /oracle/app/oracle/product/12.1.0.2/dbhome_1

Executing OPatch prereq operations to verify patch applicability on home /oracle/app/grid
Patch applicability verified successfully on home /oracle/app/grid

Preparing to bring down database service on home /oracle/app/oracle/product/12.1.0.2/dbhome_1
Successfully prepared home /oracle/app/oracle/product/12.1.0.2/dbhome_1 to bring down database service

Bringing down database service on home /oracle/app/oracle/product/12.1.0.2/dbhome_1
Database service successfully brought down on home /oracle/app/oracle/product/12.1.0.2/dbhome_1

Bringing down CRS service on home /oracle/app/grid
Prepatch operation log file location: /oracle/app/grid/cfgtoollogs/crsconfig/hapatch_2017-07-28_04-20-28PM.log
CRS service brought down successfully on home /oracle/app/grid

Start applying binary patch on home /oracle/app/oracle/product/12.1.0.2/dbhome_1
Binary patch applied successfully on home /oracle/app/oracle/product/12.1.0.2/dbhome_1

Start applying binary patch on home /oracle/app/grid
Binary patch applied successfully on home /oracle/app/grid

Starting CRS service on home /oracle/app/grid
Postpatch operation log file location: /oracle/app/grid/cfgtoollogs/crsconfig/hapatch_2017-07-28_04-22-28PM.log
CRS service started successfully on home /oracle/app/grid

Starting database service on home /oracle/app/oracle/product/12.1.0.2/dbhome_1
Database service successfully started on home /oracle/app/oracle/product/12.1.0.2/dbhome_1

Preparing home /oracle/app/oracle/product/12.1.0.2/dbhome_1 after database service restarted
No step execution required………
Prepared home /oracle/app/oracle/product/12.1.0.2/dbhome_1 successfully after database service restarted

Trying to apply SQL patch on home /oracle/app/oracle/product/12.1.0.2/dbhome_1

[WARNING] The local database(s) on “/oracle/app/oracle/product/12.1.0.2/dbhome_1” is not running. SQL changes, if any, cannot be applied;
SQL patch applied successfully on home /oracle/app/oracle/product/12.1.0.2/dbhome_1

OPatchAuto successful.

——————————–Summary——————————–

Patching is completed successfully. Please find the summary as follows:

Host:tst01
SIDB Home:/oracle/app/oracle/product/12.1.0.2/dbhome_1
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /backup/patch012017/21255373/21255373
Log: /oracle/app/oracle/product/12.1.0.2/dbhome_1/cfgtoollogs/opatchauto/core/opatch/opatch2017-07-28_16-20-49PM_1.log

Host:tst01
SIHA Home:/oracle/app/grid
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /backup/patch012017/21255373/21255373
Log: /oracle/app/grid/cfgtoollogs/opatchauto/core/opatch/opatch2017-07-28_16-21-05PM_1.log

Patching session reported following warning(s):
_________________________________________________

[WARNING] The database instance ‘TST12CR1’ from ‘/oracle/app/oracle/product/12.1.0.2/dbhome_1′, in host’tst01’ is not running. SQL changes, if any, will not be applied.
To apply. the SQL changes, bring up the database instance and run the command manually from any one node (run as oracle).
Refer to the readme to get the correct steps for applying the sql changes.

OPatchauto session completed at Fri Jul 28 16:22:45 2017

Patch’i hem grid’e hem de db home’a uyguladı.

Grid upgrade;

[oracle@tst01 grid]$ ./gridSetup.sh

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Grid upgrade başarılı şekilde bitti, crsctl ile kontrol yapıldı.

Db upgrade;

export ORACLE_HOME=/oracle/app/oracle/product/12.2.0.1/dbhome_1
cd /oracle/app/oracle/product/12.2.0.1/dbhome_1/bin
[oracle@tst01 bin]$ ./dbua

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[oracle@tst01 bin]$ ./dbua
Logs directory: /oracle/app/cfgtoollogs/dbua/upgrade2017-07-28_04-42-55-PM
Preupgrade generated files:
/oracle/app/cfgtoollogs/dbua/upgrade2017-07-28_04-42-55-PM/TST12CR1/upgrade.xml
/oracle/app/cfgtoollogs/dbua/upgrade2017-07-28_04-42-55-PM/TST12CR1/preupgrade_fixups.sql
/oracle/app/cfgtoollogs/dbua/upgrade2017-07-28_04-42-55-PM/TST12CR1/postupgrade_fixups.sql
Database upgrade has been completed successfully, and the database is ready to use.
[oracle@tst01 bin]$ cd
[oracle@tst01 ~]$ ps -ef | grep pmon
oracle 5737 1 0 16:34 ? 00:00:00 asm_pmon_+ASM
oracle 28244 1 0 17:46 ? 00:00:00 ora_pmon_TST12CR1
oracle 29495 9723 0 20:10 pts/1 00:00:00 grep pmon

[oracle@tst01 ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Mon Jul 31 09:39:01 2017
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 – 64bit Production
SQL> select name from v$database;

NAME
———
TST12CR1

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 – 64bit Production
[oracle@tst01 ~]$ lsnrctl stat

LSNRCTL for Linux: Version 12.2.0.1.0 – Production on 31-JUL-2017 09:51:56

Copyright (c) 1991, 2016, Oracle. All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 – Production
Start Date 28-JUL-2017 16:34:00
Uptime 2 days 17 hr. 17 min. 55 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/grid/network/admin/listener.ora
Listener Log File /oracle/app/diag/tnslsnr/tst01/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tst01.local)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=tst01.local)(PORT=5500))(Security=(my_wallet_directory=/oracle/app/admin/TST12CR1/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary…
Service “+ASM” has 1 instance(s).
Instance “+ASM”, status READY, has 1 handler(s) for this service…
Service “+ASM_DATA” has 1 instance(s).
Instance “+ASM”, status READY, has 1 handler(s) for this service…
Service “555e2224f8e50873e053a013b80a484d” has 1 instance(s).
Instance “TST12CR1”, status READY, has 1 handler(s) for this service…
Service “TST12CR1” has 1 instance(s).
Instance “TST12CR1”, status READY, has 1 handler(s) for this service…
Service “TST12CR1XDB” has 1 instance(s).
Instance “TST12CR1”, status READY, has 1 handler(s) for this service…
Service “pdb1” has 1 instance(s).
Instance “TST12CR1”, status READY, has 1 handler(s) for this service…
The command completed successfully

 

Referans: Oracle® Database Upgrade Guide 12c Release 2 (12.2) -> https://docs.oracle.com/database/122/UPGRD/UPGRD.pdf

 

 

Reklam