0% found this document useful (0 votes)
115 views

SQL

The document shows SQL commands used to create a user account, grant privileges to the user, and have the user connect and create a table. The user YASSINE already exists so a new user YASSINE2 is created instead. The YASSINE2 user is then granted connect and resource privileges and can now connect and create a table called Etudiants.

Uploaded by

yassine
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views

SQL

The document shows SQL commands used to create a user account, grant privileges to the user, and have the user connect and create a table. The user YASSINE already exists so a new user YASSINE2 is created instead. The YASSINE2 user is then granted connect and resource privileges and can now connect and create a table called Etudiants.

Uploaded by

yassine
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

SQL*Plus: Release 11.2.0.2.0 Production on Ven. Oct.

20 10:32:40 2017

Copyright (c) 1982, 2014, Oracle. All rights reserved.

SQL> connect system


Enter password:
Connected.
SQL> disc;
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit
Production
SQL> connect
Enter user-name: system
Enter password:
Connected.
SQL> create user YASSINE identified by YS;
create user YASSINE identified by YS
*
ERROR at line 1:
ORA-01920: user name 'YASSINE' conflicts with another user or role name

SQL> create user YASSINE2 identified by YS2;

User created.

SQL> select * from all_users;

USERNAME USER_ID CREATED


------------------------------ ---------- --------
XS$NULL 2147483638 29/05/14
YASSINE2 49 20/10/17
YASSINE 48 19/10/17
APEX_040000 47 29/05/14
APEX_PUBLIC_USER 45 29/05/14
FLOWS_FILES 44 29/05/14
HR 43 29/05/14
MDSYS 42 29/05/14
ANONYMOUS 35 29/05/14
XDB 34 29/05/14
CTXSYS 32 29/05/14

USERNAME USER_ID CREATED


------------------------------ ---------- --------
APPQOSSYS 30 29/05/14
DBSNMP 29 29/05/14
ORACLE_OCM 21 29/05/14
DIP 14 29/05/14
OUTLN 9 29/05/14
SYSTEM 5 29/05/14
SYS 0 29/05/14

18 rows selected.

SQL> disc;
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit
Production
SQL> connect YASSINE2/YS2;
ERROR:
ORA-01045: user YASSINE2 lacks CREATE SESSION privilege; logon denied

SQL> connect system


Enter password:
Connected.
SQL> grant connect,resource to YASSINE2;

Grant succeeded.

SQL> disconnect
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit
Production
SQL> connect YASSINE2/YS2
Connected.
SQL> create table Etudiants (Num number(6)primary key,
2 nom varchar(15) not null,
3 moy number(5,2));

Table created.

SQL> desc Etudiants;


Name Null? Type
----------------------------------------- -------- ----------------------------

NUM NOT NULL NUMBER(6)


NOM NOT NULL VARCHAR2(15)
MOY NUMBER(5,2)

SQL> select * from Etudiants;

no rows selected

SQL> insert into

You might also like