43
Near-Zero Downtime Database Character Set Conversion using Oracle Database Migration Assistant for Unicode and Oracle Streams Proof of Concept Tomas Ramanauskas [email protected] 02/10/2011

Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

Near-Zero Downtime

Database Character Set Conversion using

Oracle Database Migration Assistant for Unicode

and Oracle Streams

Proof of Concept

Tomas Ramanauskas

[email protected]

02/10/2011

Page 2: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)
Page 3: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

1. Introduction .............................................................................................................. 4

2. Conversion process overview ................................................................................... 5 3. Converting the character set ................................................................................... 6

3.1. Creating the primary database ............................................................................ 6

3.2. Convert character set of the primary database to WE8MSWIN1252 (optional) 6

3.3. Creating the physical standby database .............................................................. 7

3.4. Creating the capture database ............................................................................. 9

3.5. Configuring a Streams Administrator ................................................................ 9

3.6. Configuring the Archive log transport to the capture database .......................... 9

3.7. Creating database links in the capture database ............................................... 10

3.8. Creating and reviewing a Streams pre-instantiation script on the capture

database ................................................................................................................ 11

3.9. Instantiation of the destination database .......................................................... 13

3.10. Creating and reviewing Streams post-instantiation script on the capture

database ................................................................................................................ 15

3.11. Locking the strmadmin account ....................................................................... 16

3.12. Conversion of the destination database using Oracle Database Migration

Assistant for Unicode ........................................................................................... 16

3.13. Applying the changes from the primary database ............................................ 28

3.14. Verifying that the data is being converted ........................................................ 28

3.15. Switching applications over to the new database ............................................. 39

3.16. Removing the Streams configuration ............................................................... 39

4. Known issues and recommendations .................................................................... 40 4.1. Resizing the database prior to conversion ........................................................ 40

4.2. Disabling the SHARED session mode ............................................................. 40

4.3. Enabling the Flashback database feature.......................................................... 40

4.4. Disabling automatic SGA management ........................................................... 40

5. Documentation ........................................................................................................ 41 APPENDIX A ................................................................................................................ 42

Page 4: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

1. Introduction

This document demonstrates the conversion of database characters set in near-zero

downtime. Oracle Streams with downstream capture will be used together with Oracle

Database Migration Assistant for Unicode (DMU) to perform inline character set

conversion.

The concept described in this document will be used to convert a character set of a 4TB

size production database.

Scripts that were used to demonstrate the conversion process are available, but they

contain the following hard coded values that are related to the environment (IP

addresses, ORACLE_HOME location, etc):

ORACLE_BASE /u01/app/oracle

ORACLE_HOME /u01/app/oracle/product/db/10.2.0.4.4

IP 172.18.8.142

Source Database BMCTSTS

Capture Database BMCTSTC

Destination Database BMCTSTD

Page 5: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

2. Conversion process overview

The main steps that will be performed to convert the character set of the database are as

follows:

Creation of a physical standby database

Creation of a capture database (Řthe third database is the capture databaseř

method)

Conversion of the physical standby into the destination database

Setting up streams following instantiation

Converting the character set of the destination database

Application of changes from the source database, removal of streams

Before and during conversion

Source Database

(BMCTSTS)

10.2.0.4.4

WE8ISO8859P1

Capture Database

(BMCTSTC)

10.2.0.4.4

AL32UTF8

Destination Database

(BMCTSTD)

10.2.0.4.4

AL32UTF8

Redo LogDatabase objects Redo LogShipped for Downstream

Capture

Capture

processQueue Queue

Apply

Process

Database

ObjectsChanges

Database Clients

(Applications)

After conversion

Source Database

(BMCTSTS)

10.2.0.4.4

WE8ISO8859P1

Capture Database

(BMCTSTC)

10.2.0.4.4

AL32UTF8

Destination Database

(BMCTSTD)

10.2.0.4.4

AL32UTF8

Redo LogDatabase objects Redo LogShipped for Downstream

Capture

Capture

processQueue Queue

Apply

Process

Database

ObjectsChanges

Database Clients

(Applications)

Page 6: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

3. Converting the character set

3.1. Creating the primary database

We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

using the scripts generated by DBCA.

N.B: we use the same password stored in the password file for the primary, standby and

capture databases.

Scripts available: Unicode/scripts/BMCTSTS/BMCTSTS.sh

3.2. Convert character set of the primary database to WE8MSWIN1252 (optional)

In section 3.13, we will load a sample table with characters with the code from 0 to 255.

Characters between 128 and 159 do not have a value assigned in WE8ISO8859P1 and

therefore cannot be correctly converted to AL32UTF8 by Oracle Streams.

WE8MSWIN1252 is a binary superset of WE8ISO8859P1. All characters that are

encoded in WE8ISO8859P1 are identically encoded in WE8MSWIN1252.

$ sqlplus ‘/as sysdba’

SQL> create directory log_file_dir as

'/u01/oradata/BMCTSTS/scripts/';

SQL> create directory data_file_dir as

'/u01/oradata/BMCTSTS/scripts/';

SQL> @?/rdbms/admin/csminst.sql

$ csscan FULL=Y FROMCHAR=WE8MSWIN1252

TOCHAR=WE8MSWIN1252 LOG=WE8MSWIN1252_WE8MSWIN1252

CAPTURE=Y ARRAY=1000000 PROCESS=2

exclude=(XDB.XDB\$CONFIG, XDB.XDB\$SIMPLE_TYPE)

SQL> shutdown immediate

SQL> startup restrict

SQL> @@?\rdbms\admin\csalter.plb

SQL> alter system set aq_tm_processes=10 scope=both;

SQL> alter system set job_queue_processes=10 scope=both;

SQL> shutdown immediate;

SQL> startup

SQL> select * from nls_database_parameters;

PARAMETER VALUE

------------------------- ------------------------------

NLS_LANGUAGE AMERICAN

NLS_TERRITORY AMERICA

NLS_CURRENCY $

NLS_ISO_CURRENCY AMERICA

Page 7: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

NLS_NUMERIC_CHARACTERS .,

NLS_CHARACTERSET WE8MSWIN1252

NLS_CALENDAR GREGORIAN

NLS_DATE_FORMAT DD-MON-RR

NLS_DATE_LANGUAGE AMERICAN

NLS_SORT BINARY

NLS_TIME_FORMAT HH.MI.SSXFF AM

NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM

NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR

NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR

NLS_DUAL_CURRENCY $

NLS_COMP BINARY

NLS_LENGTH_SEMANTICS BYTE

NLS_NCHAR_CONV_EXCP FALSE

NLS_NCHAR_CHARACTERSET AL16UTF16

NLS_RDBMS_VERSION 10.2.0.4.0

20 rows selected.

More details on My Oracle Support document:

Changing US7ASCII or WE8ISO8859P1 to WE8MSWIN1252 [ID 555823.1]

