

REM *=================================================================
REM *
REM *
REM * FILE:    init_check_db_user.sql
REM *
REM * PURPOSE: Erstellt den check_db user und die benötigten abfrage 
REM *          views mit den entsprechenden rechten. Der User check_db 
REM *          besitzt nur connect rechte.
REM *
REM * AUTHOR:  TRIVADIS AG, E.Sturzengger, 28-Dez-2000
REM *
REM *=================================================================

connect sys/change_on_install

create user check_db identified by simplepasswd --new password
default tablespace users                     --to avoid any writes to the system tablespace by the user check_db
temporary tablespace temp;                   --changed 16-Jan-2001 (gec)

grant connect to check_db;

create or replace view check_db_inst 
        (
        Host,
        Instance,
        StartupTime,
        Status,
        Logins
        )
as select
        HOST_NAME,
        INSTANCE_NAME,
        to_char(STARTUP_TIME, 'YYYY-MM-DD_HH24:MI:SS'),
        STATUS,
        LOGINS
from    v$instance;

create public synonym check_db_inst  for sys.check_db_inst;

grant select on check_db_inst to check_db;

REM check the check user installation
REM
REM
connect check_db/check_db
select * from check_db_inst;
