Converting to Unicode on Oracle Databases

This section discusses conversion to Unicode on an Oracle database.

Converting a PeopleSoft system on an Oracle database to Unicode may require creating a new Oracle instance with a Unicode character set. If your current database uses byte semantics (typical for PeopleSoft 8.9 applications or earlier), you must also create new column sizes for PeopleSoft columns created as VARCHAR2.

Note: The AL32UTF8 character set is the preferred character set for the Oracle database. However, the UTF8 character set is also supported.

Be sure to specify CHARACTER SET AL32UTF8 (or CHARACTER SET UTF8) at the end of the CREATE DATABASE command.

For more information on CREATE DATABASE syntax information:

See Oracle Database SQL Language Reference SQL Statements: CREATE CLUSTER to CREATE JAVA CREATE DATABASE

For small databases, the simplest way of converting a PeopleSoft database on Oracle to Unicode is to export the entire database using PeopleSoft Data Mover, create a new Oracle instance using a Unicode character set, and re-import the entire database using PeopleSoft Data Mover. The details of this process are not provided in this appendix.

For larger databases, a better process is to use PeopleSoft Data Mover to pre-build the structure of the PeopleSoft tables and then use Oracle Data Pump to move the bulk of the data between the old and new Oracle instances. The details of these processes are provided in this appendix.

The Oracle Database Migration Assistant for Unicode (DMU) is a migration tool that can implement character set migration without exporting and importing data. This method does not require creating a new Oracle instance with a Unicode character set, as it modifies the existing instance. You can use DMU instead of Data Mover for converting Oracle databases to Unicode. It is a simpler, faster utility that also provides a validation mode to identify any data that may have issues converting to Unicode.

If you are using the DMU tool for your database conversion, then you can skip to the detailed information on this utility in the section Converting to Unicode on Oracle Databases later in this topic, or else read the following sections on the other available methods to migrate Oracle databases to Unicode.

This section describes how to use PeopleSoft Data Mover to export the PeopleSoft database structure to a DAT file.

Note: This process exports the database table structure only and does not include the database contents.

Sign into the PeopleSoft database using PeopleSoft Data Mover in user mode(non-bootstrap mode), and run the following script.

SET NO TRACE;
SET OUTPUT output_file.dat;
SET NO DATA;
EXPORT *;

The DAT file created by PeopleSoft Data Mover will contain only the structure of your PeopleSoft tables and indexes, not the data.

Save the file created by this process. It will be referred to as the structural export in this appendix.

This section provides an overview of exporting database contents and discusses how to:

  • Set the NLS_LANG variable.

  • Export database contents using Oracle Data Pump.

  • Export database contents using the Oracle Export utility.

Setting the NLS_LANG Variable

Before running the export process, verify that the character set specified by NLS_LANG is set to match the character set of the database. NLS_LANG is an environment variable on Unix and a registry setting under HKEY_LOCAL_MACHINE\Software\Oracle on Microsoft Windows.

To verify the current character set of the Oracle database, sign in the Oracle SQL utility of your choice as the database administrator. Then, execute the following SQL statement:

SELECT VALUE FROM SYS.V_$NLS_PARAMETERS
WHERE PARAMETER ='NLS_CHARACTERSET';

For example, if the database character set is WE8ISO8859P1, NLS_LANG should be set to AMERICAN_AMERICA.WE8ISO8859P1, or another language combination with WE8ISO8859P1 as the character set.

Creating and Running the Export Preparation Script for Oracle Data Pump

  • Create a directory for the export file such as c:\temp\dmpdir

  • In a command prompt, set your Oracle SID

    set ORACLE_SID = <SID>
  • In SQL*Plus run three commands to specify your directory and grant permissions to the username you will use to run the export.

  • Sign into the Oracle SQL utility of your choice as the database administrator:

    sqlplus / as sysdba
  • Grant EXP_FULL_DATABASE to username;

  • Check for invalid objects with this command

    select object_name from dba_objects where status='INVALID';

    If any rows are returned, you may be able to fix them by running dbmsdb.sql and/or utlrp.sql. There should be no invalid rows before proceeding.

  • Quit sql plus.