Scripts available: Unicode/scripts/BMCTSTS/change_charset.sh

3.3. Creating the physical standby database

We create a RMAN backup of the primary (BMCTSTS) database.

$ rman target /

connected to target database: BMCTST (DBID=322246004)

RMAN> run

2> {

3> allocate channel ch1 type=disk

4> format='/u01/oradata/BMCTSTD/%U';

5> backup as copy database;

6> }

We then create a physical standby control file.

SQL> alter database create physical standby

controlfile as '/u01/oradata/BMCTSTD/control01.ctl';

We create spfileBMCTSTD.ora file, based on spfileBMCTSTS.ora.

We ensure that the BMCTSTD database instance uses Oracle 10.2.0.4.4 and that this

Oracle home has the patches (https://updates.oracle.com/download/9825461.html)

installed that are documented in ŘOracle Database Migration Assistant for Unicode

Guideř.

Page 8: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

We copy Řcontrol01.ctlř to Řcontrol02.ctlř and Řcontrol03.ctlř and start up BMCTSTD in

mount mode:

SQL> startup mount;

We rename the database data files:

$ rman target /

RMAN> switch database to copy;

We rename the redo log files and temporary files:

SQL> alter database rename file

'/u01/oradata/BMCTSTS/redo01.log' to

'/u01/oradata/BMCTSTD/redo01.log';

Database altered.

SQL> alter database rename file

'/u01/oradata/BMCTSTS/redo02.log' to

'/u01/oradata/BMCTSTD/redo02.log';

Database altered.

SQL> alter database rename file

'/u01/oradata/BMCTSTS/redo03.log' to

'/u01/oradata/BMCTSTD/redo03.log';

Database altered.

SQL> alter database rename file

'/u01/oradata/BMCTSTS/temp01.dbf' to

'/u01/oradata/BMCTSTD/temp01.dbf';

Database altered.

We create a database password file:

orapwd file=orapwBMCTSTD password=<sysPassword>

We then put the database in managed recovery mode:

SQL> recover managed standby database disconnect;

Configuring the archive log destination on the primary database (BMCTSTS):

SQL> alter system set

log_archive_dest_2='SERVICE=BMCTSTD ARCH OPTIONAL

DELAY=0' scope=both;

Page 9: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

SQL> alter system archive log current;

We verify that archive log files have been shipped to the standby database and applied:

Tue Mar 29 15:40:24 2011

RFS[2]: Archived Log:

'/u01/oradata/BMCTSTD/standby_arch/1_2_747058581.dbf'

Tue Mar 29 15:40:24 2011

Media Recovery Log

/u01/oradata/BMCTSTD/standby_arch/1_2_747058581.dbf

Media Recovery Waiting for thread 1 sequence 3

Scripts available:

Unicode/scripts/BMCTSTD/backup_BMCTSTS.sh

Unicode/scripts/BMCTSTD/create_controlfile.sh

Unicode/scripts/BMCTSTD/startup_and_switch_to_copy.sh

Unicode/scripts/BMCTSTD/create_passwordfile.sql

Unicode/scripts/BMCTSTD/put_in_mrm.sh

Unicode/scripts/BMCTSTS/configure_arch_to_BMCTSTD.sh

3.4. Creating the capture database

We create the BMCTSTC database (with NLS_CHARACTERSET=AL32UTF8) using

the scripts generated by DBCA.

Note: we use the same password stored in the password file for the primary, standby

and capture databases.

Scripts available: Unicode/scripts/BMCTSTC/BMCTSTC.sh

3.5. Configuring a Streams Administrator

We configure the Streams Administrator on both the primary (BMCTSTS) and capture

databases (BMCTSTC). Oracle documentation on setting up Streams configuration is

available at: http://download.oracle.com/docs/cd/B19306_01/server.102/b14229/strms_mprep.htm#i1006121

Scripts available:

Unicode/scripts/BMCTSTS/configure_strmadm.sh

Unicode/scripts/BMCTSTC/configure_strmadm.sh

3.6. Configuring the Archive log transport to the capture database

On the primary database (BMCTSTS), we set the archive log destination:

SQL> alter system set

log_archive_dest_3='SERVICE=BMCTSTC ARCH OPTIONAL

DELAY=0 NOREGISTER' scope=both;

Page 10: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

SQL> alter system archive log current;

Scripts available: Unicode/scripts/BMCTSTS/configure_arch_to_BMCTSTC.sh

Checking the capture database (BMCTSTC) alert log file, we should see:

Redo Shipping Client Connected as PUBLIC

-- Connected User is Valid

RFS[3]: Assigned to RFS process 2866

RFS[3]: Identified database type as 'repository'

RFS[3]: Identified database type as 'repository'

3.7. Creating database links in the capture database

On the capture database, we create database links to both the source and destination

databases.

$ sqlplus strmadmin/strmadminpw@BMCTSTC

SQL> CREATE DATABASE LINK BMCTSTS CONNECT TO strmadmin

IDENTIFIED BY strmadminpw USING

'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HO

ST=172.18.8.142)(PORT=1521)))(CONNECT_DATA=(SERVICE_NA

ME=BMCTSTS)))';

SQL> CREATE DATABASE LINK BMCTSTD CONNECT TO strmadmin

IDENTIFIED BY strmadminpw USING

'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HO

ST=172.18.8.142)(PORT=1521)))(CONNECT_DATA=(SERVICE_NA

ME=BMCTSTD)))';

N.B: the destination database (BMCTSTD) remains a physical standby database opened

in MRM at this point.

Scripts available: Unicode/scripts/BMCTSTC/create_db_links.sh

Page 11: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

3.8. Creating and reviewing a Streams pre-instantiation script on the capture database

SQL> CREATE DIRECTORY scripts_dir AS

'/u01/oradata/BMCTSTC/scripts/';

Directory created.

SQL> DECLARE

2 empty_tbs

DBMS_STREAMS_TABLESPACE_ADM.TABLESPACE_SET;

3 BEGIN

4 DBMS_STREAMS_ADM.PRE_INSTANTIATION_SETUP(

5 maintain_mode => 'GLOBAL',

6 tablespace_names => empty_tbs,

7 source_database => 'BMCTSTS',

8 destination_database => 'BMCTSTD',

9 perform_actions => false,

10 script_name =>

'pre_instantiation.sql',

11 script_directory_object => 'scripts_dir',

12 capture_name => 'capture_maint',

13 capture_queue_table =>

'strmadmin.capture_q_table',

14 capture_queue_name =>

'strmadmin.capture_q',

15 propagation_name => 'prop_maint',

16 apply_name => 'apply_maint',

17 apply_queue_table =>

'strmadmin.apply_q',

18 apply_queue_name =>

'strmadmin.apply_q_table',

19 bi_directional => false,

20 include_ddl => true,

21 start_processes => false,

22 exclude_schemas => '*',

23 exclude_flags =>

DBMS_STREAMS_ADM.EXCLUDE_FLAGS_UNSUPPORTED +

24

DBMS_STREAMS_ADM.EXCLUDE_FLAGS_DML +

25

DBMS_STREAMS_ADM.EXCLUDE_FLAGS_DDL);

