pl/sql developer 导出数据库中的表到可执行的.sql 脚本文件
2015-06-08 17:18
651 查看
PL/SQL自带导出数据库中表到.sql脚本文件的工具。
1.在objects窗口中,选中表》右击》Export Data
2.选》SQL Inserts 选择:Create tables,其他选项看情况选择。
3.Output file:选择输出路径及文件名。
4.输出脚本中的文件部分文件代码
----------------------------------------------------
-- Export file for user SGDC_PMS2 --
-- Created by Administrator on 2015/6/5, 11:08:51 --
----------------------------------------------------
set define off
spool tables.log
prompt
prompt Creating table DF_T_CODEVALUE
prompt =============================
prompt
create table SGDC_PMS2.DF_T_CODEVALUE
(
pkid VARCHAR2(50) not null,
valueid VARCHAR2(50),
name VARCHAR2(100) not null,
parent_id VARCHAR2(50),
sortid NUMBER,
notes VARCHAR2(100),
codeid VARCHAR2(50) not null,
pathname VARCHAR2(200),
is_do CHAR(1),
dept_code VARCHAR2(20),
tab_year VARCHAR2(4),
tab_month VARCHAR2(2),
tab_day VARCHAR2(2),
uptime DATE,
recordtimestamp DATE,
recordstatus VARCHAR2(42),
sjzt NUMBER(2)
)
tablespace TS_ODS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
comment on table SGDC_PMS2.DF_T_CODEVALUE
is '隐患基础数据信息';
comment on column SGDC_PMS2.DF_T_CODEVALUE.pkid
从.sql脚本文件读取数据到数据库
1.新建Command Windows
2.执行:SQL> @C:\XX.sql
1.在objects窗口中,选中表》右击》Export Data
2.选》SQL Inserts 选择:Create tables,其他选项看情况选择。
3.Output file:选择输出路径及文件名。
4.输出脚本中的文件部分文件代码
----------------------------------------------------
-- Export file for user SGDC_PMS2 --
-- Created by Administrator on 2015/6/5, 11:08:51 --
----------------------------------------------------
set define off
spool tables.log
prompt
prompt Creating table DF_T_CODEVALUE
prompt =============================
prompt
create table SGDC_PMS2.DF_T_CODEVALUE
(
pkid VARCHAR2(50) not null,
valueid VARCHAR2(50),
name VARCHAR2(100) not null,
parent_id VARCHAR2(50),
sortid NUMBER,
notes VARCHAR2(100),
codeid VARCHAR2(50) not null,
pathname VARCHAR2(200),
is_do CHAR(1),
dept_code VARCHAR2(20),
tab_year VARCHAR2(4),
tab_month VARCHAR2(2),
tab_day VARCHAR2(2),
uptime DATE,
recordtimestamp DATE,
recordstatus VARCHAR2(42),
sjzt NUMBER(2)
)
tablespace TS_ODS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
comment on table SGDC_PMS2.DF_T_CODEVALUE
is '隐患基础数据信息';
comment on column SGDC_PMS2.DF_T_CODEVALUE.pkid
从.sql脚本文件读取数据到数据库
1.新建Command Windows
2.执行:SQL> @C:\XX.sql
相关文章推荐
- How to install PL/SQL developer on linux (转)
- 为mysql master主机新建一slave并监控slave一致性
- [Sqoop]将Hive数据表导出到Mysql
- [Sqoop]将Mysql数据表导入到Hive
- PLSQL Developer远程登录的方法
- mysqldump Got error: 1449
- 运维角度浅谈MySQL数据库优化
- ContentProvider和SQLite数据库
- mysql数据库的表copy
- 用VS2010检查两个MSSQL数据库的架构差异并同步
- Oracle学习-Power Designer、visio 2003、Oracle sql developer、OEM、expdp
- Hive安装和配置
- mysql 架构与概念
- mysql 架构
- SQLSERVER sp_indexoption的用法 ---- 配置SQLSERVER 只使用行锁
- SQL中OpenDataSource与OpenRowSet的应用
- mysql 在大型网站的应用架构演变
- Ubuntu 安装Sqldeveloper
- mysql 主从 Got fatal error 1236 from master when reading data from binary log: 'Could not find first 错误
- Index logic in MySQL& B- tree algorithm