对于Oracle Enterprise Manager中的所有工具,有一个配置文件名为dbappscfg.properties,修改该文件即可解决上述问题。这个文件的位置在$ORACLE_HOME\sysman\config目录下,用任何的文本编辑器打开该文件,在这个文件里面,找到这样一项, # SQLPLUS_NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1 去掉注释符#,同时将其修改为SQLPLUS_NLS_LANG=AMERICAN_AMERICA.ZHS16GBK。 对于Windows操作系统,还需要修改一项,在文件中找到# SQLPLUS_SYSTEMROOT=c:\\WINNT40,去掉注释符,将其修改为你所在机器的操作系统主目录。如操作系统的主目录在D盘的Winnt下,则将其修改为 SQLPLUS_SYSTEMROOT=d:\\WINNT。 对于后面一项的修改只对Windows操作系统进行,对UNIX操作系统则不需要。如果在Windows操作系统中不修改该项,在Oracle Enterprise Manager中,连接系统时,会提示如下的错误: ORA-12560 TNS:protocol adapter error 或者 ORA-12545 Connect failed because target host or object does not exist 修改完成后,保存文件,退出编辑。重新连接SQL PLUS Worksheet,字符集乱码问题得到解决,显示正确的简体中文字符集。
TO: chanet(牧师) , http://expert.csdn.net/Expert/topic/2346/2346226.xml?temp=.3075373 我按你的方法做,怎么不行呀!Oracle 9.0.1.0.1,# DBAPPS.CFG(修改后) # This property file defines the configuration information for OEM dbapps.# Lines starting with '#' are comments and are ignored. # Note that double back slash '\\' is needed to specify a back slash######################################################################## # Any property specified in this file with prefix "SQLPLUS_" will # be used by SQL*Plus Worksheet. Properties other than SQLPLUS_ENDOFBUFTOKEN # used as environment variables when worksheet envokes SQL*Plus process. # # SQLPLUS_ENDOFBUFTOKEN # SQL*Plus Worksheet will not be able to execute a sql command # if the command is not ended with proper sql terminator, normally ";". # By setting this token, see the default setting at the end of this file, # user of SQL*Plus Worksheet don't have to append the sql terminator # the end of the sql. (Due to a bug, this parameter doesn't work well # with SQL*Plus system variable "DEFINE". User can disable this token # by commenting it out.) # # Note: OEM 2.0.4 specific properties SQLPLUS_EXE_DIR and SQLPLUS_EXE_FILENAME # are obsoleted and will be ignored. # ################################################################################################################################################ # NLS issues: # If SQL*PLus runs in a language other than English, the following variables # may be needed. # SQLPLUS_NLS_LANG=AMERICAN_AMERICA.ZHS16GBK # # See also SQLPLUS_SYSTEMROOT if runs on NT. # ################################################################################################################################################ # NT specific configuration parameters for SQL*Plus Worksheet: # SQLPLUS_SYSTEMROOT=C:\\WINNT40 # # SQLPLUS_SYSTEMROOT is the SystemRoot environment variable on NT. # It is suggested to set this parameter if any additional variable # other than SQLPLUS_ENDOFBUFTOKEN is set. # ######################################################################## # # Template for Solaris installs -- this template file is # instantiated and installed by the SQL*Plus Worksheet install # (oracle.sysman.sqlplusworksheet.cmp) # # Parameters for both Win32 and Solaris: #SQLPLUS_ENDOFBUFTOKEN=OEM_sqlplus_input_finished# # # Parameters for Solaris only (These are not needed in OEM 2.1.0): # # SQLPLUS_LD_LIBRARY_PATH=D:\Oracle\lib # SQLPLUS_ORACLE_HOME=D:\Oracle SQLPLUS_SYSTEMROOT=C:\\WINNT
怎么样查看数据库字符集 [A]数据库服务器字符集select * from nls_database_parameters,其来源于props$,是表示数据库的字符集。 客户端字符集环境select * from nls_instance_parameter,其来源于v$parameter, 表示客户端的字符集的设置,可能是参数文件,环境变量或者是注册表 会话字符集环境 select * from nls_session_parameter,其来源于v$nls_parameters,表示会话自己的设置,可能是会话的环境变量或者是alter session完成,如果会话没有特殊的设置,将与nls_instance_parameter一致。 客户端的字符集要求与服务器一致,才能正确显示数据库的非Ascii字符。如果多个设置存在的时候,alter session>环境变量>注册表>参数文件 字符集要求一致,但是语言设置却可以不同,语言设置建议用英文。如字符集是zhs16gbk,则nls_lang可以是American_America.zhs16gbk。UPDATE SYS.PROPS$ SET VALUE$='ZHS16GBK' WHERE NAME LIKE 'NLS_CHAR%';
在$ORACLE_HOME\sysman\config目录下有一个配置文件名为dbappscfg.properties,找到这样一项,#SQLPLUS_NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
去掉注释符#,同时将其修改为SQLPLUS_NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
对于Windows操作系统,还需要修改一项,在文件中找到# SQLPLUS_SYSTEMROOT=c:\\WINNT40,去掉注释符,将其修改为你所在机器的操作系统主目录。如操作系统的主目录在D盘的Winnt下,则将其修改为 SQLPLUS_SYSTEMROOT=d:\\WINNT。
修改完成后,保存文件,退出编辑。重新连接SQL PLUS Worksheet,OK!
---------------------------------------------------------------
对于Oracle Enterprise Manager中的所有工具,有一个配置文件名为dbappscfg.properties,修改该文件即可解决上述问题。这个文件的位置在$ORACLE_HOME\sysman\config目录下,用任何的文本编辑器打开该文件,在这个文件里面,找到这样一项,
# SQLPLUS_NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
去掉注释符#,同时将其修改为SQLPLUS_NLS_LANG=AMERICAN_AMERICA.ZHS16GBK。
对于Windows操作系统,还需要修改一项,在文件中找到# SQLPLUS_SYSTEMROOT=c:\\WINNT40,去掉注释符,将其修改为你所在机器的操作系统主目录。如操作系统的主目录在D盘的Winnt下,则将其修改为 SQLPLUS_SYSTEMROOT=d:\\WINNT。
对于后面一项的修改只对Windows操作系统进行,对UNIX操作系统则不需要。如果在Windows操作系统中不修改该项,在Oracle Enterprise Manager中,连接系统时,会提示如下的错误:
ORA-12560 TNS:protocol adapter error
或者
ORA-12545 Connect failed because target host or object does not exist
修改完成后,保存文件,退出编辑。重新连接SQL PLUS Worksheet,字符集乱码问题得到解决,显示正确的简体中文字符集。
http://expert.csdn.net/Expert/topic/2346/2346226.xml?temp=.3075373
我按你的方法做,怎么不行呀!Oracle 9.0.1.0.1,# DBAPPS.CFG(修改后)
# This property file defines the configuration information for OEM dbapps.# Lines starting with '#' are comments and are ignored.
# Note that double back slash '\\' is needed to specify a back slash########################################################################
# Any property specified in this file with prefix "SQLPLUS_" will
# be used by SQL*Plus Worksheet. Properties other than SQLPLUS_ENDOFBUFTOKEN
# used as environment variables when worksheet envokes SQL*Plus process.
#
# SQLPLUS_ENDOFBUFTOKEN
# SQL*Plus Worksheet will not be able to execute a sql command
# if the command is not ended with proper sql terminator, normally ";".
# By setting this token, see the default setting at the end of this file,
# user of SQL*Plus Worksheet don't have to append the sql terminator
# the end of the sql. (Due to a bug, this parameter doesn't work well
# with SQL*Plus system variable "DEFINE". User can disable this token
# by commenting it out.)
#
# Note: OEM 2.0.4 specific properties SQLPLUS_EXE_DIR and SQLPLUS_EXE_FILENAME
# are obsoleted and will be ignored.
#
################################################################################################################################################
# NLS issues:
# If SQL*PLus runs in a language other than English, the following variables
# may be needed.
#
SQLPLUS_NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
#
# See also SQLPLUS_SYSTEMROOT if runs on NT.
#
################################################################################################################################################
# NT specific configuration parameters for SQL*Plus Worksheet:
#
SQLPLUS_SYSTEMROOT=C:\\WINNT40
#
# SQLPLUS_SYSTEMROOT is the SystemRoot environment variable on NT.
# It is suggested to set this parameter if any additional variable
# other than SQLPLUS_ENDOFBUFTOKEN is set.
#
########################################################################
#
# Template for Solaris installs -- this template file is
# instantiated and installed by the SQL*Plus Worksheet install
# (oracle.sysman.sqlplusworksheet.cmp)
#
# Parameters for both Win32 and Solaris:
#SQLPLUS_ENDOFBUFTOKEN=OEM_sqlplus_input_finished#
#
# Parameters for Solaris only (These are not needed in OEM 2.1.0):
#
# SQLPLUS_LD_LIBRARY_PATH=D:\Oracle\lib
# SQLPLUS_ORACLE_HOME=D:\Oracle
SQLPLUS_SYSTEMROOT=C:\\WINNT
[A]数据库服务器字符集select * from nls_database_parameters,其来源于props$,是表示数据库的字符集。
客户端字符集环境select * from nls_instance_parameter,其来源于v$parameter,
表示客户端的字符集的设置,可能是参数文件,环境变量或者是注册表
会话字符集环境 select * from nls_session_parameter,其来源于v$nls_parameters,表示会话自己的设置,可能是会话的环境变量或者是alter session完成,如果会话没有特殊的设置,将与nls_instance_parameter一致。
客户端的字符集要求与服务器一致,才能正确显示数据库的非Ascii字符。如果多个设置存在的时候,alter session>环境变量>注册表>参数文件
字符集要求一致,但是语言设置却可以不同,语言设置建议用英文。如字符集是zhs16gbk,则nls_lang可以是American_America.zhs16gbk。UPDATE SYS.PROPS$ SET VALUE$='ZHS16GBK' WHERE NAME LIKE 'NLS_CHAR%';