26 END;

27 /

PL/SQL procedure successfully completed.

Page 12: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

Scripts available: Unicode/scripts/BMCTSTC/create_pre_instantiation.sh

We review /u01/oradata/BMCTSTC/scripts/pre_instantiation.sql script, and then

execute pre_instantiation.sql as strmadmin user on the capture database (BMCTSTC).

Provide the following values while running the script:

SQL> PROMPT 'Enter TNS Name of site 1 as parameter 1:'

'Enter TNS Name of site 1 as parameter 1:'

SQL> DEFINE db1 = &1

Enter value for 1: BMCTSTS

SQL> PROMPT

SQL> PROMPT 'Enter streams admin username for site 1

as parameter 2:'

'Enter streams admin username for site 1 as parameter

2:'

SQL> DEFINE strm_adm_db1 = &2

Enter value for 2: strmadmin

SQL> PROMPT

SQL> PROMPT 'Enter streams admin password for site 1

as parameter 3:'

'Enter streams admin password for site 1 as parameter

3:'

SQL> DEFINE strm_adm_pwd_db1 = &3

Enter value for 3: strmadminpw

SQL> PROMPT

SQL> PROMPT 'Enter TNS Name of site 2 as parameter 4:'

'Enter TNS Name of site 2 as parameter 4:'

SQL> DEFINE db2 = &4

Enter value for 4: BMCTSTD

SQL> PROMPT

SQL> PROMPT 'Enter streams admin username for site 2

as parameter 5:'

'Enter streams admin username for site 2 as parameter

5:'

SQL> DEFINE strm_adm_db2 = &5

Enter value for 5: strmadmin

SQL> PROMPT

SQL> PROMPT 'Enter streams admin password for site 2

as parameter 6:'

'Enter streams admin password for site 2 as parameter

6:'

SQL> DEFINE strm_adm_pwd_db2 = &6

Enter value for 6: strmadminpw

SQL> PROMPT

SQL> PROMPT 'Enter TNS Name of site 3 as parameter 7:'

'Enter TNS Name of site 3 as parameter 7:'

Page 13: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

SQL> DEFINE db3 = &7

Enter value for 7: BMCTSTC

SQL> PROMPT

SQL> PROMPT 'Enter streams admin username for site 3

as parameter 8:'

'Enter streams admin username for site 3 as parameter

8:'

SQL> DEFINE strm_adm_db3 = &8

Enter value for 8: strmadmin

SQL> PROMPT

SQL> PROMPT 'Enter streams admin password for site 3

as parameter 9:'

'Enter streams admin password for site 3 as parameter

9:'

SQL> DEFINE strm_adm_pwd_db3 = &9

Enter value for 9: strmadminpw

3.9. Instantiation of the destination database

We cancel the application of the Redo Log on the physical standby database

(BMCTSTD):

SQL> recover managed standby database cancel;

We then collect the SCN from the primary database (BMCTSTS):

SQL> SET SERVEROUTPUT ON SIZE 1000000

DECLARE

until_scn NUMBER;

BEGIN

until_scn:= DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER;

DBMS_OUTPUT.PUT_LINE('Until SCN: ' ||

until_scn);

END;

/SQL> 2 3 4 5 6 7

Until SCN: 5984281

PL/SQL procedure successfully completed.

SQL> alter system archive log current;

We recover the physical standby database until SCN:

SQL> recover standby database until change 5984281;

Scripts available:

Unicode/scripts/BMCTSTD/collect_SCN_BMCTSTS.sh

Unicode/scripts/BMCTSTD/verify_datafile_headers.sql

Unicode/scripts/BMCTSTD/instantiate_BMCTSTD.sql

Page 14: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

Verifying that the recovery has finished as expected:

SQL> select distinct CHECKPOINT_CHANGE# from

v$datafile_header;

CHECKPOINT_CHANGE#

------------------

5984281

We activate the physical standby database (BMCTSTD) and open it in restricted mode:

SQL> alter database activate standby database;

SQL> shutdown immediate;

SQL> startup restrict;

We change the global name of the BMCTSTD database:

SQL> ALTER DATABASE RENAME GLOBAL_NAME TO BMCTSTD;

SQL> shutdown immediate

SQL> startup

Creating a database link to the source database (BMCTSTS):

$ sqlplus strmadmin/strmadminpw@BMCTSTD

SQL> CREATE DATABASE LINK BMCTSTS CONNECT TO strmadmin

IDENTIFIED BY strmadminpw USING

'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HO

ST=172.18.8.142)(PORT=1521)))(CONNECT_DATA=(SERVICE_NA

ME=BMCTSTS)))';

Scripts available:

Unicode/scripts/BMCTSTD/activate_BMCTSTD.sh

Unicode/scripts/BMCTSTD/rename_global_name.sh

Unicode/scripts/BMCTSTD/create_db_link.sh

Page 15: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

3.10. Creating and reviewing Streams post-instantiation script on the capture database

We modify the create_post_instantiation.sh script, changing the value of the

instantiation_scn parameter to the value of the SCN we previously collected in step 3.9.

SQL> create directory scripts_dir as

'/u01/oradata/BMCTSTC/scripts';

Directory created.

SQL> DECLARE

2 empty_tbs

DBMS_STREAMS_TABLESPACE_ADM.TABLESPACE_SET;

3 BEGIN

4 DBMS_STREAMS_ADM.POST_INSTANTIATION_SETUP(

5 maintain_mode => 'GLOBAL',

6 tablespace_names => empty_tbs,

7 source_database => 'BMCTSTS',

8 destination_database => 'BMCTSTD',

9 perform_actions => false,

10 script_name =>

'post_instantiation.sql',

11 script_directory_object => 'scripts_dir',

12 capture_name => 'capture_maint',

13 capture_queue_table =>

'strmadmin.capture_q_table',

14 capture_queue_name =>

'strmadmin.capture_q',

15 propagation_name => 'prop_maint',

16 apply_name => 'apply_maint',

17 apply_queue_table =>

'strmadmin.apply_q',

18 apply_queue_name =>

'strmadmin.apply_q_table',

19 bi_directional => false,

20 include_ddl => true,

21 start_processes => false,

22 instantiation_scn => 5984281, -- NULL

if Export/Import instantiation

23 exclude_schemas => '*',

24 exclude_flags =>

DBMS_STREAMS_ADM.EXCLUDE_FLAGS_UNSUPPORTED +

25

DBMS_STREAMS_ADM.EXCLUDE_FLAGS_DML +

26

DBMS_STREAMS_ADM.EXCLUDE_FLAGS_DDL);

