Home

Search this site:
 

Horshack’s
very
own site

 

This is Bavaria, Germany!
You will find links to Perl,
bootdisks for system administration,
a lot of Linux,
Windows administration
and some personal belongings.
Working with Oracle databases

Working with Oracle databases

Shutdown and Startup of Oracle 9

Svrmgrl is dead and superseeded by sqlplus /nolog. You can shutdown Oracle with a batchfile like this:

rem down.bat
sqlplus.exe /nolog @down.sql >down.log
The file down.sql looks like this:
connect sys/XXXXXXXXX@your_db_sid as sysdba
shutdown immediate
exit
To startup replace shutdown immediate with startup

SQLPlus output for human beings

Output in SQLPlus looks terrible and is nearly unreadable. This depends on the width of the columns. You can format you columns like this

set recsep off
set linesize 100
set newpage 0
set pagesize 999
column famname format a15
column rufname format a10
column gebdat format a10

select famname, rufname, gebdat, om from e01e001 where...

FAMNAME        RUFNAME    GEBDAT             OM
-------------- ---------- ---------- ----------
Lippmann       Richard    09.07.1966         12
Meier          Luise      01.01.1834         13
...

Select records with date functions

Select records younger than a week.
SQL> select count(*) from e01e903 where p_datum > (sysdate - 7);

COUNT(*)
--------
    3610
Select records older than a week.
SQL> select count(*) from e01e903 where p_datum < (sysdate - 7);

COUNT(*)
--------
  496810

Tools to explore a database

Impressum