oracle中如何修改NLS_DATE_LANGUAGE

发布时间:2021-11-09 11:24:05 作者:小新
来源:亿速云 阅读:599

这篇文章主要介绍oracle中如何修改NLS_DATE_LANGUAGE,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

一、 NLS_DATE_LANGUAGE

下面是临时修改nls_date_language参数为中文,以方便当前会话导入'08-12月-13 03.16.19.119000 下午'之类的数据。

报错ORA-01843: not a valid month解决

1、查看NLS_TIMESTAMP_FORMAT和NLS_DATE_LANGUAGE参数和SYSTIMESTAMP 数据格式

SQL> select * from v$nls_parameters;

PARAMETER                                                        VALUE

---------------------------------------------------------------- ----------------------------------------------------------------

NLS_LANGUAGE                                                     AMERICAN

NLS_TERRITORY                                                    AMERICA

NLS_CURRENCY                                                     $

NLS_ISO_CURRENCY                                                 AMERICA

NLS_NUMERIC_CHARACTERS                                           .,

NLS_CALENDAR                                                     GREGORIAN

NLS_DATE_FORMAT                                                  DD-MON-RR

NLS_DATE_LANGUAGE                                                AMERICAN

NLS_CHARACTERSET                                                 ZHS16GBK

NLS_SORT                                                         BINARY

NLS_TIME_FORMAT                                                  HH.MI.SSXFF AM

NLS_TIMESTAMP_FORMAT                                             DD-MON-RR HH.MI.SSXFF AM

NLS_TIME_TZ_FORMAT                                               HH.MI.SSXFF AM TZR

NLS_TIMESTAMP_TZ_FORMAT                                          DD-MON-RR HH.MI.SSXFF AM TZR

NLS_DUAL_CURRENCY                                                $

NLS_NCHAR_CHARACTERSET                                           AL16UTF16

NLS_COMP                                                         BINARY

NLS_LENGTH_SEMANTICS                                             BYTE

NLS_NCHAR_CONV_EXCP                                              FALSE

19 rows selected

SQL> SELECT SYSTIMESTAMP FROM DUAL;

SYSTIMESTAMP

--------------------------------------------------------------------------------

11-FEB-18 09.59.08.147761 AM +08:00

2、确定NLS_TIMESTAMP_FORMAT格式

如果参数NLS_TIMESTAMP_FORMAT格式不是DD-MON-RR HH.MI.SSXFF AM首先要调整该参数

     调整该参数的命令:alter session set NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH.MI.SS.FF8 AM';

    注:该命令只是当前会话有用。

3、确定NLS_DATE_LANGUAGE格式

查看NLS_DATE_LANGUAGE是SIMPLIFIED CHINESE还是AMERICA,如果是AMERICA需要修改成SIMPLIFIED CHINESE,

     才能显示中文上下午和月份,当前会话修改方法

SQL> ALTER SESSION SET nls_date_language='SIMPLIFIED CHINESE';

    注:该命令只是当前会话有用。

4、修改后参数

SQL> select * from v$nls_parameters;

/

PARAMETER                                                        VALUE

---------------------------------------------------------------- ----------------------------------------------------------------

NLS_LANGUAGE                                                     AMERICAN

NLS_TERRITORY                                                    AMERICA

NLS_CURRENCY                                                     $

NLS_ISO_CURRENCY                                                 AMERICA

NLS_NUMERIC_CHARACTERS                                           .,

NLS_CALENDAR                                                     GREGORIAN

NLS_DATE_FORMAT                                                  DD-MON-RR

NLS_DATE_LANGUAGE                                                SIMPLIFIED CHINESE

NLS_CHARACTERSET                                                 ZHS16GBK

NLS_SORT                                                         BINARY

NLS_TIME_FORMAT                                                  HH.MI.SSXFF AM

NLS_TIMESTAMP_FORMAT                                             DD-MON-RR HH.MI.SSXFF AM

NLS_TIME_TZ_FORMAT                                               HH.MI.SSXFF AM TZR

NLS_TIMESTAMP_TZ_FORMAT                                          DD-MON-RR HH.MI.SSXFF AM TZR

NLS_DUAL_CURRENCY                                                $

NLS_NCHAR_CHARACTERSET                                           AL16UTF16

NLS_COMP                                                         BINARY

NLS_LENGTH_SEMANTICS                                             BYTE

NLS_NCHAR_CONV_EXCP                                              FALSE

5、查看类型:

SQL> select systimestamp from dual;

/

SYSTIMESTAMP

--------------------------------------------------------------------------------

11-2月 -18 09.38.29.190818 上午 +08:00

6、导入数据:

SQL> @

Importing table SYS_AREA...

以上是“oracle中如何修改NLS_DATE_LANGUAGE”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!

推荐阅读:
  1. 修改oracle用户的密码
  2. oracle rac 修改private ip

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

oracle

上一篇:如何修改oracle数据库的db_name,instace_name,sid_name

下一篇:怎么实现PostgreSQL中的类型转换

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》