The data export will specify two schemas: PS,and the ownerid specified in the PSSTATUS.OWNERID table.On the command line,run the expdp command:

expdp username/password@SID dumpfile=filename 
schemas=OWNERID,ps

For instance:

 expdp system/manager@HR  dumpfile=exp.dmp schemas=SYSADM,ps

At the end of the export, look for the final line such as :”Job 'OWNERID'.'SYS_EXPORT_SCHEMA_01' successfully completed.

The export dump file will appear in the dpdump directory under the admin\SID directory. To change the output directory refer to Oracle documentation on the directory parameter of expdp.

In case of errors, you can rerun and add the parameter trace =1FF0F00, to generate trace files.

Note: Ensure that the file system on which you will be creating the export file has sufficient space available to accommodate all the data in the PeopleSoft database. A good estimate of the space needed is to calculate the amount of space currently taken by tables owned by the PeopleSoft owner ID and add 20 percent. You can get this data from querying the DBA_FREE_SPACE and DBA_DATA_FILES catalog views. Remember that index data is not stored in export files, only the index definition.

The export (.dmp) file created by this process will be referred to as the database export in this document.

This section provides an overview of creating a new Oracle database instance and discusses how to:

  • Create the new Oracle database instance.

  • Pre-create objects in the new Oracle database instance.

Creating the new database instance involves creating the directories to hold the database, the init <SID>.ora file, and the tnsnames.ora file. On windows,the oradim command is used to start the instance such as.

oradim -new sid HR -intpwd manager -startmode auto -pfile 
C:\HR\initHR.ora

Sign into the Oracle SQL utility of your choice using the database administrator ID and password., run the startup nomount command such as this:

startup nomount pfile=c:\HR\initHR.ora

The first four are run as sysdba (for instance,sqlplus / as sysdba), and the others are run as the system user ( for instance, sqlplus system / manager).

Some of these scripts must be edited to contain the information specific to your database . Check the sizes of the DBF files in the xxDDL.sql script and ensure they will be large enough for the new database.

Understanding the New Oracle Database Instance

First, you must create a new Oracle instance with a Unicode encoding. This database will become the new PeopleSoft Unicode database.

This database must contain the same tablespaces as the original database, if one or more objects owned by the PeopleSoft owner ID were in those tablespaces.

For example, if the original database had 10 tablespaces, and PeopleSoft used five, you must create those five tablespaces with the same names (but not necessarily the same file paths) in the new Unicode instance.

Important! The AL32UTF8 character set is the preferred Unicode character set for the Oracle database.

When you create the new Oracle instance, be sure to specify CHARACTER SET AL32UTF8 (or CHARACTER SET UTF8) at the end of the CREATE DATABASE command.

For More Information on CREATE DATABASE sql command:

See Oracle Database SQL Language Reference SQL Statements: CREATE CLUSTER to CREATE JAVA CREATE DATABASE

Pre-Creating Objects in the New Oracle Database Instance

You must pre-create the following objects in the new Oracle database instance:

  • The SYSTEM tablespace (automatically created by the CREATE DATABASE command).

  • The PSTEMP tablespace.

  • Sufficient active rollback segments to complete the import. One segment must be large enough to contain the entire contents of the largest table for the import to succeed without incremental commits.

  • The same tablespaces as used by the PeopleSoft owner ID in the existing PeopleSoft database.

  • The PS user ID and the PSDBOWNER table. To create these, run the DBOWNER.SQL script provided with the PeopleSoft software. You must manually populate this table with a row for the PeopleSoft database you are moving to the new instance. Check the contents of the existing PS.PSDBOWNER table for a guide.

  • The PeopleSoft owner ID and connect ID with the same names as in the existing PeopleSoft database. You can create these IDs by running the PSROLES.SQL, PSADMIN.SQL and CONNECT.SQL scripts. See PeopleSoft 9.2 Application Installation for details on running these scripts at installation time.

  • Set up appropriate LISTENER.ORA and TNSNAMES.ORA entries for the new instance.

