Friday, May 30, 2014

Change Oracle DB 11g Character Set to AL32UTF8

Oracle11g: how I change character set to AL32UTF8?



SQL> ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8;
ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8
*
ERROR at line 1:
ORA-12719: operation requires database is in RESTRICTED mode

=>Shutdown your database using below command

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

=>Startup your database in restrict mode

SQL> startup restrict
ORACLE instance started.

Total System Global Area 1071333376 bytes
Fixed Size                  1375792 bytes
Variable Size             562037200 bytes
Database Buffers          503316480 bytes
Redo Buffers                4603904 bytes
Database mounted.
Database opened.

=>Then Apply alter command for changing character set

SQL> ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8;

Database altered.

=>Verifying after changes New Character Set

SQL> select distinct(nls_charset_name(charsetid)) CHARACTERSET,
  2  decode(type#, 1, decode(charsetform, 1, 'VARCHAR2', 2, 'NVARCHAR2','UNKOWN'
),
  3  9, decode(charsetform, 1, 'VARCHAR', 2, 'NCHAR VARYING', 'UNKOWN'),
  4  96, decode(charsetform, 1, 'CHAR', 2, 'NCHAR', 'UNKOWN'),
  5  112, decode(charsetform, 1, 'CLOB', 2, 'NCLOB', 'UNKOWN')) TYPES_USED_IN
  6  from sys.col$ where charsetform in (1,2) and type# in (1, 9, 96, 112) order
 by CHARACTERSET;

CHARACTERSET                             TYPES_USED_IN
---------------------------------------- -------------
AL16UTF16                                NCHAR
AL16UTF16                                NCLOB
AL16UTF16                                NVARCHAR2
AL32UTF8                                 CHAR
AL32UTF8                                 CLOB
AL32UTF8                                 VARCHAR2

6 rows selected.

SQL> select userenv('language') from dual;

USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.AL32UTF8


=>Shutdown and Restart Database for use.



After ODI 12c Installation Applying the patches odi_1212_opatch.zip


  • Unzip the file odi_1212_opatch.zip in a root directory (no space in the path)

  • Add opatch in the PATH
  C:\> set PATH=c:\OdiHome\OPatch;%PATH%

  • Verify that you can reach the utilities “opatch” and “unzip” from the directory where the patches are.
  • I have copied odi_1212_opatch zip into C:\temp  directory
C:\temp\odi_1212_opatch>where unzip

C:\temp\odi_1212_opatch>where opatch


Set Oracle_Home ( ODI Installation home
set ORACLE_HOME=D:\Oracle\Middleware\Oracle_Home

Apply all the patches under the subdirectory odi_1212_opatch

c:\temp\odi_1212_opatch>opatch napply odi_1212_opatch


C:\Java\jdk1.7.0_55\bin>set PATH=D:\Oracle\Middleware\Oracle_Home\OPatch;%PATH%

C:\Java\jdk1.7.0_55\bin>cd C:\TEMP\odi_1212_opatch

C:\TEMP\odi_1212_opatch>where opatch
D:\Oracle\Middleware\Oracle_Home\OPatch\opatch
D:\Oracle\Middleware\Oracle_Home\OPatch\opatch.bat

C:\TEMP\odi_1212_opatch>where unzip
E:\app\lucky\product\11.2.0\dbhome_1\BIN\unzip.exe

C:\TEMP\odi_1212_opatch>set ORACLE_HOME=D:\Oracle\Middleware\Oracle_Home

C:\TEMP\odi_1212_opatch>opatch napply odi_1212_opatch
Oracle Interim Patch Installer version 13.1.0.0.0
Copyright (c) 2013, Oracle Corporation.  All rights reserved.


Oracle Home       : D:\Oracle\Middleware\Oracle_Home
Central Inventory : C:\Program Files\Oracle\Inventory
   from           : n/a
OPatch version    : 13.1.0.0.0
OUI version       : 13.1.0.0.0
Log file location : D:\Oracle\Middleware\Oracle_Home\cfgtoollogs\opatch\opatch20
14-05-30_12-58-13PM_1.log


OPatch detects the Middleware Home as "D:\Oracle\Middleware\Oracle_Home"

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   16926420  17170540  17469061

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local sy
stem.
(Oracle Home = 'D:\Oracle\Middleware\Oracle_Home')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '16926420' to OH 'D:\Oracle\Middleware\Oracle_Home'

Patching component oracle.xdk.jrf.xmlparserv2, 12.1.2.0.0...

Patching component oracle.xdk.jrf.jaxp, 12.1.2.0.0...

Verifying the update...
Applying interim patch '17170540' to OH 'D:\Oracle\Middleware\Oracle_Home'

Patching component oracle.as.common.clone, 12.1.2.0.0...

Verifying the update...
Applying interim patch '17469061' to OH 'D:\Oracle\Middleware\Oracle_Home'

Patching component oracle.fmw.upgrade, 12.1.2.0.0...

Verifying the update...

Patches 16926420,17170540,17469061 successfully applied.
Log file location: D:\Oracle\Middleware\Oracle_Home\cfgtoollogs\opatch\opatch201
4-05-30_12-58-13PM_1.log

OPatch succeeded.