13.connect A New DBA To The Database and Create Other Users That Access The Database Based On Your Use Case
13.connect A New DBA To The Database and Create Other Users That Access The Database Based On Your Use Case
13.connect A New DBA To The Database and Create Other Users That Access The Database Based On Your Use Case
Enter password:
Connected to:
Session altered.
Connected.
USER is "NEVA"
13.Connect a new DBA to the database and create other users that access the
database based on your use case.
Connected.
USER is "NEVA"
create user Biniam identified by biniam Default Tablespace Users Quota Unlimited On Users;
create user eyasu identified by eyasu Default Tablespace Users Quota Unlimited On Users;
create user dawit identified by dawit Default Tablespace Users Quota Unlimited On Users;
User EYASU created.
create user wuletaw identified by wuletaw Default Tablespace Users Quota Unlimited On Users;;
14.Create roles
create role accountant;
2 FAILED_LOGIN_ATTEMPTS 5
3 PASSWORD_LIFE_TIME 30
4 PASSWORD_REUSE_TIME 40
5 PASSWORD_REUSE_MAX 6
6 PASSWORD_VERIFY_FUNCTION verify_function
7 PASSWORD_LOCK_TIME 2/24
8 PASSWORD_GRACE_TIME 20;
Profile created.
16
SQL> grant create session, Alter Database, Create Pluggable Database, Create Table, Create Any
Table, Alter Any Table, Drop Any Table, Lock Any Table, Select Any Table, Insert Any Table,
Update any table,Create Role, Drop Any Role, Grant Any Role, Create User, Alter User, Drop
User,create any view, create any trigger to manager;
Grant succeeded.
SQL> grant create session,Create Table, select any table,create any view to customer;
Grant succeeded.
SQL> grant create session, create table, select any table, create view ,drop any table, update any
table to casher;
Grant succeeded.
17-
SQL> grant manager to Biniam ;
Grant succeeded.
SQL> grant casher to eyasu;
Grant succeeded.
SQL> grant accountant to dawit;
Grant succeeded.
SQL> grant customer to wuletaw;
Grant succeeded.
SQL> connect biniam/biniam@localhost:1521/bms;
Connected.
SQL> show user;
USER is "BINIAM"
18
SQL> create table manager(managerid int primary key,firstname varchar(20),lastname
varchar(30) not null,age int ,
2 gender varchar(6)not null,birthofdate varchar(30),salary float);
Table created.
SQL> ALTER USER biniam QUOTA UNLIMiTED ON USERS;
User altered.
insert into manager (manID,fname,lname,age,gender,salary) values(1,'abebe',
'alemu',20,'male',1200.0);
1 row inserted.
SQL> create table managerphone(phonenumber int not null primary key,
2 managerid int,
3 foreign key(managerid) references manager(managerid)on delete cascade);
Table created.
SQL> create table manageraddress( city varchar(30) primary key,region varchar(20));
Table created.
SQL> insert into anageraddress values('funote','amhara');
1 row inserted.
SQL> create table accountant(
2 accountantid varchar(20) not null primary key,
3 firstname varchar(20) not null,lastname varchar(30) not null,
4 age int,gender varchar(6)not null,birthofdate date,
5 salary float);
Table created.
SQL> create table accountant(accountantid varchar(20) not null primary key,firstname varchar(20) not
null,lastname varchar(30) not null,age int,gender varchar(6)not null,birthofdate varchar(37),salary float);
Table created.
1 row created.
2 accountantid varchar(20) ,
4 on delete cascade);
Table created.
insert into accountantphone values(0912345678, '33');
1 row created.
SQL> create table accountantaddress(city varchar(30) not null primary key,region varchar(20) not null);
Table created.
1 row created.
1 row created.
CITY REGION
------------------------------ --------------------
bahrdar amhra
bahredar amhra
SQL> create table customer(customerid varchar(25) not null primary key,firstname varchar(20)not
null,lastname varchar(30)not null,age int,gender varchar(8) not null,birthofdate varchar(565));
Table created.
1 row created.
2 customerid varchar(4) ,
1 row created.
SQL> create table customeraddress(city varchar(20) not null primary key,region varchar(20)not null);
Table created.
1 row created.
19
SQL> grant select,update,delete on manager to biniam with grant option;
Grant succeeded.
Grant succeeded.
Grant succeeded.
20