In the process of data migration using Oracle Data Pump, because the source database character set is different from the target database character set, data import failure always occurs during the data import process;
1. Check the character set
select * from v$nls_parameters;
2. Modify the character set
SQL> conn /as sysdba
Connected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;
System altered.
SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
System altered.
SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0;
System altered.
SQL> alter database open;
Database altered.
SQL> ALTER DATABASE CHARACTER SET ZHS16GBK;
ALTER DATABASE CHARACTER SET ZHS16GBK
*
ERROR at line 1:
ORA-12712: new character set must be a superset of old character set
Prompt our character set: the new character set must be a superset of the old character set, then we can skip the superset check and make changes:
SQL> ALTER DATABASE character set INTERNAL_USE ZHS16GBK;
Database altered.
SQL> select * from v$nls_parameters;
Restart to check whether the change is complete:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> select * from v$nls_parameters;
3. Problems that may arise in the process:
- startup error ORA-00119 ORA-00132
found the Oracle sample ora file, mine is /home/oracle/app/oracle/product/11.2.0/dbhome_2/dbs/inithelowin.ora
and add in the file:
*.local_listener='(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=serverIP)(PORT=1521)))'
Start Oracle with pfile file:
startup pfile='/home/oracle/app/oracle/product/11.2.0/dbhome_2/dbs/inithelowin.ora'
Oracle startup results.
- Startup mount error, the same ORA-00119 ORA-00132
solution is the same as above.