Am i getting this wrongly?
SELECT SYS_CONTEXT ('USERENV', 'SESSION_USER') FROM DUAL; -- "same can be achieved by" SELECT user FROM DUAL; -- or by querying the dynamic view "V$SESSION"
Do you know what environment variables are and how to set them in your OS?Environment variables are stored in our OS. So does that mean the context variables are also stored and are again used even after the restart of the database?
CONTEXT variables serve a similar purpose. They are essentially 'environment' variables (name=value pairs) for your session. You can set them and used them.
But you can create a GLOBAL set of values that can be accessed by any session.With GLOBAL it is clear that it can be accessed across sessions, but is the variable/value present even after the database is restarted once?