Freitag, 6. Juni 2008

Script to create user

# user auf Ziel-Rechner anlegen, zB script in CYGWIN

-- user anlegen
sqlplus 'sys/lbsys as sysdba' <
-- drop user $1 cascade;

-- vielleicht datafile ' ' noetig?
CREATE TABLESPACE $1
LOGGING
DATAFILE 'd:\ORADATA\\DAT_$1_1.dbf' SIZE 500M AUTOEXTEND
ON NEXT 200M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO;
CREATE USER $1 PROFILE DEFAULT
IDENTIFIED BY $1 DEFAULT TABLESPACE $1
QUOTA UNLIMITED
ON $1
ACCOUNT UNLOCK;
GRANT ALTER SESSION TO $1;
GRANT CREATE PROCEDURE TO $1;
GRANT CREATE SEQUENCE TO $1;
GRANT CREATE TRIGGER TO $1;
GRANT CREATE TYPE TO $1;
GRANT CONNECT TO $1;

GRANT CREATE TABLE TO $1;
GRANT CREATE view TO $1;
GRANT CREATE synonym TO $1;

EOF

Keine Kommentare: