Skip to Main Content
  • Questions
  • Where is alter session coming from? Every time I log in, I see "Session altered."

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question, Daniel.

Asked: July 05, 2018 - 5:52 pm UTC

Last updated: July 12, 2018 - 9:41 am UTC

Version: 12c R1

Viewed 1000+ times

You Asked

Every time I log in to our DB via sqlplus, I see this:

$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Jul 5 11:48:29 2018

Copyright (c) 1982, 2014, Oracle. All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options


Session altered.

SQL>

This statement is executed:

alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS''

The thing is - I don't know where is it being called from... It didn't used to be this way, until recently. I've asked around, nobody admitted setting it up, and not all databases alter session that way upon login...

Please help me to find where is this alter session set. :)

Thank you for your time.

and Connor said...

Look at SQLPATH as an environment variable or in your registry (for Windows).

When you login, you will run the "login.sql" script and the glogin.sql script. They may have been edited to run that command.

For example, here's how I use login.sql to customize my SQL Plus run time:

https://connor-mcdonald.com/2015/10/21/sqlplus-hints-and-tips/

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

It was glogin.sql

Daniel, July 09, 2018 - 5:39 pm UTC

Hello Connor,

Thank you for this suggestion. I knew about login.sql, I am using it since I saw Tom's post about using login.sql in order to display customized sqlplus prompt. The alter session wasn't in login.sql and I was unaware of glogin.sql. The alter session was in glogin.sql - now the mystery is solved :). Thank you for your time.

Daniel
Connor McDonald
July 12, 2018 - 9:41 am UTC

glad we could help

More to Explore

VLDB

If you are new to partitioning, check out Connor McDonald's introduction series here.

VLDB

Documentation set on VLDB and Partitioning.