Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: nls_date_format confusion, Still Confusing
Hi Thomas,
We are on SUN UNIX, 7.3.3.0 RDBMS. No clients. Just straight Server. I had set NLS_DATE_FORMAT in initMGSP.ora file to DD-MON-RR about 3 months ago and we stop and start the Oracle database instance every day.
Here are other facts:
NLS_LANG environment variable is not set.
~ 24% echo
~ 25% echo $NLS_LANG
NLS_LANG: Undefined variable.
~ 26%
Here are the initMGSP.ora parameters:
SURESH_at_MGSP>column name format a25 SURESH_at_MGSP>column value format a15 SURESH_at_MGSP>select name,value from v$parameter where upper(name) like'NLS_%';
NAME VALUE ------------------------- --------------- nls_language AMERICAN nls_territory AMERICA nls_sort nls_date_language nls_date_format DD-MON-RR nls_currency
8 rows selected.
Here are the NLS_DATE_FORMAT values for other parameters(?):
SURESH_at_MGSP>select value from nls_instance_parameters where
parameter='NLS_DATE_FORMAT';
__________________ To Quit, Type Ctrl-C __________________
VALUE
SURESH_at_MGSP>select value from nls_session_parameters where
parameter='NLS_DATE_FORMAT';
__________________ To Quit, Type Ctrl-C __________________
VALUE
SURESH_at_MGSP>select value from nls_database_parameters where
parameter='NLS_DATE_FORMAT';
__________________ To Quit, Type Ctrl-C __________________
VALUE
I would have expected NLS_DATE_FORMAT value in NLS_DATABASE_PARAMETERS to
be
DD-MON-RR not DD-MON-YY.
Where is DD-MON-YY coming from?
I read about NLS Language Support in Oracle 7 Server Administrator's Guide, Appendix C. It says that there are defaults for date formats etc. depending on the value of NLS_TERRITORY, but can be overridden by setting NLS_DATE_FORMAT in initialization file (which I thought I did in initMGSP.ora).
My conclusion is that I can change this parameter value for an INSTANCE( and consequently for all the sessions for this instance) such as MGSP but the DATABASE parameter value still remains the same as it was at the time of install which I believe is DD-MON-YY.
What are the implications of this if any?
Thanks if you or anyone else can shed some light on this.
Suresh
DBA
Mitchell Energy
Thomas Kyte <tkyte_at_us.oracle.com> wrote in article <378d1425.12681715_at_newshost.us.oracle.com>...
> A copy of this was sent to "DNA" <dna1_at_dnabbott.freeserve.co.uk> > (if that email address didn't require changing) > On Mon, 5 Jul 1999 20:57:00 +0100, you wrote: > > >Hi All, > >I am getting confused about the nls_date_format parameter. I set it to > >'DD-MON-YYYY' in the parameter file but when I look at the various nlsviews
> >I get the following for this parameter : > >nls_session_parameters : DD-MON-YY > >nls_instance_parameters : DD-MON-YYYY > >nls_database_parameters : DD-MON-YY > >v$parameter : DD-MON-YYYY > >I can understand the instance and parameter views but surely the session > >parameters should pick up the value when it connects to the database?Or am
> >I missing something? > >The database is 7.3.4 on NT4. > > > >Thanks! > > > > > If the client sets the NLS_* parameters -- they override the server inall
> specified on the client on used. > > Where that comes into play is typically if the client is windows and theserver
> teh database is) > > You have to set the NLS_DATE_FORMAT in the registry on the client > > or > > you need to put an "alter session set nls_date_format='yyyymmdd'" in yourapps
> right after the connect > > or > > with Oracle8i, release 8.1 you can code: > > > create or replace trigger data_logon_trigger > after logon > ON DATABASE > begin > execute immediate > 'alter session set nls_date_format = ''yyyymmdd'' '; > end; > / > > as well. > > > -- > See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in toOracle8i'...
> > Thomas Kyte tkyte_at_us.oracle.com > Oracle Service Industries Reston, VA USA > > Opinions are mine and do not necessarily reflect those of OracleCorporation
![]() |
![]() |