You must set the NLS_LENGTH_SEMANTICS=CHAR variable in your init.ora file after running connect.sql, and restart the database. The installation guide provides information on the use of these scripts and on setting this and other variables.

See PeopleSoft 9.2 Application Installation for Oracle.

Adding NLS_LENGTH_SEMANTICS=CHAR

For Apps 8.9 or later, make sure that NLS_LENGTH_SEMANTICS=CHAR is added to the init.ora file after running CONNECT.SQL and before running Data Mover.

Add to init.ora file if not there already: NLS_LENGTH_SEMANTICS=CHAR, and then restart the database. Check with this SQL:

select * from nls_database_parameters where parameter in 
('NLS_LENGTH_SEMANTICS','NLS_CHARACTERSET');

Assuming Apps 8.9 or later, the character set should be UTF8 or AL32UTF8, and the length semantics should be CHAR.

To create a new oracle database instance:

  • Create a directory in the filesystem in for the new database

  • Create init<SID>.ora file with appropriate paths and control file details

    Note: After database creation and before running Data Mover, you will add the entry NLS_LENGTH_SEMANTICS=CHAR to init.ora

  • Create directories bdump, cdump, and udump as specified in the init.ora file.

  • Set up appropriate LISTENER.ORA and TNSNAMES.ORA entries for the new instance.

Open Command Prompt and set the ORACLE_SID

set ORACLE_SID=HR

If on Windows, create the new service using oradim, for instance for a database named HR, and a system password of manager:

oradim -new -sid HR -intpwd manager -startmode auto -pfile C:\HR\initHR.ora

Sign into the Oracle SQL utility of your choice using the database administrator ID and password.

Open each sql file from PS_HOME\scripts\nt folder and edit the file to add necessary parameters and execute the sql in sqlplus.

The scripts are located in the PS_HOME\scripts\nt directory.

Script

Location

CREATEDB10.SQL

PS_HOME\scripts\nt\createdb10.sql;

UTLSPACE.SQL

PS_HOME\scripts\nt\utlspace.sql;

DBOWNER.SQL

PS_HOME\scripts\nt\dbowner.sql;

xxDDL.SQL

Tablespace size defaults may need to be increased in the script.

PS_HOME\scripts\nt\ptddl.sql;

xxDDL.SQL (for app example HCDDL.SQL) – Tablespace size defaults may need to be increased in the script.

PS_HOME\scripts\nt\hcddl.sql;

PSROLES.SQL

PS_HOME\scripts\nt\psroles.sql;

PSADMIN.SQL

PS_HOME\scripts\nt\psadmin.sql;

Examples at prompts: SYSADM, SYSADM, PSDEFAULT

CONNECT.SQL

PS_HOME\scripts\nt\connect.sql;

After running connect.sql, edit your init.ora file and add the parameter NLS_LENGTH_SEMANTICS=CHAR and restart the database.

For more information on scripts:

See the product documentation for PeopleSoft 9.2 Application Installation for Oracle.

Sign on to the newly created Oracle database with PeopleSoft Data Mover in bootstrap mode using the database administrator ID and password.

Once signed in, execute the following Data Mover script, substituting output_file with the name of the structural export file you created in PeopleSoft Data Mover previously:

SET NO TRACE;
SET NO DATA;
SET INPUT output_file;
SET LOG log_file;
SET UNICODE ON;
SET STATISTICS OFF;
SET ENABLED_DATATYPE 9.0;
IMPORT *;

This script creates all the tables in the original PeopleSoft database in the new database but with no rows of data. You can speed up the data load time by adding the command SET NO INDEX; If you do that, remember to create them in Application Designer later.

