查询系统时间:
[email protected]> select sysdate from dual;
SYSDATE
---------
30-APR-17
会话级别修改时间显示格式:
[email protected]> alter session set nls_date_format=‘yyyy-mm-dd hh24:mi:ss‘;
Session altered.
[email protected]> select sysdate from dual;
SYSDATE
-------------------
2017-04-30 23:43:14
在系统级别修改时间显示格式:
[email protected]> alter system set nls_date_format=‘yyyy-mm-dd hh24:mi:ss‘ scope=spfile;
System altered.
重启生效:
[email protected]> shutdown immediate;
[email protected]> startup
注:在系统级别修改时间显示格式,不加‘scope=spfile‘会报错:
[email protected]> alter system set nls_date_format=‘yyyy-mm-dd hh24:mi:ss‘;
alter system set nls_date_format=‘yyyy-mm-dd hh24:mi:ss‘
*
ERROR at line 1:
ORA-02096: specified initialization parameter is not modifiable with this
option
时间: 2024-12-26 20:14:00