Oracle更改字符集

时间:2023-08-01 21:50:38

更改oracle的字符集:

sqlplus / as sysdba
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 941600768 bytes
Fixed Size 1340440 bytes
Variable Size 692063208 bytes
Database Buffers 243269632 bytes
Redo Buffers 4927488 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 AL32UTF8;
ALTER DATABASE CHARACTER SET AL32UTF8
*
ERROR at line 1:
ORA-12712: new character set must be a superset of old character set
–提示新字符集必须为旧字符集的超集

SQL> ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8;

Database altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 941600768 bytes
Fixed Size 1340440 bytes
Variable Size 692063208 bytes
Database Buffers 243269632 bytes
Redo Buffers 4927488 bytes
Database mounted.
Database opened.

–查看字符集(Oracle数据库字符集的查询方案介绍

1、查询Oracle Server端的字符集:
select userenv('language') from dual;

2、如何查询dmp文件的字符集:

select nls_charset_name(to_number('0354','xxxx')) from dual;

3、查询Oracle client端的字符集:

$echo $NLS_LANG

Linux

scp命令:scp 需要传出的文件 对方接受的用户名@ip地址或主机名:对方的存储路径

scp ./*0328.dmp oracle@10.120.56.106:~/