1. Current session is valid
alter session set nls_date_format= " yyyy-mm-dd:hh24:mi:ss " ;
2. Permanent entry into force
sys用户登入后运行例如以下命令 然后重新启动数据库使其生效
alter system set nls_date_format= " yyyy-mm-dd:hh24:mi:ss ' scope= spfile;
View sysdate format:
select * from V$nls_ Parameters where Parameter= Span style= "margin:0px; padding:0px; Color:rgb (255,0,0); Line-height:1.5!important ">" nls_date_format Span style= "margin:0px; padding:0px; Color:rgb (255,0,0); Line-height:1.5!important ">" ;
Note: scope=spfile
options
Oracle has an object called SPFile, which is a dynamic parameter file that sets the various parameters of Oracle. The so-called dynamic is that you can not shut down the database in the case,
Change database parameters and record them in SPFile. There are 4 scope options when changing the number of references. Scope is range
+ + Scope=spfile only changes the spfile inside the record, does not change the memory, namely does not immediately take effect, but waits for the next database to start to take effect. Some of the parameters only agree to change in such a way
Changing the format of the sysdate can only be done in this way.
+ + Scope=memory Only changes the memory, does not change the spfile. Which means that the next launch will expire.
+ + Scope=both memory and SPFile are changed
+ + does not specify a scope parameter, equivalent to Scope=both.
Temporarily and permanently change the default output format for Oracle Sysdate