Oralce SQL *Plus in windows though not widely preferred interface doing database operation, still people use it ,especially beginners.But the problem with this interface is that even if you change the default  properties like linesize and pagesize ( which is very much required to set the right formatting the output SQL * Plus produces) to your preferred size for your convenience , it won't persists the change once you restart it. I saw many students including me getting frustrate issuing same command every time they start SQL*Plus.

Here is how you can set it.

Step 1: Locate the file glogin.sql in your oracle installation.

The glogin.sql is a file which executes while the SQL *Plus starts. And is located in $OracleHome/sqlplus/admin folder. In my case it is in C:\oracle\product\10.1.0\db_1\sqlplus\admin folder. You can issue your favorite sql command inside it which you want to execute when SQL *Plus starts


Step 2: Add your environment related sql query in this file.

Add the following lines of code in your glogin.sql file

set pagesize 100;
set linesize 100;

I have added the value 100 , which suits my need. You can have yours preferred size. You can even add any other sql query you want to.

Step 3: Save it and restart.

After saving the file you restart SQL *Plus, to see the effect.

This works in Windows Oracle 10.1.0 , try this even if you have different version or environment.

How to unlock scott user?

These are the steps

SQL> conn /as sysdba
SQL> alter user scott account unlock ;
User altered.
SQL> alter user scott identified by cat;
User altered.
SQL> conn scott/cat;

How to change password of user?

alter user user_name identified by password;

exa alter user system identified by mercury;