Professional Documents
Culture Documents
Oracle Database
To implement upgrade of one of our applications, our team scheduled a period of
downtime to get oracle database (10.2.0.4)ready for it. What the DBA team is required is
to create a new oracle database which is identical to the production database. Thanks for
the downtime of production database, the steps to create identical database are quite
straightforward as below.
Once the target database is up, we are ready to implement character set conversion. The
following three oracle metalink documents are what we highly relied on to proceed.
Here, I would like to list step-by-step solution to finish the character set conversion.
The first thing to install CSSCAN is to connect database as sysdba and run script csminst.sql
($ORACLE_HOME/rdbms/admin).
If you experience error about no-existence of directory log_file_dir and data_file_dir, please ignore it
because granting read privilege to these two directories is removed.
And then, we need to make sure if CSSCAN is installed propermanticsly and ready for use. To check that,
simply issue the following OS command.
Before starting character set conversion, we need to do following pre-checking against database.
• Invalid objects
• Orphaned datqapump master tables (10g and up)
• Objects in the recyclebin (10g and up)
• Leftover temporary tables using CHAR semantics
Note that, please log on database with sysdba to proceed the followign steps.
1) Invalid objects
To check invalid objects in database, we need to Issue the following sql statement to check invalid objects
The above sql statement lists all of schemas which contains INVALID objects. These
invalid objects need to be compiled or dropped if they are unused. The simplest way to
compile all of objects within single schema is to use package UTL_RECOMP as
following.
If “no rows selected", please go proceed next step. Otherwise, check Note: 336014.1 How To
Cleanup Orphaned DataPump Jobs In DBA_DATAPUMP_JOBS ?.
If “no rows selected", please go proceed next step. Otherwise, check Note: 4157602.8
DBMS_STATS "ORA_TEMP_%_DS_%" temporary tables not cleaned up.
This is to check if all data is stored correctly in the current character set. Because the
TOCHAR and FROMCHAR character sets as the same there cannot be any
“Convertible” or “Truncation” data reported in dbcheck.txt. If all the data in the database
is stored correctly at the moment then there is only “Changeless” data reported in
dbcheck.txt.
If there is any “Lossy” data then those rows contain code points that are not currently
defined correctly and they should be cleared up before you can continue. The most
common situation is when having an US7ASCII/WE8ISO8859P1 database and “Lossy”,
in this case changing your US7ASCII/WE8ISO8859P1 SOURCE database to
WE8MSWIN1252 using Alter Database Character Set / Csalter will most likely solve you
lossy.
To perform character set conversion from WE8ISO8859P1 to WE8MSWIN1252, issue,
Step 4. Check for “Convertible” and “Truncation” data when going to UTF8
There should be NO entries under “Lossy” in toutf8.txt, because they should have been
filtered out in step 3, if there is “Lossy” data then please redo step 3.
[Scan Summary]
All character type data in the data dictionary are convertible to the new character set
All character type application data remain the same in the new character set
In above toutf8.txt, there are detailed list of application objects which we need to use export/import to deal
with. The sample list of this looks like:
Please note that only data dictionary and oracle schema could be safely converted to
target character set. Other application data, such as objects in schema WEBCT, need to
be converted by using export/import mechanism. The basic step is to do object export
backup, drop objects and do import these object after the character set conversion
is done.
Export these application objects and then drop them from database. Please note that “Do
NOT use Expdp/Impdp when going to (AL32)UTF8 or an other multibyte characterset on
ALL 10g versions lower then 10.2.0.4 (including 10.1.0.5).”
After all of application objects/data are dropped from database, please re-run csscan command in step 4 to
check if there is application object/data in toutf8.txt. If not, its ready for conversion by using CSALTER
package.
Function created.
Function created.
Procedure created.
This script will update the content of the Oracle Data Dictionary.
Please ensure you have a full backup before initiating this procedure.
Would you like to proceed (Y/N)?Y
old 6: if (UPPER(‘&conf’) <> ‘Y’) then
new 6: if (UPPER(‘Y’) <> ‘Y’) then
Checking data validility…
begin converting system objects
15541 rows in table SYS.WRH$_SQL_PLAN are converted
1129 rows in table SYS.WRH$_SQLTEXT are converted
80 rows in table SYS.METASTYLESHEET are converted
421 rows in table SYS.WRI$_ADV_ACTIONS are converted
19 rows in table SYS.WRI$_DBU_HWM_METADATA are converted
87 rows in table SYS.WRI$_DBU_FEATURE_METADATA are converted
4 rows in table SYS.RULE$ are converted
978 rows in table SYS.WRI$_ADV_OBJECTS are converted
117 rows in table SYS.WRI$_DBU_FEATURE_USAGE are converted
1 row in table SYS.SCHEDULER$_EVENT_LOG is converted
354 rows in table SYS.WRI$_ADV_RATIONALE are converted
0 rows deleted.
Function dropped.
Function dropped.
Procedure dropped.
While you start the importing job, you’ll find the screen output as following.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – 64bit
Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Its clear that importing application object/data will automatically finish character set conversion.
From my experience, successful importing of application object/data doesnt mean the conversion is done
completely. To be safe, its highly recommended to compare all of related schemas between source database
and target database to make sure that there is no object is missing in target database.
This entry was posted in Oracle Case Study, Oracle Point and tagged Case Study,
Character Set, Oracle. Bookmark the permalink.
← Duplicate Oracle Database with RMAN
嘉樾练习棒球-(20100429) →
Superb article, I discovered your website through Google. I bookmarked your site
for furture infomation, thanks.
Reply
2. louis vuitton mens wallets says:
It is clear to me that I must simply try to desist from that, at least partially.