Jcat
宠辱不惊,闲看庭前花开花落~~
posts - 173,comments - 67,trackbacks - 0
--修改后重新启动数据库,永久生效
SQL> alter system set nls_date_format='yyyymmdd';
ERROR at line 1: --不能是memory scope(默认是both,所以也不行)
ORA-02096: specified initialization parameter is not modifiable with this option

SQL> alter system set nls_date_format='yyyymmdd' scope=spfile;
System altered.

SQL> show parameter nls_date_format  --这个时候还没生效
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
nls_date_format                      string

--重启数据库后
SQL> show parameter nls_date_format
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
nls_date_format                      string      yyyymmdd

SQL> select sysdate from dual;
SYSDATE
--------
20090627



--只对当前session有效,重登录一次SQLPLUS,效果就消失了
SQL> alter session set nls_date_format='yyyy-mm-dd';   --这个格式也很常用 yyyy-mm-dd hh:mi:ss
Session altered.  --同时会覆盖初始化参数里的设置

SQL> select sysdate from dual;
SYSDATE
----------
2009-06-27
posted on 2009-06-27 16:18 Jcat 阅读(669) 评论(0)  编辑  收藏 所属分类: Database

只有注册用户登录后才能发表评论。


网站导航: