Set Line width (number of columns)
SQL> set lin 250
Spooling to a file then viewing it
SQL> spool “test.txt”
SQL> select * from user_users;
USERNAME ……… deleted
SQL> spool off
SQL> ed test.txt
Shelling out to the host
SQL> host
In Windows launches a new DOS session. In Unix launches the shell
Formatting output from an SQL query
- useful for generating DQL on the back of an oracle query:
select ‘Name ‘ || object_name from dm_sysobject_s
Most importantly …
SQL>help set
Lists all the commands available to make presentation of information more pleasing to the eye.
Get tablespace sizes
select file_name, tablespace_name, bytes from dba_data_files;