Note: The ENABLED_DATATYPE 9.0 command applies only if the PeopleSoft application version is 9.0 or higher. With this flag set, the VARCHAR2 columns will use character semantics instead of byte semantics..The ENABLED_DATATYPE command is related to the NLS_CHARACTER_SEMANTICS setting in the init.ora file. The NLS_CHARACTER_SEMANTICS is not set at the beginning of database creation, but is added to the init.ora file before connecting to Data Mover.

To check the effect of these parameters after the structural import, in sqlplus run the command desc PSSTATUS and verify that the CHAR fields are defined as VARCHAR2(n CHAR) rather than VARCHAR2 (nx3).

This section provides an overview of importing database contents and discusses how to:

  • Clear the NLS_LANG variable.

  • Import database contents using Oracle Data Pump.

  • Create an import parameter file for the Oracle Import utility.

  • Run the Oracle Import utility.

  • Rebuild PeopleSoft temporary tables.

Understanding Importing Database Contents Using the Oracle Data Pump Utility

Once the PeopleSoft tables have been pre-created by PeopleSoft Data Mover, you are ready to import the database export using Oracle Data Pump (impdp).

Important! Ensure that you follow only the instructions for the pair of utilities that you have chosen to use.

Clearing the NLS_LANG Variable

Before running the Oracle import process, clear the NLS_LANG environment variable (Unix) or remove the NLS_LANG registry setting (Microsoft Windows). Doing so ensures that the Oracle import process reads the character set information from the export file and performs the appropriate conversion to the database’s selected Unicode character set.

Importing Database Contents Using Oracle Data Pump

In a command prompt, set your new Oracle SID

Set ORACLE_SID=<SID>

Sign into the Oracle SQL utility of your choice using the database administrator ID and password. Grant permissions to the username you will use to run the import.

 sqlplus / as sysdba
  1. Grant IMP_FULL_DATABASE to username;

  2. Quit SQLPlus.

On the command line, run the impdp command.

impdp username/password@SID dumpfile=filename schemas=OWNERID,ps content=data_only For instance:

impdp system/manager@HR dumpfile=exp.dmp schemas=SYSADM,ps content=data_only

Look for: Job "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully completed.

In case of errors, you can rerun and add the parameter trace=1FF0F00, to generate trace files. One common error is running out of space in a tablespace, due to setting it too small in the xxDDL.SQL scripts. To fix this, use a command like the following:

alter database datafile 'filename.DBF'resize new_size;

Ensure that the import completes successfully with no errors before continuing.

Rebuilding PeopleSoft Temporary Tables

After you import the database, you must rebuild the temporary tables. To rebuild the temporary tables, sign into PeopleSoft Data Mover in user mode (non-bootstrap mode), and run the following command:

CREATE_TEMP_TABLE *

Building Indexes

If you included the SET INDEXES OFF line of the Data Mover import, you need to build the indexes. Log into Application Designer and create a project called ALLRECORDS, and insert all record definitions into the project. Build the project to build the indexes defined for the records.

When the import has completed successfully, you must specify in your PeopleSoft system that the database is now a Unicode database. To do this, sign into the Oracle SQL utility of your choice using the database owner ID. Run the following SQL statement:

UPDATE PSSTATUS SET UNICODE_ENABLED=1;

Note: You must set the PSSTATUS field of UNICODE_ENABLED to 1 for all Unicode databases and 0 for all Non-Unicode databases.

Since you set ENABLED_DATATYPE previously, you also need to specify that the database uses Oracle CLOB and BLOB fields, as follows:

UPDATE PSSTATUS SET DATABASE_OPTIONS=34;

Before signing into the new PeopleSoft Unicode database, edit the GRANT.SQLscript (provided in your PeopleTools installation in the scripts directory) to include the connect ID you created previously. Then, run GRANT.SQL to set up the appropriate grants to the connect ID.

Sign into the Oracle SQL utility of your choice using the database administrator ID and password. Run the GRANT.SQL script.

