快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

怎么导数据oracle,怎么导数据导到新手机

oracle 数据怎么导入?

我给你一些数据库常用的导入导出命令吧:\x0d\x0a该命令在“开始菜单运行CMD”中执行\x0d\x0a一、数据导出(exp.exe)\x0d\x0a1、将数据库orcl完全导出,用户名system,密码accp,导出到d:\daochu.dmp文件中\x0d\x0aexp system/accp@orcl file=d:\daochu.dmp full=y\x0d\x0a\x0d\x0a2、将数据库orcl中scott用户的对象导出\x0d\x0aexp scott/accp@orcl file=d:\daochu.dmp owner=(scott)\x0d\x0a\x0d\x0a3、将数据库orcl中的scott用户的表emp、dept导出\x0d\x0aexp scott/accp@orcl file= d:\daochu.dmp tables=(emp,dept)\x0d\x0a\x0d\x0a4、将数据库orcl中的表空间testSpace导出\x0d\x0aexp system/accp@orcl file=d:\daochu.dmp tablespaces=(testSpace)\x0d\x0a\x0d\x0a二、数据导入(imp.exe)\x0d\x0a1、将d:\daochu.dmp 中的数据导入 orcl数据库中。\x0d\x0aimp system/accp@orcl file=d:\daochu.dmp full=y\x0d\x0a\x0d\x0a2、如果导入时,数据表已经存在,将报错,对该表不会进行导入;加上ignore=y即可,表示忽略现有表,在现有表上追加记录。\x0d\x0aimp scott/accp@orcl file=d:\daochu.dmp full=y ignore=y\x0d\x0a\x0d\x0a3、将d:\daochu.dmp中的表emp导入\x0d\x0aimp scott/accp@orcl file=d:\daochu.dmp tables=(emp)

成都创新互联公司-专业网站定制、快速模板网站建设、高性价比丰林网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式丰林网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖丰林地区。费用合理售后完善,十年实体公司更值得信赖。

oracle导入EXCEL数据的两种方式

工具栏选择“工具”--》“ODBC导入器”--》选择“Excel Files”,输入用户密码,连接--》选择文件,双击目录,选择文件--》选择sheet--》切换“到Oracle的数据”--》选择表名以及数据对应字段和类型--》点击导入--》完成

将Excel另存为制表符分隔的txt,选择文本导入器(text。。),选择文件File,data to oracle设置对应字段,一定要选择好Nvarchar,import完成。

oracle怎么导出数据

Oracle导出导出有两中方式:一、利用exp imp导出导入;二、利用Oracel数据泵expdp impdp导出导入。

一、利用exp imp导出导入

exp imp 语法如下:

exp:

1) 将数据库orcl完全导出

exp system/manager@orcl file=d:\orcl_bak.dmp full=y

2) 将数据库中system用户的表导出

exp system/manager@orcl file=d:\system_bak.dmp owner=system

3) 将数据库中表table1,table2导出

exp system/manager@orcl file=d:\table_bak.dmp tables=(table1,table2)

4) 将数据库中的表customer中的字段mobile以"139"开头的数据导出

exp system/manager@orcl file=d:\mobile_bak.dmp tables=customer query=\"where mobile like '139%' \"

imp:

1) 将备份文件bak.dmp导出数据库

imp system/manager@orcl file=d:\bak.dmp

如果数据表中表已经存在,会提示错误,在后面加上ignore=y就可以了。

2) 将备份文件bak.dmp中的表table1导入

imp system/manager@orcl file=d:\bak.dmp tables=(table1)

exp imp导出导入数据方式的好处是只要你本地安装了Oracle客户端,你就可以将服务器中的数据导出到你本地计算机。同样也可以将dmp文件从你本地导入到服务器数据库中。但是这种方式在Oracle11g版本中会出现一个问题:不能导出空表。Oracle11g新增了一个参数deferred_segment_creation,含义是段延迟创建,默认是true。当你新建了一张表,并且没用向其中插入数据时,这个表不会立即分配segment。

解决办法:

1、设置deferred_segment_creation参数为false后,无论是空表,还是非空表,都分配segment。

在sqlplus中,执行如下命令:

SQLalter system set deferred_segment_creation=false;

查看:

SQLshow parameter deferred_segment_creation;

该值设置后,只对后面新增的表起作用,对之前建立的空表不起作用,并且注意要重启数据库让参数生效。

2、使用 ALLOCATE EXTEN

使用 ALLOCATE EXTEN可以为数据库对象分配Extent,语法如下:

alter table table_name allocate extent

构建对空表分配空间的SQL命令:

SQLselect 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0

批量生成要修改的语句。

然后执行这些修改语句,对所有空表分配空间。

此时用exp命令,可将包括空表在内的所有表导出。

二、利用expdp impdp导出导入

在Oracle10g中exp imp被重新设计为Oracle Data Pump(保留了原有的 exp imp工具)

数据泵与传统导出导入的区别;

1) exp和imp是客户端工具,他们既可以在客户端使用,也可以在服务端使用。

2) expdp和impdp是服务端工具,只能在Oracle服务端使用。

3) imp只适用于exp导出文件,impdp只适用于expdp导出文件。

expdp导出数据:

1、为输出路径建立一个数据库的directory对象。

create or replace directory dumpdir as 'd:\';

可以通过:select * from dba_directories;查看。

2、给将要进行数据导出的用户授权访问。

grant read,write on directory dumpdir to test_expdp;

3、将数据导出

expdp test_expdp/test_expdp directory=dumpdir dumpfile=test_expdp_bak.dmp logfile=test_expdp_bak.log schemas=test_expdp

注意:这句话在cmd窗口中运行,并且最后不要加分号,否则会提示错误。因为这句话是操作系统命令而不是SQL。

impdp导入数据:

1、给将要进行数据导入的用户授权访问。

grant read,write on directory dumpdir to test_impdp;

2、将数据导入

impdp test_impdp/impdp directory=dumpdir dumpfile=test_expdp_bak.dmp remap_schema=test_expdp:test_impdp

怎样导出oracle整个数据库?

1 将数据库TEST完全导出,用户名system 密码manager 导出到D:\daochu.dmp中\x0d\x0a exp system/manager@TEST file=d:\daochu.dmp full=y\x0d\x0a2 将数据库中system用户与sys用户的表导出\x0d\x0a exp system/manager@TEST file=d:\daochu.dmp owner=(system,sys)\x0d\x0a3 将数据库中的表table1 、table2导出\x0d\x0a exp system/manager@TEST file=d:\daochu.dmp tables=(table1,table2) \x0d\x0a4 将数据库中的表table1中的字段filed1以"00"打头的数据导出\x0d\x0a exp system/manager@TEST file=d:\daochu.dmp tables=(table1) query=\" where filed1 like '00%'\"\x0d\x0a \x0d\x0a 上面是常用的导出,对于压缩我不太在意,用winzip把dmp文件可以很好的压缩。\x0d\x0a 不过在上面命令后面 加上 compress=y 就可以了


本文标题:怎么导数据oracle,怎么导数据导到新手机
网站路径:http://6mz.cn/article/hejohc.html

其他资讯