27 END;

28 /

PL/SQL procedure successfully completed.

Page 16: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

Scripts available: Unicode/scripts/BMCTSTC/create_post_instantiation.sh

We review the /u01/oradata/BMCTSTC/scripts/post_instantiation.sql script.

We execute post_instantiation.sql as strmadmin user on the capture database

(BMCTSTC), providing the same values as we did previously while executing

pre_instantiation.sql script.

3.11. Locking the strmadmin account

To ensure that there are no additional sessions in the database, lock the strmadmin

account and restart the BMCTSTD database instance:

SQL> alter user strmadmin account lock;

SQL> shutdown immediate

SQL> startup

Scripts available: Unicode/scripts/BMCTSTD/lock_strmadmin.sh

3.12. Conversion of the destination database using Oracle Database Migration Assistant for Unicode

We install the DBMS_DUMA_INTERNAL package on the BMCTSTD database:

SQL> @?/rdbms/admin/prvtdumi.plb

Thereafter adding the database connection to the BMCTSTD database:

Page 17: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

We connect SYS as SYDBA, installing the DMU repository. We choose the

recommended Unicode database character set, AL32UTF8:

Page 18: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

We install the repository in SYSAUX tablespace:

Page 19: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

We then scan the database:

Page 20: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

We choose ŘCollect also rowids for Update Convertible Rows conversion methodř:

Page 21: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

We convert the database:

Page 22: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

We respond ŘYESř (we can end the sessions later):

Thereafter selecting ŘOKř to proceed:

Page 23: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

We press ŘYESř to start:

Page 24: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)
Page 25: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)
Page 26: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)
Page 27: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

We check the character set of the BMCSTD database:

SQL> col parameter for a25

SQL> col value for a25

SQL> set pagesize 30

SQL> select * from nls_database_parameters;

PARAMETER VALUE

------------------------- -------------------------

NLS_DMU_USAGE 20110330193526,2011033019

1745,WE8ISO8859

NLS_LANGUAGE AMERICAN

NLS_TERRITORY AMERICA

NLS_CURRENCY $

NLS_ISO_CURRENCY AMERICA

NLS_NUMERIC_CHARACTERS .,

NLS_CHARACTERSET AL32UTF8

NLS_CALENDAR GREGORIAN

NLS_DATE_FORMAT DD-MON-RR

NLS_DATE_LANGUAGE AMERICAN

NLS_SORT BINARY

NLS_TIME_FORMAT HH.MI.SSXFF AM

NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM

NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR

NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM

TZR

NLS_DUAL_CURRENCY $

NLS_COMP BINARY

NLS_LENGTH_SEMANTICS BYTE

NLS_NCHAR_CONV_EXCP FALSE

NLS_NCHAR_CHARACTERSET AL16UTF16

NLS_RDBMS_VERSION 10.2.0.4.0

21 rows selected.

Scripts available: Unicode/scripts/BMCTSTD/check_charset.sh

Page 28: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

3.13. Applying the changes from the primary database

We first unlock the strmadmin user account:

SQL> alter user strmadmin account unlock;

SQL> alter system set job_queue_processes=10

scope=both;

SQL> alter system set aq_tm_processes=10 scope=both;

Then start the apply process on the destination database (BMCTSTD):

SQL> alter system set aq_tm_processes=10 scope=both;

BEGIN

DBMS_APPLY_ADM.START_APPLY(

apply_name => 'apply_maint');

END;

/

We begin the capture process on the capture database (BMCTSTC):

BEGIN

DBMS_CAPTURE_ADM.START_CAPTURE(

capture_name => 'capture_maint');

END;

/

Scripts available: Unicode/scripts/BMCTSTD/apply_changes.sh

3.14. Verifying that the data is being converted

We create a table on the primary (BMCTSTS) database and populate it with the data:

SQL> create table test_table(id number, text

varchar2(10));

Table created.

SQL> begin

2 for i in 0..255 loop

3 insert into test_table values (i,chr(i));

4 end loop;

5 end;

6 /

PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.

Page 29: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

Scripts available: Unicode/scripts/BMCTSTS/create_test_table.sh

We then verify the data on the primary database:

SQL> col text for a20

SQL> set pagesize 260

SQL> select id, dump(text) text from test_table;

ID TEXT

---------- --------------------

0 Typ=1 Len=1: 0

1 Typ=1 Len=1: 1

2 Typ=1 Len=1: 2

3 Typ=1 Len=1: 3

4 Typ=1 Len=1: 4

5 Typ=1 Len=1: 5

6 Typ=1 Len=1: 6

7 Typ=1 Len=1: 7

8 Typ=1 Len=1: 8

9 Typ=1 Len=1: 9

10 Typ=1 Len=1: 10

11 Typ=1 Len=1: 11

12 Typ=1 Len=1: 12

13 Typ=1 Len=1: 13

14 Typ=1 Len=1: 14

15 Typ=1 Len=1: 15

16 Typ=1 Len=1: 16

17 Typ=1 Len=1: 17

18 Typ=1 Len=1: 18

19 Typ=1 Len=1: 19

20 Typ=1 Len=1: 20

21 Typ=1 Len=1: 21

22 Typ=1 Len=1: 22

23 Typ=1 Len=1: 23

24 Typ=1 Len=1: 24

25 Typ=1 Len=1: 25

26 Typ=1 Len=1: 26

27 Typ=1 Len=1: 27

28 Typ=1 Len=1: 28

29 Typ=1 Len=1: 29

30 Typ=1 Len=1: 30

31 Typ=1 Len=1: 31

32 Typ=1 Len=1: 32

33 Typ=1 Len=1: 33

34 Typ=1 Len=1: 34

35 Typ=1 Len=1: 35

36 Typ=1 Len=1: 36

37 Typ=1 Len=1: 37

38 Typ=1 Len=1: 38

39 Typ=1 Len=1: 39

40 Typ=1 Len=1: 40

41 Typ=1 Len=1: 41

Page 30: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

42 Typ=1 Len=1: 42

43 Typ=1 Len=1: 43

44 Typ=1 Len=1: 44

45 Typ=1 Len=1: 45

46 Typ=1 Len=1: 46

47 Typ=1 Len=1: 47

48 Typ=1 Len=1: 48

49 Typ=1 Len=1: 49

50 Typ=1 Len=1: 50

51 Typ=1 Len=1: 51

52 Typ=1 Len=1: 52

53 Typ=1 Len=1: 53

54 Typ=1 Len=1: 54

55 Typ=1 Len=1: 55

56 Typ=1 Len=1: 56

57 Typ=1 Len=1: 57

58 Typ=1 Len=1: 58

59 Typ=1 Len=1: 59

60 Typ=1 Len=1: 60

61 Typ=1 Len=1: 61

62 Typ=1 Len=1: 62

