Einfaches SQLPLUS-Script zum Anlegen von Usern

Vorherige Seite  Hauptseite  Nächste Seite Diese Seite drucken

Anbei ein Skript, welches Sie unter SQL*Plus, login SYS oder SYSTEM, verwenden können, um einen User/Schema für PLANOUT anzulegen.

 

 

Schema für PLANOUT

 

SET serveroutput ON

ACCEPT PLANOUT_SCHEMA_NAME PROMPT "Input PLANOUT_SCHEMA_NAME: ";

ACCEPT PLANOUT_SCHEMA_PASSWORD PROMPT "Input PLANOUT_SCHEMA_PASSWORD: ";

 

alter profile default limit password_life_time UNLIMITED;

drop user &PLANOUT_SCHEMA_NAME cascade;

-- Create the user

create user &PLANOUT_SCHEMA_NAME

 identified by &PLANOUT_SCHEMA_PASSWORD

 default tablespace USERS

 temporary tablespace TEMP

 profile DEFAULT;

-- Grant/Revoke role privileges

grant connect to &PLANOUT_SCHEMA_NAME;

grant resource to &PLANOUT_SCHEMA_NAME;

-- Grant/Revoke system privileges

grant create any view to &PLANOUT_SCHEMA_NAME;

grant create any synonym to &PLANOUT_SCHEMA_NAME;

grant manage scheduler to &PLANOUT_SCHEMA_NAME;

grant create job to &PLANOUT_SCHEMA_NAME;

 

 

Read only user

 

SET serveroutput ON

ACCEPT PLANOUT_SCHEMA_NAME PROMPT "Input PLANOUT_SCHEMA_NAME: ";

ACCEPT PLANOUT_SCHEMA_PASSWORD PROMPT "Input PLANOUT_SCHEMA_PASSWORD: ";

 

drop user &PLANOUT_SCHEMA_NAME cascade;

-- Create the user

create user &PLANOUT_SCHEMA_NAME

 identified by &PLANOUT_SCHEMA_PASSWORD

 default tablespace USERS

 temporary tablespace TEMP

 profile DEFAULT;

-- Grant/Revoke role privileges

grant connect to &PLANOUT_SCHEMA_NAME;