生活随笔
收集整理的這篇文章主要介紹了
oracle数据库plsqldev导出表、表结构的方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
提示:plsqldev導出表、表結構的幾種方式
文章目錄
- oracle導出數據的方式
- 1、plsqldev工具導出導入
- 1.1 plsqldev導出數據
- 1、1 Tools-->export tables導出
- 2.1 導出表結構:也可以在plsql->tool->ExportUser Objects..中進行操作
- 2、plsqldev導入數據
- 2、1 Tools-->Import tables
oracle導出數據的方式
1、plsqldev工具導出導入
1.1 plsqldev導出數據
1、1 Tools–>export tables導出
結果如下:
prompt PL
/SQL Developer
import file
prompt Created on
2022?ê
7??
15è? by Administrator
set feedback off
set define off
prompt Disabling triggers
for EMP
...
alter table EMP disable all triggers
;
prompt Deleting EMP
...
delete from EMP
;
commit
;
prompt Loading EMP
...
insert into
EMP (empno
, ename
, job
, mgr
, hiredate
, sal
, comm
, deptno
)
values (7369, 'SMITH', 'CLERK', 7902, to_date('17-12-1980', 'dd-mm-yyyy'), 800, null
, 20);
insert into
EMP (empno
, ename
, job
, mgr
, hiredate
, sal
, comm
, deptno
)
values (7499, 'ALLEN', 'SALESMAN', 7698, to_date('20-02-1981', 'dd-mm-yyyy'), 1600, 300, 30);
insert into
EMP (empno
, ename
, job
, mgr
, hiredate
, sal
, comm
, deptno
)
values (7521, 'WARD', 'SALESMAN', 7698, to_date('22-02-1981', 'dd-mm-yyyy'), 1250, 500, 30);
insert into
EMP (empno
, ename
, job
, mgr
, hiredate
, sal
, comm
, deptno
)
values (7566, 'JONES', 'MANAGER', 7839, to_date('02-04-1981', 'dd-mm-yyyy'), 2975, null
, 20);
insert into
EMP (empno
, ename
, job
, mgr
, hiredate
, sal
, comm
, deptno
)
values (7654, 'MARTIN', 'SALESMAN', 7698, to_date('28-09-1981', 'dd-mm-yyyy'), 1250, 1400, 30);
insert into
EMP (empno
, ename
, job
, mgr
, hiredate
, sal
, comm
, deptno
)
values (7698, 'BLAKE', 'MANAGER', 7839, to_date('01-05-1981', 'dd-mm-yyyy'), 2850, null
, 30);
insert into
EMP (empno
, ename
, job
, mgr
, hiredate
, sal
, comm
, deptno
)
values (7782, 'CLARK', 'MANAGER', 7839, to_date('09-06-1981', 'dd-mm-yyyy'), 2450, null
, 10);
insert into
EMP (empno
, ename
, job
, mgr
, hiredate
, sal
, comm
, deptno
)
values (7788, 'SCOTT', 'ANALYST', 7566, to_date('19-04-1987', 'dd-mm-yyyy'), 3000, null
, 20);
insert into
EMP (empno
, ename
, job
, mgr
, hiredate
, sal
, comm
, deptno
)
values (7839, 'KING', 'PRESIDENT', null
, to_date('17-11-1981', 'dd-mm-yyyy'), 5000, null
, 10);
insert into
EMP (empno
, ename
, job
, mgr
, hiredate
, sal
, comm
, deptno
)
values (7844, 'TURNER', 'SALESMAN', 7698, to_date('08-09-1981', 'dd-mm-yyyy'), 1500, 0, 30);
insert into
EMP (empno
, ename
, job
, mgr
, hiredate
, sal
, comm
, deptno
)
values (7876, 'ADAMS', 'CLERK', 7788, to_date('23-05-1987', 'dd-mm-yyyy'), 1100, null
, 20);
insert into
EMP (empno
, ename
, job
, mgr
, hiredate
, sal
, comm
, deptno
)
values (7900, 'JAMES', 'CLERK', 7698, to_date('03-12-1981', 'dd-mm-yyyy'), 950, null
, 30);
insert into
EMP (empno
, ename
, job
, mgr
, hiredate
, sal
, comm
, deptno
)
values (7902, 'FORD', 'ANALYST', 7566, to_date('03-12-1981', 'dd-mm-yyyy'), 3000, null
, 20);
insert into
EMP (empno
, ename
, job
, mgr
, hiredate
, sal
, comm
, deptno
)
values (7934, 'MILLER', 'CLERK', 7782, to_date('23-01-1982', 'dd-mm-yyyy'), 1300, null
, 10);
commit
;
prompt
14 records loaded
prompt Enabling triggers
for EMP
...
alter table EMP enable all triggers
;
set feedback on
set define on
prompt Done
.
2.1 導出表結構:也可以在plsql->tool->ExportUser Objects…中進行操作
結果如下:
----------------------------------------------------
-- Export file
for user SYS
--
-- Created by Administrator on
2022/7/15, 1:35:44 --
----------------------------------------------------set define off
spool
10.logprompt
prompt Creating table DEPT
prompt
===================
prompt
create table SYS
.DEPT
(deptno
NUMBER(2) not null
,dname
VARCHAR2(14),loc
VARCHAR2(13)
)
tablespace SYSTEMpctfree
10pctused
40initrans
1maxtrans
255storage(initial
64Kminextents
1maxextents unlimited
);
alter table SYS
.DEPTadd constraint PK_DEPT primary
key (DEPTNO
)using index tablespace SYSTEMpctfree
10initrans
2maxtrans
255storage(initial
64Kminextents
1maxextents unlimited
);spool off
Oracle Export導出表的結構和數據:二進制、跨平臺、效率高,使用廣范
Sql Inserts導出sql只有儲存數據:可編輯,通用行較好、效率較差、適合小數據量導出
Pl/SQL導出oracle特有的格式
2、plsqldev導入數據
2、1 Tools–>Import tables
4、在命令行使用exp導出dump文件
exp customerchat/customerchat@localhost/orcl file=F:\2022\15.dmp log=d:dd.log full=y
5、在命令行使用exp導入dump文件
imp username/password@localhost:10000/SID file=/database/app/oracle/oradata/ dd.dump log=/database/app/oracle/oradata /dd.log fromuser=user1 touser=user2
總結
以上是生活随笔為你收集整理的oracle数据库plsqldev导出表、表结构的方法的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。