当前位置:网站首页>oracle修改数据库字符集
oracle修改数据库字符集
2022-07-02 06:32:00 【Axi-ZYTao】
1、修改数据库字符集,如果登录的客户端与服务器不在同一服务器,则建议两边字符集保持一致。
查看客户端字符集:
select * from v$nls_parameters

NLS_LANGUAGE #字体
NLS_TERRITORY #地区
NLS_CHARACTERSET #字符集
环境变量nls_lang便是由这三部分组成格式:字体 地区.字符集
比如:
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
查看服务器字符集:
select sys_context('userenv', 'language') from dual

2、修改客户端字符集
修改注册表,win+R,输入regedit,进入注册表;找到以下路径HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ORACLE\KEY_OraDb11g_home2
(注意:KEY_OraDb11g_home2与自己要修改的数据库对应)
找到NLS_LANG,
右键,修改数值数据,修改为客户端/服务器对应的字符集(用第一步方法查询);保存,关闭。
3、改服务器端字符集
进入oracle的sqlplus窗口,登录dba;
conn 用户名 as sysdba
依次输入以下指令:
shutdown immediate; #停止database
startup mount; #重开database
alter system enable restricted session;
alter system set job_queue_processes=0;
alter system set aq_tm_processes=0;
alter database open;
alter database character set utf8;
alter database character set internal_use utf8; #强制转换编码格式,有可能会导致数据库中的中文变成乱码
shutdown immediate;
>startup; #重启oracle
————————————————————————————————————
参考:
https://blog.csdn.net/laukicn/article/details/60962052
https://blog.csdn.net/chenwang2018/article/details/75051482
边栏推荐
猜你喜欢

C language custom type enumeration, Union (clever use of enumeration, calculation of union size)

Kubernetes deploys Loki logging system

Linux二进制安装Oracle Database 19c

Kubedm deploys kubernetes v1.23.5 cluster

MYSQL安装出现问题(The service already exists)

Data asset management function
![[blackmail virus data recovery] suffix Rook3 blackmail virus](/img/46/debc848d17767d021f3f41924cccfe.jpg)
[blackmail virus data recovery] suffix Rook3 blackmail virus

zipkin 简单使用

OpenShift 容器平台社区版 OKD 4.10.0部署

Don't spend money, spend an hour to build your own blog website
随机推荐
Openshift deployment application
Synchronize files using unison
汉诺塔问题的求解与分析
C#钉钉开发:取得所有员工通讯录和发送工作通知
Openshift container platform community okd 4.10.0 deployment
win10使用docker拉取redis镜像报错read-only file system: unknown
Sqli labs (post type injection)
OpenShift 部署应用
Select sort and insert sort
Application of kotlin - higher order function
Gocv boundary fill
查看was发布的应用程序的端口
Viewing JS array through V8
使用递归函数求解字符串的逆置问题
Image transformation, transpose
commands out of sync. did you run multiple statements at once
Web security -- core defense mechanism
Concise analysis of redis source code 11 - Main IO threads and redis 6.0 multi IO threads
libusb的使用
QT -- how to set shadow effect in QWidget