Oracle 12c – Pluggable Database Nasıl Rename Edilir

Container database içerisinde oluşturulmuş olan pluggable database’ leri sonrasında rename etmek istersek nasıl yapabilirizi örnekle açıklamaya çalışalım.

Öncelikle container database’ e connect oluyoruz.

[oracle@Redhat70 ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Thu Aug 20 13:46:09 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select name from v$pdbs;

NAME
——————————
PDB$SEED
T1_PLUG1_DB
T1_PLUG2_DB
T1_PLUG3_DB

Bizim örneğimiz de T1_PLUG1_DB pluggable database’ inin ismini PLUG1_DB olarak güncellemeye çalışalım ;

İlgili pluggable database üzerinde çalışmak için ;

SQL> alter session set container=T1_PLUG1_DB ;
Session altered.

Database’ i kapatıyoruz ;

SQL> shutdown immediate
Pluggable Database closed.

Pluggable database’ imizi read/write modda restricted olarak açıyoruz ;

SQL> ALTER PLUGGABLE DATABASE OPEN READ WRITE RESTRICTED;
Pluggable database altered.

Rename komutumuzu çalıştırıyoruz ;

SQL> alter pluggable database T1_PLUG1_DB rename global_name to plug1_db;
alter pluggable database T1_PLUG1_DB rename global_name to plug1_db
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [kcfmis_internal: enq], [3], [3],[], [], [], [], [], [], [], [], []

Bu beklemediğimiz bir durumdu  Ora-00600 oracle’ ın bir internal hata kodu ve bu duruma yol bir sürü neden olabilir. Bu tarz durumlarda ilk yapılması gereken metalink de “ORA-600/ORA-7445/ORA-700 Error Look-up Tool (Doc ID 153788.1)” id’ li döküman üzerinden hatanın nedenini araştırmak olmalıdır. Benimde burdan yaptığım ufak bir araştırma sonucuında kullanmış olduğum versiyonla ilgili yayınlanmış bir bug olduğunu buldum.

Bug 19075256 – ORA-600 [kcfmis_internal: enq] from PDB RENAME (Doc ID 19075256.8)

Bu arada çalışmakta olduğum test ortamı ile ilgili versyion bilgisinide ekleyeyim ;

SQL> select banner from v$version where con_id =0;

BANNER
——————————————————————————–
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
PL/SQL Release 12.1.0.2.0 – Production
CORE 12.1.0.2.0 Production
TNS for Linux: Version 12.1.0.2.0 – Production
NLSRTL Version 12.1.0.2.0 – Production

Şimdi bu patch’ i database’ imimize geçmemiz gerekiyor. İlgili Patch’ i apply ettikden sonra tekrar devam ediyoruz ; (sadece bu bug gidermek için yayınlanmış olan patch’ ide geçebilirsiniz ancak ben bunu da içeren en son yayınlanmış olan son PSU’ yu geçtim. Daha güncel olduğu için)

[oracle@Redhat70 20831110]$ opatch apply
Oracle Interim Patch Installer version 12.1.0.1.8
Copyright (c) 2015, Oracle Corporation. All rights reserved.
..
..
Verifying environment and performing prerequisite checks…
OPatch continues with these patches: 19769480 20299023 20831110

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: Y

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = ‘/u01/sq/ora_3/oracle/db/12.1.0.2’)

Is the local system ready for patching? [y|n]
y
,User Responded with: Y
Backing up files…
Applying sub-patch ‘19769480’ to OH ‘/u01/sq/ora_3/oracle/db/12.1.0.2’



Verifying the update…
Composite patch 20831110 successfully applied.
Log file location: /u01/sq/ora_3/oracle/db/12.1.0.2/cfgtoollogs/opatch/opatch2015-08-21_09-54-08AM_1.log

OPatch succeeded.
[oracle@Redhat70 20831110]$

Post installation adımını da yapıyoruz ;

[oracle@Redhat70 OPatch]$ ./datapatch -verbose


Connecting to database…OK


Bundle series PSU:
ID 4 in the binary registry and not installed in any PDB


The following patches will be applied:
20831110 (Database Patch Set Update : 12.1.0.2.4 (20831110))

Installing patches…


SQL Patching tool complete on Fri Aug 21 10:28:37 2015
[oracle@Redhat70 OPatch]$

Evet patch’ de OK, şimdi devam edebiliriz. Aynı adımları hızlıca tekrar yapıyorum ;

SQL> alter session set container=T1_PLUG1_DB;
Session altered.

SQL> shutdown immediate
Pluggable Database closed.

SQL> ALTER PLUGGABLE DATABASE OPEN READ WRITE RESTRICTED;
Pluggable database altered.

SQL> alter pluggable database T1_PLUG1_DB rename global_name to plug1_db;
Pluggable database altered.

Rename oldu. Şimdi database’ imizi kapatıp tekrar açıyoruz;

SQL> shutdown immediate
Pluggable Database closed.

SQL> startup
Pluggable Database opened.

Yapılan değişikliği kontrol edelim.

SQL> select name , open_mode from v$pdbs;

NAME OPEN_MODE
—————————— ———-
PLUG1_DB READ WRITE

Rename işlemimiz tamamlanmış oldu.

Reference ;
ORA-600/ORA-7445/ORA-700 Error Look-up Tool (Doc ID 153788.1)
Bug 19075256 – ORA-600 [kcfmis_internal: enq] from PDB RENAME (Doc ID 19075256.8)

Be Sociable, Share!

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir


8 − = altı