63 Typ=1 Len=1: 63

64 Typ=1 Len=1: 64

65 Typ=1 Len=1: 65

66 Typ=1 Len=1: 66

67 Typ=1 Len=1: 67

68 Typ=1 Len=1: 68

69 Typ=1 Len=1: 69

70 Typ=1 Len=1: 70

71 Typ=1 Len=1: 71

72 Typ=1 Len=1: 72

73 Typ=1 Len=1: 73

74 Typ=1 Len=1: 74

75 Typ=1 Len=1: 75

76 Typ=1 Len=1: 76

77 Typ=1 Len=1: 77

78 Typ=1 Len=1: 78

79 Typ=1 Len=1: 79

80 Typ=1 Len=1: 80

81 Typ=1 Len=1: 81

82 Typ=1 Len=1: 82

83 Typ=1 Len=1: 83

84 Typ=1 Len=1: 84

85 Typ=1 Len=1: 85

86 Typ=1 Len=1: 86

87 Typ=1 Len=1: 87

88 Typ=1 Len=1: 88

89 Typ=1 Len=1: 89

90 Typ=1 Len=1: 90

91 Typ=1 Len=1: 91

92 Typ=1 Len=1: 92

93 Typ=1 Len=1: 93

94 Typ=1 Len=1: 94

Page 31: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

95 Typ=1 Len=1: 95

96 Typ=1 Len=1: 96

97 Typ=1 Len=1: 97

98 Typ=1 Len=1: 98

99 Typ=1 Len=1: 99

100 Typ=1 Len=1: 100

101 Typ=1 Len=1: 101

102 Typ=1 Len=1: 102

103 Typ=1 Len=1: 103

104 Typ=1 Len=1: 104

105 Typ=1 Len=1: 105

106 Typ=1 Len=1: 106

107 Typ=1 Len=1: 107

108 Typ=1 Len=1: 108

109 Typ=1 Len=1: 109

110 Typ=1 Len=1: 110

111 Typ=1 Len=1: 111

112 Typ=1 Len=1: 112

113 Typ=1 Len=1: 113

114 Typ=1 Len=1: 114

115 Typ=1 Len=1: 115

116 Typ=1 Len=1: 116

117 Typ=1 Len=1: 117

118 Typ=1 Len=1: 118

119 Typ=1 Len=1: 119

120 Typ=1 Len=1: 120

121 Typ=1 Len=1: 121

122 Typ=1 Len=1: 122

123 Typ=1 Len=1: 123

124 Typ=1 Len=1: 124

125 Typ=1 Len=1: 125

126 Typ=1 Len=1: 126

127 Typ=1 Len=1: 127

128 Typ=1 Len=1: 128

129 Typ=1 Len=1: 129

130 Typ=1 Len=1: 130

131 Typ=1 Len=1: 131

132 Typ=1 Len=1: 132

133 Typ=1 Len=1: 133

134 Typ=1 Len=1: 134

135 Typ=1 Len=1: 135

136 Typ=1 Len=1: 136

137 Typ=1 Len=1: 137

138 Typ=1 Len=1: 138

139 Typ=1 Len=1: 139

140 Typ=1 Len=1: 140

141 Typ=1 Len=1: 141

142 Typ=1 Len=1: 142

143 Typ=1 Len=1: 143

144 Typ=1 Len=1: 144

145 Typ=1 Len=1: 145

146 Typ=1 Len=1: 146

147 Typ=1 Len=1: 147

Page 32: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

148 Typ=1 Len=1: 148

149 Typ=1 Len=1: 149

150 Typ=1 Len=1: 150

151 Typ=1 Len=1: 151

152 Typ=1 Len=1: 152

153 Typ=1 Len=1: 153

154 Typ=1 Len=1: 154

155 Typ=1 Len=1: 155

156 Typ=1 Len=1: 156

157 Typ=1 Len=1: 157

158 Typ=1 Len=1: 158

159 Typ=1 Len=1: 159

160 Typ=1 Len=1: 160

161 Typ=1 Len=1: 161

162 Typ=1 Len=1: 162

163 Typ=1 Len=1: 163

164 Typ=1 Len=1: 164

165 Typ=1 Len=1: 165

166 Typ=1 Len=1: 166

167 Typ=1 Len=1: 167

168 Typ=1 Len=1: 168

169 Typ=1 Len=1: 169

170 Typ=1 Len=1: 170

171 Typ=1 Len=1: 171

172 Typ=1 Len=1: 172

173 Typ=1 Len=1: 173

174 Typ=1 Len=1: 174

175 Typ=1 Len=1: 175

176 Typ=1 Len=1: 176

177 Typ=1 Len=1: 177

178 Typ=1 Len=1: 178

179 Typ=1 Len=1: 179

180 Typ=1 Len=1: 180

181 Typ=1 Len=1: 181

182 Typ=1 Len=1: 182

183 Typ=1 Len=1: 183

184 Typ=1 Len=1: 184

185 Typ=1 Len=1: 185

186 Typ=1 Len=1: 186

187 Typ=1 Len=1: 187

188 Typ=1 Len=1: 188

189 Typ=1 Len=1: 189

190 Typ=1 Len=1: 190

191 Typ=1 Len=1: 191

192 Typ=1 Len=1: 192

193 Typ=1 Len=1: 193

194 Typ=1 Len=1: 194

195 Typ=1 Len=1: 195

196 Typ=1 Len=1: 196

197 Typ=1 Len=1: 197

198 Typ=1 Len=1: 198

199 Typ=1 Len=1: 199

200 Typ=1 Len=1: 200

Page 33: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

201 Typ=1 Len=1: 201

202 Typ=1 Len=1: 202

203 Typ=1 Len=1: 203

204 Typ=1 Len=1: 204

205 Typ=1 Len=1: 205

206 Typ=1 Len=1: 206

207 Typ=1 Len=1: 207

208 Typ=1 Len=1: 208

209 Typ=1 Len=1: 209

210 Typ=1 Len=1: 210

211 Typ=1 Len=1: 211

212 Typ=1 Len=1: 212

213 Typ=1 Len=1: 213

214 Typ=1 Len=1: 214

215 Typ=1 Len=1: 215

216 Typ=1 Len=1: 216

217 Typ=1 Len=1: 217

218 Typ=1 Len=1: 218

219 Typ=1 Len=1: 219

220 Typ=1 Len=1: 220

221 Typ=1 Len=1: 221

222 Typ=1 Len=1: 222

223 Typ=1 Len=1: 223

224 Typ=1 Len=1: 224

225 Typ=1 Len=1: 225

226 Typ=1 Len=1: 226

227 Typ=1 Len=1: 227

228 Typ=1 Len=1: 228

229 Typ=1 Len=1: 229

230 Typ=1 Len=1: 230

231 Typ=1 Len=1: 231

232 Typ=1 Len=1: 232

