今天安装完Oracle 11g数据库后,用plsql连接数据库死活都连接不上。并且plsql客户端登录窗口的Database下拉框还为空。见下图:
喎�"/kf/ware/vc/" target="_blank" class="keylink">vcD4NCjxwPk9yYWNsZbf+zvG6zbzgzP3S0b6tv6rG9KOssqLH0rzssunBy8/gudi1xMXk1sO2vMO709DOyszioaM8L3A+DQo8cD6688C0yKXN+MnPy9HL98HLz8KjrLeiz9bT0MjLy7VwbHNxbLK7xNzWsb3Tway90zY0zrsgT3JhY2xlIDExZ8r9vt2/4qGj0vLOqnBsc3FsysczMs67tcSjrNKqz+vBrL3TNjTOu7XEyv2+3b/iu7nQ6NKqsLLXsNK7uPYzMs67tcRPcmFjbGW/zbuntsuho6GjvMe1w9LUx7DKudPDT3JhY2xlMTBnIMr9vt2/4rXEyrG68r7Nw7vT0NXiuPbKwrCho6zTw3Bsc3Fsvs2/ydLU1rG908GsvdPK/b7dv+KhozwvcD4NCjxociAvPg0KPHA+veK+9re9sLijujwvcD4NCjxociAvPg0KPHA+MaGiz8LU2E9yYWNsZb/Nu6e2y6O6aW5zdGFudGNsaWVudC1iYXNpYy13aW4zMi0xMS4yLjAuMS4wLnppcCAoteO798/C1NhPcmFjbGUzMs67v827p7bLo6mjrL2rxuS94tG51sFPcmFjbGWwstewxL/CvLXEUHJvZHVjdM/Co7o8L3A+DQo8cD5EOlxhcHBcTml1Tml1XHByb2R1Y3RcaW5zdGFudGNsaWVudF8xMV8yoaM8L3A+DQo8aHIgLz4NCjxwPjKhor+9sbTOxLz+o7q9q8r9vt2/4rCy17DEv8K8RDpcYXBwXE5pdU5pdVxwcm9kdWN0XDExLjIuMFxkYmhvbWVfMVxORVRXT1JLXEFETUlOIM/CtcR0bnNuYW1lcy5vcmHOxLz+v72xtLW9v827p7bLzsS8/rzQwO+hozwvcD4NCjxociAvPg0KPHA+M6GixeTWw1BMU1FMIERldmVsb3BlcqO6PC9wPg0KPHA+1NpUb29scy2ht3BlcmZlcmVuY2UtobdDb25uZWN0aW9uwO/D5sno1sNPcmFjbGVfSG9tZbrNT0NJIExpYnJhcnmjrMD9yOexvrv6yejWw86qo7o8L3A+DQo8cD5PcmFjbGUgSG9tZSCjukQ6XGFwcFxOaXVOaXVccHJvZHVjdFxpbnN0YW50Y2xpZW50XzExXzI8YnIgLz4NCk9DSSBMaWJyYXJ5IKO6RDpcYXBwXE5pdU5pdVxwcm9kdWN0XGluc3RhbnRjbGllbnRfMTFfMlxvY2kuZGxsPC9wPg0KPGNlbnRlcj4NCgk8aW1nIGFsdD0="这里写图片描述" src="/uploadfile/Collfiles/20150627/2015062709580825.png" title="" />
4、设置环境变量:
修改变量:在Path里添加:D:appNiuNiuproductinstantclient_11_2 ;
新建变量:名为”TNS_ADMIN”, 值为”D:appNiuNiuproductinstantclient_11_2;”
新建变量:名为”NLS_LANG”, 值为”SIMPLIFIED CHINESE_CHINA.ZHS16GBK”,
按以上步骤配置完毕后进行测试。(最好重新启动一下电脑)
登陆成功!
答疑解惑
为什么要配置”NLS_LANG”变量?
不添加这个变量,在使用数据库添加数据的时候,表格中的中文会变成乱码,这是因为咱们的数据库是64位的,而操作软件PLSQL_Developer是32位的。也就是说你用PLSQL_Developer编写的中文是符合32位的字符集,而数据库只能正确储存是64位的中文字符集,这导致了写和读不是一种字符集,最终导致中文变成问号或乱码。