You should now be able to configure your connection with Configuration Manager, and log in with Application Designer. It is recommended to check the database integrity by running the SQR audits DDDAUDIT and SYSAUDIT.

When the PSSTATUS table is imported from a non-Unicode export file, the UNICODE_ENABLED flag is 0.

Therefore, before re-running any PeopleSoft Data Mover imports, or any time PSSTATUS is re-imported from a non-Unicode export file, set the UNICODE_ENABLED flag to 1.

If your database supports it, you can convert your databases to Unicode using Database Migration Assistant for Unicode (DMU). It is a faster method than exporting and importing the non-Unicode files. You will need a minimum Apps version of 9.0, Tools version of 8.48, and DMU version of 2.1.2 or later.

Note: A user with SYSDBA privilege, such as SYS can connect the DMU client to the database.

The database will need the PL/SQL package prvtdumi.plb, for instance:

sqlplus / as sysdba

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

Note: Java SE Development Kit (JDK) is required to run the DMU client. The main DMU documentation has details of the JDK.

To convert the database in Unicode using DMU:

  1. Verify the configuration requirements for DMU and install the required patches.

    1. Verify if the database and the operating system supports the current DMU release.

    2. Check for any restrictions for the databases to be migrated in the DMU Release Notes.

    3. Install required database patch. You can download the patch from My Oracle Support.

    4. Install the PL/SQL package in the database.

    5. Install Oracle XML DB component (XDB) in your database.

      Note: You can check if a valid XDB is installed in your system. To check, enter following in the command prompt:

      select comp_id, status from dba_registry;

      If you do not have XDB then to install XDB, enter the following in the command prompt:

      run catqm.sql, for instance as catqm.sql xdb SYSAUX TEMP NO.

  2. Setup the client for DMU and connect to the database:

    1. Install the JDK version required for the DMU version.

      Note: Make a note of the directory where you installed JDK. You will need to provide the path to it in the DMU.

    2. Install the DMU software from Oracle Technology Network download page.

    3. Start the DMU. When you start the DMU for the first time, it asks for the JDK installation directory.

    4. Create a database connection. Enter user Id, password and the network connection data of the database administrator; the target database host name, the TNS listener port, and the database service name. The user must have the SYSDBA privilege in the database.

      Note: Before connecting to the DMU client, grant SYSDBA privilege to your user using a password file from orapwd utility.

      For Windows, this file must be named ORACLE_HOME\database\PWD<ORACLE_SID>.ora, and for Unix this file must be named ORACLE_HOME/dbs/orapw<ORACLE_SID>.

  3. Run the Unicode migration in DMU:

    1. Install the DMU repository.

      Note: DMU will prompt you to update the NLS_LENGTH_SEMANTICS in init.ora at the end of the conversion.

    2. Start the migration process of the database to Unicode. The utility guides you through the three steps to Scan, Cleanse, and Convert.

    3. Validate that the character set in the database is in Unicode.

  4. Set NLS_LENGTH_SEMANTICS=CHAR in your init.ora and restart your database. PeopleSoft Unicode databases use character length semantics.

  5. Run Audit:

    Run the audits such as DDDAUDIT, SYSAUDIT, and an Alter Audit.

    Note: With DMU versions before 2.1.2, any tables reported in the alter audit should be rebuilt in Application Designer to ensure that fields defined as LONG are implemented as CLOB when needed. With DMU 2.1.2 and later, the alter audit should show that no changes are needed.

If you use the DMU method, you don’t need to rebuild tables and indexes, or do imports, unless tables are reported in the alter audit. After the migration, the character set will be AL32UTF8, and the VARCHAR2 columns lengths will specify the number of characters instead of the number of bytes. For instance “descr psmsgcatlang” will show that message_text is varchar2(100 char).

This method is also documented for PeopleTools 8.48 and above. You can access the document from My Oracle Support, Document ID: 1627714.1.

For more information on the Oracle Database Migration Assistant for Unicode on supported configuration, DMU documentation, and accessing DMU client for download, go to the Oracle Technology Network.