233 Typ=1 Len=1: 233

234 Typ=1 Len=1: 234

235 Typ=1 Len=1: 235

236 Typ=1 Len=1: 236

237 Typ=1 Len=1: 237

238 Typ=1 Len=1: 238

239 Typ=1 Len=1: 239

240 Typ=1 Len=1: 240

241 Typ=1 Len=1: 241

242 Typ=1 Len=1: 242

243 Typ=1 Len=1: 243

244 Typ=1 Len=1: 244

245 Typ=1 Len=1: 245

246 Typ=1 Len=1: 246

247 Typ=1 Len=1: 247

248 Typ=1 Len=1: 248

249 Typ=1 Len=1: 249

250 Typ=1 Len=1: 250

251 Typ=1 Len=1: 251

252 Typ=1 Len=1: 252

253 Typ=1 Len=1: 253

Page 34: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

254 Typ=1 Len=1: 254

255 Typ=1 Len=1: 255

256 rows selected.

SQL>

We archive the current archive log:

SQL> alter system archive log current;

Then verify the data on the destination database (BMCTSTD):

SQL> col text for a30

SQL> set pagesize 260

SQL> select id, dump(text) text from test_table;

ID TEXT

---------- ------------------------------

0 Typ=1 Len=1: 0

1 Typ=1 Len=1: 1

2 Typ=1 Len=1: 2

3 Typ=1 Len=1: 3

4 Typ=1 Len=1: 4

5 Typ=1 Len=1: 5

6 Typ=1 Len=1: 6

7 Typ=1 Len=1: 7

8 Typ=1 Len=1: 8

9 Typ=1 Len=1: 9

10 Typ=1 Len=1: 10

11 Typ=1 Len=1: 11

12 Typ=1 Len=1: 12

13 Typ=1 Len=1: 13

14 Typ=1 Len=1: 14

15 Typ=1 Len=1: 15

16 Typ=1 Len=1: 16

17 Typ=1 Len=1: 17

18 Typ=1 Len=1: 18

19 Typ=1 Len=1: 19

20 Typ=1 Len=1: 20

21 Typ=1 Len=1: 21

22 Typ=1 Len=1: 22

23 Typ=1 Len=1: 23

24 Typ=1 Len=1: 24

25 Typ=1 Len=1: 25

26 Typ=1 Len=1: 26

27 Typ=1 Len=1: 27

28 Typ=1 Len=1: 28

29 Typ=1 Len=1: 29

30 Typ=1 Len=1: 30

31 Typ=1 Len=1: 31

32 Typ=1 Len=1: 32

33 Typ=1 Len=1: 33

Page 35: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

34 Typ=1 Len=1: 34

35 Typ=1 Len=1: 35

36 Typ=1 Len=1: 36

37 Typ=1 Len=1: 37

38 Typ=1 Len=1: 38

39 Typ=1 Len=1: 39

40 Typ=1 Len=1: 40

41 Typ=1 Len=1: 41

42 Typ=1 Len=1: 42

43 Typ=1 Len=1: 43

44 Typ=1 Len=1: 44

45 Typ=1 Len=1: 45

46 Typ=1 Len=1: 46

47 Typ=1 Len=1: 47

48 Typ=1 Len=1: 48

49 Typ=1 Len=1: 49

50 Typ=1 Len=1: 50

51 Typ=1 Len=1: 51

52 Typ=1 Len=1: 52

53 Typ=1 Len=1: 53

54 Typ=1 Len=1: 54

55 Typ=1 Len=1: 55

56 Typ=1 Len=1: 56

57 Typ=1 Len=1: 57

58 Typ=1 Len=1: 58

59 Typ=1 Len=1: 59

60 Typ=1 Len=1: 60

61 Typ=1 Len=1: 61

62 Typ=1 Len=1: 62

63 Typ=1 Len=1: 63

64 Typ=1 Len=1: 64

65 Typ=1 Len=1: 65

66 Typ=1 Len=1: 66

67 Typ=1 Len=1: 67

68 Typ=1 Len=1: 68

69 Typ=1 Len=1: 69

70 Typ=1 Len=1: 70

71 Typ=1 Len=1: 71

72 Typ=1 Len=1: 72

73 Typ=1 Len=1: 73

74 Typ=1 Len=1: 74

75 Typ=1 Len=1: 75

76 Typ=1 Len=1: 76

77 Typ=1 Len=1: 77

78 Typ=1 Len=1: 78

79 Typ=1 Len=1: 79

80 Typ=1 Len=1: 80

81 Typ=1 Len=1: 81

82 Typ=1 Len=1: 82

83 Typ=1 Len=1: 83

84 Typ=1 Len=1: 84

85 Typ=1 Len=1: 85

86 Typ=1 Len=1: 86

Page 36: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

87 Typ=1 Len=1: 87

88 Typ=1 Len=1: 88

89 Typ=1 Len=1: 89

90 Typ=1 Len=1: 90

91 Typ=1 Len=1: 91

92 Typ=1 Len=1: 92

93 Typ=1 Len=1: 93

94 Typ=1 Len=1: 94

95 Typ=1 Len=1: 95

96 Typ=1 Len=1: 96

97 Typ=1 Len=1: 97

98 Typ=1 Len=1: 98

99 Typ=1 Len=1: 99

100 Typ=1 Len=1: 100

101 Typ=1 Len=1: 101

102 Typ=1 Len=1: 102

103 Typ=1 Len=1: 103

104 Typ=1 Len=1: 104

105 Typ=1 Len=1: 105

106 Typ=1 Len=1: 106

107 Typ=1 Len=1: 107

108 Typ=1 Len=1: 108

109 Typ=1 Len=1: 109

110 Typ=1 Len=1: 110

111 Typ=1 Len=1: 111

112 Typ=1 Len=1: 112

113 Typ=1 Len=1: 113

114 Typ=1 Len=1: 114

115 Typ=1 Len=1: 115

116 Typ=1 Len=1: 116

117 Typ=1 Len=1: 117

118 Typ=1 Len=1: 118

119 Typ=1 Len=1: 119

120 Typ=1 Len=1: 120

121 Typ=1 Len=1: 121

122 Typ=1 Len=1: 122

123 Typ=1 Len=1: 123

124 Typ=1 Len=1: 124

125 Typ=1 Len=1: 125

126 Typ=1 Len=1: 126

127 Typ=1 Len=1: 127

128 Typ=1 Len=3: 226,130,172

129 Typ=1 Len=2: 194,129

130 Typ=1 Len=3: 226,128,154

131 Typ=1 Len=2: 198,146

132 Typ=1 Len=3: 226,128,158

133 Typ=1 Len=3: 226,128,166

134 Typ=1 Len=3: 226,128,160

135 Typ=1 Len=3: 226,128,161

136 Typ=1 Len=2: 203,134

137 Typ=1 Len=3: 226,128,176

