今天安裝完Oracle 11g數據庫後,用plsql連接數據庫死活都連接不上。並且plsql客戶端登錄窗口的Database下拉框還為空。見下圖:
<喎?http://www.Bkjia.com/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="http://www.bkjia.com/uploads/allimg/150630/04150RG2-1.png" title="\" />
4、設置環境變量:
修改變量:在Path裡添加:D:\app\NiuNiu\product\instantclient_11_2 ;
新建變量:名為”TNS_ADMIN”, 值為”D:\app\NiuNiu\product\instantclient_11_2;”
新建變量:名為”NLS_LANG”, 值為”SIMPLIFIED CHINESE_CHINA.ZHS16GBK”,
按以上步驟配置完畢後進行測試。(最好重新啟動一下電腦)
登陸成功!
答疑解惑
為什麼要配置”NLS_LANG”變量?
不添加這個變量,在使用數據庫添加數據的時候,表格中的中文會變成亂碼,這是因為咱們的數據庫是64位的,而操作軟件PLSQL_Developer是32位的。也就是說你用PLSQL_Developer編寫的中文是符合32位的字符集,而數據庫只能正確儲存是64位的中文字符集,這導致了寫和讀不是一種字符集,最終導致中文變成問號或亂碼。