sql_9.txt

(1 KB) Pobierz
drop table testy;
create table testy 
(id number primary key,
nazwa varchar(10) )
partition by hash (id)
(partition p1,
partition p2,
partition p3
);

insert into testy  values (1,'x');
insert into testy  values (2,'x');
insert into testy  values (3,'x');
insert into testy  values (4,'x');
select * from testy partition (p1);
select * from testy partition (p2);
select * from testy partition (p3);
select * from testy partition (p4);

dzieli na partycje itd.
======================================================================================


drop table test1;
create table miasto
(id number primary key,
miasta varchar(10) not null,
panstwa char(2) not null)
partition by list (panstwa)
(partition wschod values ('PL', 'CZ'),
partition zachod values ('ES', 'DE')
);


insert into miasto values (1,'Warszawa', 'PL');
insert into miasto  values (2,'Madryt', 'CZ');
select * from miasto partition (wschod);
select * from miasto partition (zachod);

=======================================================================================

create database link x
connect to kadry identified by kadry 
using 'baza';

select * from osoby@x; 

=======================================================================================

set autocomit off ??

insert into wydzialy@x values (10, 'x');
select * from wydzialy@x;
rollback;

select o.*, zpensja 
from osoby@x o, zatrudnienia 2 
where o.id_os=z.id_os;
  
Zgłoś jeśli naruszono regulamin