138 Typ=1 Len=2: 197,160

139 Typ=1 Len=3: 226,128,185

Page 37: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

140 Typ=1 Len=2: 197,146

141 Typ=1 Len=2: 194,141

142 Typ=1 Len=2: 197,189

143 Typ=1 Len=2: 194,143

144 Typ=1 Len=2: 194,144

145 Typ=1 Len=3: 226,128,152

146 Typ=1 Len=3: 226,128,153

147 Typ=1 Len=3: 226,128,156

148 Typ=1 Len=3: 226,128,157

149 Typ=1 Len=3: 226,128,162

150 Typ=1 Len=3: 226,128,147

151 Typ=1 Len=3: 226,128,148

152 Typ=1 Len=2: 203,156

153 Typ=1 Len=3: 226,132,162

154 Typ=1 Len=2: 197,161

155 Typ=1 Len=3: 226,128,186

156 Typ=1 Len=2: 197,147

157 Typ=1 Len=2: 194,157

158 Typ=1 Len=2: 197,190

159 Typ=1 Len=2: 197,184

160 Typ=1 Len=2: 194,160

161 Typ=1 Len=2: 194,161

162 Typ=1 Len=2: 194,162

163 Typ=1 Len=2: 194,163

164 Typ=1 Len=2: 194,164

165 Typ=1 Len=2: 194,165

166 Typ=1 Len=2: 194,166

167 Typ=1 Len=2: 194,167

168 Typ=1 Len=2: 194,168

169 Typ=1 Len=2: 194,169

170 Typ=1 Len=2: 194,170

171 Typ=1 Len=2: 194,171

172 Typ=1 Len=2: 194,172

173 Typ=1 Len=2: 194,173

174 Typ=1 Len=2: 194,174

175 Typ=1 Len=2: 194,175

176 Typ=1 Len=2: 194,176

177 Typ=1 Len=2: 194,177

178 Typ=1 Len=2: 194,178

179 Typ=1 Len=2: 194,179

180 Typ=1 Len=2: 194,180

181 Typ=1 Len=2: 194,181

182 Typ=1 Len=2: 194,182

183 Typ=1 Len=2: 194,183

184 Typ=1 Len=2: 194,184

185 Typ=1 Len=2: 194,185

186 Typ=1 Len=2: 194,186

187 Typ=1 Len=2: 194,187

188 Typ=1 Len=2: 194,188

189 Typ=1 Len=2: 194,189

190 Typ=1 Len=2: 194,190

191 Typ=1 Len=2: 194,191

192 Typ=1 Len=2: 195,128

Page 38: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

193 Typ=1 Len=2: 195,129

194 Typ=1 Len=2: 195,130

195 Typ=1 Len=2: 195,131

196 Typ=1 Len=2: 195,132

197 Typ=1 Len=2: 195,133

198 Typ=1 Len=2: 195,134

199 Typ=1 Len=2: 195,135

200 Typ=1 Len=2: 195,136

201 Typ=1 Len=2: 195,137

202 Typ=1 Len=2: 195,138

203 Typ=1 Len=2: 195,139

204 Typ=1 Len=2: 195,140

205 Typ=1 Len=2: 195,141

206 Typ=1 Len=2: 195,142

207 Typ=1 Len=2: 195,143

208 Typ=1 Len=2: 195,144

209 Typ=1 Len=2: 195,145

210 Typ=1 Len=2: 195,146

211 Typ=1 Len=2: 195,147

212 Typ=1 Len=2: 195,148

213 Typ=1 Len=2: 195,149

214 Typ=1 Len=2: 195,150

215 Typ=1 Len=2: 195,151

216 Typ=1 Len=2: 195,152

217 Typ=1 Len=2: 195,153

218 Typ=1 Len=2: 195,154

219 Typ=1 Len=2: 195,155

220 Typ=1 Len=2: 195,156

221 Typ=1 Len=2: 195,157

222 Typ=1 Len=2: 195,158

223 Typ=1 Len=2: 195,159

224 Typ=1 Len=2: 195,160

225 Typ=1 Len=2: 195,161

226 Typ=1 Len=2: 195,162

227 Typ=1 Len=2: 195,163

228 Typ=1 Len=2: 195,164

229 Typ=1 Len=2: 195,165

230 Typ=1 Len=2: 195,166

231 Typ=1 Len=2: 195,167

232 Typ=1 Len=2: 195,168

233 Typ=1 Len=2: 195,169

234 Typ=1 Len=2: 195,170

235 Typ=1 Len=2: 195,171

236 Typ=1 Len=2: 195,172

237 Typ=1 Len=2: 195,173

238 Typ=1 Len=2: 195,174

239 Typ=1 Len=2: 195,175

240 Typ=1 Len=2: 195,176

241 Typ=1 Len=2: 195,177

242 Typ=1 Len=2: 195,178

243 Typ=1 Len=2: 195,179

244 Typ=1 Len=2: 195,180

245 Typ=1 Len=2: 195,181

Page 39: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

246 Typ=1 Len=2: 195,182

247 Typ=1 Len=2: 195,183

248 Typ=1 Len=2: 195,184

249 Typ=1 Len=2: 195,185

250 Typ=1 Len=2: 195,186

251 Typ=1 Len=2: 195,187

252 Typ=1 Len=2: 195,188

253 Typ=1 Len=2: 195,189

254 Typ=1 Len=2: 195,190

255 Typ=1 Len=2: 195,191

256 rows selected.

Scripts available: Unicode/scripts/BMCTSTD/verify_test_data.sh

3.15. Switching applications over to the new database

We restrict access to the primary database (BMCTSTS), waiting for all the changes to

be applied on the destination database (BMCTSTD). Once all the changes have been

applied, we grant access to the destination database. We use Oracle TAF for automated

application switchover.

3.16. Removing the Streams configuration

We remove the Streams configuration on the BMCTSTD database.

SQL> exec

dbms_streams_adm.remove_streams_configuration;

Page 40: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

4. Known issues and recommendations

4.1. Resizing the database prior to conversion

Conversion to the AL32UTF8 character set is likely to require additional space in the

tablespaces. So as not to interrupt the conversion process, you should resize the

database in advance based on the scan results.

4.2. Disabling the SHARED session mode

It is recommended that you use DMU in the DEDICATED session mode, as several

issues have been observed while using DMU in the SHARED session mode.

4.3. Enabling the Flashback database feature

It is useful to enable the Flashback database feature for large databases, as it allows for

the correction of any problems encountered during the conversion process without

requiring the restoration of the entire database from the start. You should ensure that the

Flashback recovery area is appropriately sized, so as to avoid DMU processes having to

wait for a ŖFlashback buf free by RVWŗ event.

4.4. Disabling automatic SGA management

It is recommended that you turn off automatic SGA management. This may be related

to bugs in version 10.2.0.4 which caused DMU to hang while waiting for a dynamic

