exp help=y
conn scott/tiger;
select * from tab;
create table student(sno int, sname varchar2(10), sage int, constraint pk_sno primary key(sno));
insert into student values(1, 'Tom', 18);
insert into student values(2, 'Kite', 19);
insert into student values(3, 'Bob', 20);
commit;
create index ind_stu_name on student(sname);
alter table student add constraints con_age check(sage > 7);
create table address(sno int, zz varchar2(20));
insert into address values(1, '郑州');
insert into address values(2, '洛阳');
commit;
create index ind_add_sto on address(sno);
alter table address add constraints con_zz check(length(zz)>1);
// 导出 scott 的student、address 表。注意:在 doc 下执行。
exp scott/tiger@orcl tables=(student, address) file=D:scott_stu_add.dmp log=D:scott_stu_add.log
// 导出 scott 的所有对象
exp scott/tiger@orcl owner=scott file=D:scott_owner.dmp log=D:scott_owner.log
模式冲突
exp scott/tiger@orcl owner=scott tables=student file=D: est.dmp log=D: est.log
exp system/manager@orcl full=y owner=scott file=D: est.dmp log=D: est.log
导出其它用户的内容:
conn sys as sysdba;
create user test identified by test;
grant connect, resource to test;
conn test/test;
create table t(t1 int);
insert into t values(1);
insert into t values(2);
insert into t values(3);
commit;
导出test用户的 t 表:
exp test/test@orcl tables=t file=D: est.dmp log=D: est.log
exp system/manager@orcl tables=(test.t) file=D: est.dmp
exp system/manager@orcl owner=test file=D: est.dmp
下面这个权限不足:
exp scott/tiger@orcl tables=(test.t) file=D: est.dmp