ora-00604錯誤解決
今天早上一到公司,就遇到這個問題。剛開始沒有頭緒,搞的一頭霧水,最後在經過itpub上yueyangflash的指點,問題終於解決。
一、故障現象
1. 10.87.56.221伺服器裝的是oracle 9i的客戶端。連線資料庫的時候報錯:
SQL> conn test/test@test
ERROR:
ORA-00604: error occurred at recursive SQL level 1
ORA-02248: invalid option for ALTER SESSION
而其他客戶端連線同樣的庫,就沒有問題。
如果用SYS使用者連,就報說連到空閒例項,而不報00604錯誤。
二、問題分析
1. 懷疑是glogin.sql檔案被修改,或者環境變數設定出問題。
2. 在metalink上解釋說:
Applies to:
Oracle Server - Enterprise Edition - Version: 9.2.0.1 to 10.2.0.4
This problem can occur on any platform.
Symptoms
On certain Windows client :
connection using sqlplus giving the following error :
ORA-00604: error occurred at recursive SQL level 1
ORA-02248: invalid option for ALTER SESSION
Cause
environment variable NLS_* was set between two quotas .
For example :
NLS_DATE_FORMAT= 'YYYY/MM/DD' this should be YYYY/MM/DD
D:\oracle\product\10.2.0\db_1\BIN>set NLS_DATE_FORMAT= 'YYYY/MM/DD'
D:\oracle\product\10.2.0\db_1\BIN>sqlplus system/sys
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Sep 23 13:17:12 2008
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
ERROR:
ORA-00604: error occurred at recursive SQL level 1
ORA-02248: invalid option for ALTER SESSION
Solution
set the environment variable without any quotas
三、解決問題
1. 檢查客戶端的壞境變數,發現NLS_DATE_FORMAT變數確實設定的有問題。變數值中間多了個冒號“:”
NLS_DATE_FORMAT=YYYY/MM/DD:HH24:MI:SS。
2. 改變設定
去掉冒號,問題解決。變數NLS_DATE_FORMAT的值不能加引號或其他東西,直接為: YYYY/MM/DD HH24:MI:SS即可。
四、 總結
1. 原因是有個同事覺得查詢時間欄位時,每次都需要新增to_data()函式,所以想透過設定環境變數來省事,沒想到變數沒設對,還引起了一個小小的故障。
2. 客戶端新增NLS_DATE_FORMAT變數查詢時間欄位時確實很方便,不過所有涉及到oracle資料庫的變數,一定要小心,否則可能造成很嚴重的後果。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/751371/viewspace-617144/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Ocelot錯誤解決
- standby上增加tempfile報錯ORA-00604,ORA-16000解決方法
- 解決 Python UnicodeEncodeError 錯誤PythonUnicodeError
- 華納雲:資料庫出現ORA-00604報錯怎麼解決資料庫
- dbfread報錯ValueError錯誤解決方法Error
- PbootCMS 404 錯誤解決方法boot
- Linux下錯誤解決方案Linux
- latex 錯誤以及解決方案
- HTTP 錯誤 500.19- Internal Server Error 錯誤解決方法HTTPServerError
- steam磁碟寫入錯誤怎麼解決 steam磁碟寫入錯誤解決方法大全
- undefined reference to錯誤的解決方法Undefined
- Cocopods的升級錯誤解決
- ORA-12005 錯誤的解決
- SAXParseException的錯誤解決之二Exception
- ORA-28000錯誤解決方案
- dedecms提示500錯誤解決方法
- PHP curl error 60 錯誤解決PHPError
- linux解決“XXX is not in the sudoers file”錯誤Linux
- 解決java.lang.NoSuchMethodError錯誤JavaError
- HTTP代理錯誤怎麼解決?HTTP
- TCP網路除錯助手提示錯誤:“1035:未知錯誤” 解決方案TCP除錯
- 解決MySQL server has gone away錯誤的解決方案MySqlServerGo
- Go:錯誤 could not launch process: EOF 解決Go
- 畢設之錯誤解決辦法
- 解決 ngrok 的 Domain 錯誤問題AI
- 錯誤解決:Attempting to use uninitialized value VariableZed
- Ubuntu Cannot allocate memory 錯誤解決方案Ubuntu
- Qt報Multiple definition錯誤的解決QT
- Excel匯入null錯誤解決方式ExcelNull
- 代理508限制錯誤怎麼解決?
- Hadoop常見錯誤及解決方案Hadoop
- Idea編譯錯誤解決辦法Idea編譯
- 錯誤720寬頻連線解決辦法 寬頻連線錯誤程式碼720怎麼解決
- 解決ubuntu系統“XXX is not in the sudoers file”錯誤Ubuntu
- ubuntu下import matplotlib錯誤解決辦法UbuntuImport
- HTTP 錯誤 500.21 - Internal Server Error 解決方案HTTPServerError
- SyntaxError: EOL while scanning string literal錯誤解決ErrorWhile
- 解決 eslint 的 Parsing error: Unexpected token 錯誤EsLintError
- Mac上搭建chromedriver的錯誤解決方法MacChrome