Está en la página 1de 5

SQL> conn SYSTEM/12345

Connected.
SQL> grant any table to moni;
grant any table to moni
*
ERROR at line 1:
ORA-00990: missing or invalid privilege

SQL> grant create any table to moni


2 ;
Grant succeeded.
SQL> disconn
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - Produ
ction
SQL> conn moni/12345
ERROR:
ORA-28001: the password has expired

Changing password for moni


Password changed
Connected.
SQL> create table cliente(
2 id number,
3 nombre varchar(30),
4 saldo numbre,
5 constrain pk_cl primary key(id));
constrain pk_cl primary key(id))
*
ERROR at line 5:
ORA-00907: missing right parenthesis

SQL> create table cliente(


2 id_cliente number,
3 nombre varchar(30),
4 saldo number,
5 constrain pk_cl primary key(id));
constrain pk_cl primary key(id))
*
ERROR at line 5:
ORA-00907: missing right parenthesis

SQL> create table cliente(


2 id_cliente number,
3 nombre varchar(30),
4 saldo number,
5 constrain pk_cl primary key(id_cliente));
constrain pk_cl primary key(id_cliente))
*
ERROR at line 5:
ORA-00907: missing right parenthesis

SQL> create table cliente(


2 id_cliente number,
3 nombre varchar(30),
4 saldo number,
5 constraint pk_cl primary key(id_cliente));
Table created.
SQL> create table ventas(
2 id_venta number,
3 fecha date,
4 id_cliente number,
5 cantidad number,
6 constraint pk_v primary key(id_venta),
7 constraint fk_v foreign key(id_cliente) references cliente (id_cliente));
Table created.
SQL> disconn
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - Produ
ction
SQL> conn
Enter user-name: system
Connected.
SQL> create tablespace tprueba1 datafile'tprueba1.dbf' size100M autoextend on ne
xt 10M maxsize 200M
2 ;
create tablespace tprueba1 datafile'tprueba1.dbf' size100M autoextend on next 10
M maxsize 200M
*
ERROR at line 1:
ORA-02180: invalid option for CREATE TABLESPACE

SQL> create tablespace tprueba1 datafile 'tprueba1.dbf' size100M autoextend on n


ext 10M maxsize 200M
2 ;
create tablespace tprueba1 datafile 'tprueba1.dbf' size100M autoextend on next 1
0M maxsize 200M
*
ERROR at line 1:
ORA-02180: invalid option for CREATE TABLESPACE

SQL> create tablespace tprueba1 datafile 'tprueba1.dbf' size100M autoextend on n


ext 10M maxsize 200M;
create tablespace tprueba1 datafile 'tprueba1.dbf' size100M autoextend on next 1
0M maxsize 200M
*
ERROR at line 1:
ORA-02180: invalid option for CREATE TABLESPACE

SQL> conn SYSTEM/12345


Connected.
SQL> create tablespace tprueba1 datafile 'tprueba1.dbf' size100M autoextend on n
ext 10M maxsize 200M;
create tablespace tprueba1 datafile 'tprueba1.dbf' size100M autoextend on next 1
0M maxsize 200M
*
ERROR at line 1:
ORA-02180: invalid option for CREATE TABLESPACE
SQL> create tablespace tprueba1 datafile 'tprueba1.dbf' size100M autoextend on n
ext 10M maxsize 200M;
create tablespace tprueba1 datafile 'tprueba1.dbf' size100M autoextend on next 1
0M maxsize 200M
*
ERROR at line 1:
ORA-02180: invalid option for CREATE TABLESPACE

SQL> create tablespace tprueba1 datafile 'tprueba1.dbf' size 100M autoextend on


next 10M maxsize 200M;
Tablespace created.
SQL> create user prueba1 identified by prueba1 default tablespace tprueba1 quota
50M on tprueba1 account unlock
2 ;
User created.
SQL> grant create session to prueba1;
Grant succeeded.
SQL> grant connect to pureba1;
grant connect to pureba1
*
ERROR at line 1:
ORA-01917: user or role 'PUREBA1' does not exist

SQL> grant connect to pruba1;


grant connect to pruba1
*
ERROR at line 1:
ORA-01917: user or role 'PRUBA1' does not exist

SQL> grant connect to prueba1;


Grant succeeded.
SQL> grant select,insert,update,delete on moni.cliente to prueba1;
Grant succeeded.
SQL> grant select,insert,update,delete on moni.ventas to prueba1;
Grant succeeded.
SQL> conn moni/12345
Connected.
SQL> insert into cliente values(1,'soni',200);
1 row created.
SQL> insert into cliente values(2,'charly',200);
1 row created.
SQL> insert into cliente values(3,'luis',200);
1 row created.
SQL> delete cliente(3,'luis',200);
delete cliente(3,'luis',200)
*
ERROR at line 1:
ORA-00933: SQL command not properly ended

SQL> insert into ventas values(3,'20-may-2017',1,200);


1 row created.
SQL> insert into ventas values(2,'19-may-2017',2,300);
1 row created.
SQL> insert into ventas values(1,'18-may-2017',3,50);
1 row created.
SQL> delete cliente (3) ;
delete cliente (3)
*
ERROR at line 1:
ORA-00933: SQL command not properly ended

SQL> delete cliente values(3) ;


delete cliente values(3)
*
ERROR at line 1:
ORA-00933: SQL command not properly ended

SQL> delete from ventas where id_cliente=1;


1 row deleted.
SQL> delete from cliente where id_cliente=1;
1 row deleted.
SQL> update cliente set nombre='soni' where nombre='lore';
0 rows updated.
SQL> select * from cliente;
ID_CLIENTE NOMBRE SALDO
---------- ------------------------------ ----------
2 charly 200
3 luis 200
SQL> update cliente set nombre='charly' where nombre='lore';
0 rows updated.
SQL> select * from cliente;
ID_CLIENTE NOMBRE SALDO
---------- ------------------------------ ----------
2 charly 200
3 luis 200
SQL> update cliente set nombre='lore' where nombre='lore';
0 rows updated.
SQL> select * from cliente;
ID_CLIENTE NOMBRE SALDO
---------- ------------------------------ ----------
2 charly 200
3 luis 200
SQL> update cliente set nombre='charly' where nombre='lore';
0 rows updated.
SQL> update cliente set nombre='lore' where nombre='charly';
1 row updated.
SQL> select * from cliente;
ID_CLIENTE NOMBRE SALDO
---------- ------------------------------ ----------
2 lore 200
3 luis 200
SQL> conn prueba1/prueba1
Connected.
SQL> select * from moni.cliente;
ID_CLIENTE NOMBRE SALDO
---------- ------------------------------ ----------
2 lore 200
3 luis 200
SQL> select * from moni.ventas;
ID_VENTA FECHA ID_CLIENTE CANTIDAD
---------- -------- ---------- ----------
2 19/05/17 2 300
1 18/05/17 3 50
SQL> SPOOL OFF;

También podría gustarte