Temporarily and permanently change the default output format for Oracle Sysdate

Source: Internet
Author: User
Tags oracle sysdate

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.