Feb 14, 2012 The database character set in oracle determines the set of characters can be stored in the database. It is also used to determine the character set to be used for object identifiers and PL/SQL variables and for storing PL/SQL program source. The database character set information is stored in the data dictionary tables named SYS.PROPS$. Feb 28, 2019 ORA-41400: Bind Character Set (1) Does Not Match Database Character Set (871) (Doc ID 1506516.1) Last updated on FEBRUARY 28, 2019. Applies to: Oracle Database - Enterprise Edition - Version 11.2.0.3 and later Oracle Database Cloud Schema Service - Version N/A and later Oracle Database Exadata Cloud Machine - Version N/A and later.
8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | 21c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux
Home » Articles » 12c » Here
In the previous release the character set for the root container and all pluggable databases associated with it had to be the same. This could limit the movement of PDBs and make consolidation difficult where a non-standard character set was required.
In Oracle Database 12c Release 2 (12.2) a PDB can use a different character set to the CDB, provided the character set of the CDB is AL32UTF8, which is now the default character set when using the Database Configuration Assistant (DBCA).
If you are using 12.2.0.1, make sure you've applied a patch for bug 25054064 (marked as fixed in 18.1) before doing anything serious with this feature. Thanks to Patrick Jolliffe for pointing this out.
Related articles.
Check the Destination CDB Character Set
Connect to the destination root container and run the following query to display the default character set of database.
We can see the default character set of the root container is AL32UTF8, which means it can hold PDBs with different character sets.
Create a Source CDB and PDB
First we must create a CDB with the WE8ISO8859P1 character set so we have a suitable source CDB and PDB. The following command creates a CDB called cdb3 with a PDB called pdb5
We make the source CDB use Oracle Managed Files (OMF) and switch it to archivelog mode.
Hot Clone the Source PDB
To prove we can house a database of a different character set in our destination CDB, we will be doing a hot clone. The setup required for this is described in the following article.
Once you've completed the setup, you can perform a regular hot clone. Connect to the destination CDB.
Clone the source PDB (pdb5) to create the destination PDB (pdb5new).
Open the PDB for the first time.
If you have any problems, check the PDB_PLUG_IN_VIOLATIONS
view. When I first wrote this article against an instance on Oracle Cloud I did not see any violations. On the on-prem 12.2.0.1 I see the following Unicode violation, but this doesn't stop the new PDB from working.
Check the Destination PDB
Compare the character set of the CDB and the new pluggable database.
We can see we have a pluggable database with a different character set to that of the root container.
Miscellaneous
- The root container must use to the AL32UTF8 character set if you need it to hold PDBs with differing character sets.
- The character set and national character set of an application container and all its application PDBs must match.
- New PDBs, cloned from the seed database, always match the CDB character set. There is no way to create a new PDB with a different character set directly. You can use Database Migration Assistant for Unicode (DMU) to convert the character set of a PDB.
- As seen in this article, cloning can be used to create a PDB with a different character set, as can unplug/plugin.
- LogMiner supports PDBs with different character sets compared to their CDB.
- Data Guard support PDBs with different character sets compared to their CDB for rolling upgrades.
For more information see:
Change Oracle Character Set
Hope this helps. Regards Tim...