SGA component resize.

Page 41: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

5. Documentation

Oracle® Database Migration Assistant for Unicode Guide Release 1

(E14853-01)

Online Database Maintenance with Streams http://download.oracle.com/docs/cd/B19306_01/server.102/b14229/ap_strmnt.htm#CIHJBIAA

Page 42: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

APPENDIX A

(Source: http://www.wikipedia.org/)

ISO/IEC 8859-1 (Oracle WE8ISO8859P1)

x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF

0x NUL

0 SOH

1 STX

2 ETX

3 EOT

4 ENQ

5 ACK

6 BEL

7 BS

8 TAB

9 LF

10 VT

11 FF

12 CR

13 SO

14 SI

15

1x DLE

16 DC1

17 DC2

18 DC3

19 DC4

20 NAK

21 SYN

22 ETB

23 CAN

24 EM

25 SUB

26 ESC

27 FS

28 GS

29 RS

30 US

31

2x SP

32 !

33 "

34 #

35 $

36 %

37 &

38 '

39 (

40 )

41 *

42 +

43 ,

44 -

45 .

46 /

47

3x 0

48 1

49 2

50 3

51 4

52 5

53 6

54 7

55 8

56 9

57 :

58 ;

59 <

60 =

61 >

62 ?

63

4x @

64 A

65 B

66 C

67 D

68 E

69 F

70 G

71 H

72 I

73 J

74 K

75 L

76 M

77 N

78 O

79

5x P

80 Q

81 R

82 S

83 T

84 U

85 V

86 W

87 X

88 Y

89 Z

90 [

91 \

92 ]

93 ^

94 _

95

6x `

96 a

97 b

98 c

99 d

100 e

101 f

102 g

103 h

104 i

105 j

106 k

107 l

108 m

109 n

110 o

111

7x p

112 q

113 r

114 s

115 t

116 u

117 v

118 w

119 x

120 y

121 z

122 {

123 |

124 }

125 ~

126 DEL

127

8x

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

9x

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

Ax NBSP

160 ¡

161 ¢

162 £

163 ¤

164 ¥

165 ¦

166 §

167 ¨

168 ©

169 ª

170 «

171 ¬

172 SHY

173 ®

174 ¯

175

Bx °

176 ±

177 ²

178 ³

179 ´

180 µ

181 ¶

182 ·

183 ¸

184 ¹

185 º

186 »

187 ¼

188 ½

189 ¾

190 ¿

191

Cx À

192 Á

193 Â

194 Ã

195 Ä

196 Å

197 Æ

198 Ç

199 È

200 É

201 Ê

202 Ë

203 Ì

204 Í

205 Î

206 Ï

207

Dx Ð

208 Ñ

209 Ò

210 Ó

211 Ô

212 Õ

213 Ö

214 ×

215 Ø

216 Ù

217 Ú

218 Û

219 Ü

220 Ý

221 Þ

222 ß

223

Ex à

224 á

225 â

226 ã

227 ä

228 å

229 æ

230 ç

231 è

232 é

233 ê

234 ë

235 ì

236 í

237 î

238 ï

239

Fx ð

240 ñ

241 ò

242 ó

243 ô

244 õ

245 ö

246 ÷

247 ø

248 ù

249 ú

250 û

251 ü

252 ý

253 þ

254 ÿ

255

Page 43: Near-Zero Downtime Database Character Set ... - Oracle · 9/30/2011  · 3. Converting the character set 3.1. Creating the primary database We create a BMCTSTS database (with NLS_CHARACTERSET=WE8ISO8859P1)

Windows-1252 (CP1252) (Oracle WE8MSWIN1252)

x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF

0x NUL

0 SOH

1 STX

2 ETX

3 EOT

4 ENQ

5 ACK

6 BEL

7 BS

8 TAB

9 LF

10 VT

11 FF

12 CR

13 SO

14 SI

15

1x DLE

16 DC1

17 DC2

18 DC3

19 DC4

20 NAK

21 SYN

22 ETB

23 CAN

24 EM

25 SUB

26 ESC

27 FS

28 GS

29 RS

30 US

31

2x SP

32 !

33 "

34 #

35 $

36 %

37 &

38 '

39 (

40 )

41 *

42 +

43 ,

44 -

45 .

46 /

47

3x 0

48 1

49 2

50 3

51 4

52 5

53 6

54 7

55 8

56 9

57 :

58 ;

59 <

60 =

61 >

62 ?

63

4x @

64 A

65 B

66 C

67 D

68 E

69 F

70 G

71 H

72 I

73 J

74 K

75 L

76 M

77 N

78 O

79

5x P

80 Q

81 R

82 S

83 T

84 U

85 V

86 W

87 X

88 Y

89 Z

90 [

91 \

92 ]

93 ^

94 _

95

6x `

96 a

97 b

98 c

99 d

100 e

101 f

102 g

103 h

104 i

105 j

106 k

107 l

108 m

109 n

110 o

111

7x p

112 q

113 r

114 s

115 t

116 u

117 v

118 w

119 x

120 y

121 z

122 {

123 |

124 }

125 ~

126 DEL

127

8x €

128

129 ‚

130 ƒ

131 „

132 …

133 †

134 ‡

135 ˆ

136 ‰

137 Š

138 ‹

139 Œ

140

141 Ţ

142

143

9x

144 Ř

145 ř

146 Ŗ

147 ŗ

148 •

149 Ŕ

150 ŕ

151 ˜

152 ™

153 š

154 ›

155 œ

156

157 ţ

158 Ÿ

159

Ax NBSP

160 ¡

161 ¢

162 £

163 ¤

164 ¥

165 ¦

166 §

167 ¨

168 ©

169 ª

170 «

171 ¬

172 SHY

173 ®

174 ¯

175

Bx °

176 ±

177 ²

178 ³

179 ´

180 µ

181 ¶

182 ·

183 ¸

184 ¹

185 º

186 »

187 ¼

188 ½

189 ¾

190 ¿

191

Cx À

192 Á

193 Â

194 Ã

195 Ä

196 Å

197 Æ

198 Ç

199 È

200 É

201 Ê

202 Ë

203 Ì

204 Í

205 Î

206 Ï

207

Dx Ð

208 Ñ

209 Ò

210 Ó

211 Ô

212 Õ

213 Ö

214 ×

215 Ø

216 Ù

217 Ú

218 Û

219 Ü

220 Ý

221 Þ

222 ß

223

Ex à

224 á

225 â

226 ã

227 ä

228 å

229 æ

230 ç

231 è

232 é

233 ê

234 ë

235 ì

236 í

237 î

238 ï

239

Fx ð

240 ñ

241 ò

242 ó

243 ô

244 õ

245 ö

246 ÷

247 ø

248 ù

249 ú

250 û

251 ü

252 ý

253 þ

254 ÿ

255