﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-wilsonyq-随笔分类-Java</title><link>http://www.blogjava.net/wilsonyq/category/50764.html</link><description /><language>zh-cn</language><lastBuildDate>Sat, 25 Oct 2014 18:21:00 GMT</lastBuildDate><pubDate>Sat, 25 Oct 2014 18:21:00 GMT</pubDate><ttl>60</ttl><item><title>【转】11g 数据库表导出再导入10g 时空表不能导出的问题</title><link>http://www.blogjava.net/wilsonyq/archive/2014/10/22/418949.html</link><dc:creator>wilsonyq</dc:creator><author>wilsonyq</author><pubDate>Wed, 22 Oct 2014 09:24:00 GMT</pubDate><guid>http://www.blogjava.net/wilsonyq/archive/2014/10/22/418949.html</guid><wfw:comment>http://www.blogjava.net/wilsonyq/comments/418949.html</wfw:comment><comments>http://www.blogjava.net/wilsonyq/archive/2014/10/22/418949.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wilsonyq/comments/commentRss/418949.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wilsonyq/services/trackbacks/418949.html</trackback:ping><description><![CDATA[<div style="text-align: justify;"><span style="color: #494949; font-family: 'Lucida Console';">问题：ORACLE 11g 将某用户自带表用  EXP 命令导出再IMP导入 10g 时 发现空表不能到导出</span></div><div style="text-align: justify;"><font color="#494949" face="simsun"><br /></font></div><font color="#494949" face="simsun"><div style="text-align: justify;"><span style="font-family: 'Lucida Console';">原因：11g 开始建表时，默认不分配 segment  ,以节省空间，当表插入第一条数据时，再分配  segment</span></div></font><div style="text-align: justify;"></div><font color="#494949" face="simsun"><div style="text-align: justify;"><span style="font-family: 'Lucida Console';">解决方法3个途径：</span></div></font><font color="#494949" face="simsun"><div style="text-align: justify;"><span style="font-family: 'Lucida Console';">1:向空白插入一条数据，再删除掉，就分配空间了（空表比较少）。</span></div></font><font color="#494949" face="simsun"><div style="text-align: justify;"><span style="font-family: 'Lucida Console';">2：修改系统参数alter  system set  deferred_segment_create=false;</span></div></font><font color="#494949" face="simsun"><div style="text-align: justify;"><font color="#494949" face="simsun">&nbsp;</font><wbr style="font-family: verdana, 'courier new';"><wbr style="font-family: verdana, 'courier new';"><font color="#494949" face="simsun">&nbsp;</font><wbr style="font-family: verdana, 'courier new';"><wbr style="font-family: verdana, 'courier new';"><font color="#494949" face="simsun">&nbsp;</font><wbr style="font-family: verdana, 'courier new';"><font color="#494949" face="simsun"><span style="font-family: 'Lucida Console';">（对以后新增的表系统会分配  segment），重启数据库。</span></font></div></font><font color="#494949" face="simsun"><div style="text-align: justify;"><span style="font-family: 'Lucida Console';">3：批量对现有的空表分配空间</span></div></font><font color="#494949" face="simsun"><div style="text-align: justify;"><font color="#494949" face="simsun"><span style="font-family: 'Lucida Console';">select 'alter table ' || table_name ||  &nbsp;</span></font><wbr style="font-family: verdana, 'courier new';"><wbr style="font-family: verdana, 'courier new';"><font color="#494949" face="simsun"><span style="font-family: 'Lucida Console';">' allocate extent;' as sql from all_tables where num_rows = 0 and  OWNER=username ;</span></font></div></font><div style="text-align: justify;"></div> <div style="text-align: justify; font-family: 宋体, Verdana, Arial, Helvetica, sans-serif; line-height: 1.5;"><span style="font-family: 'Lucida Console'; color: #494949;">执行导入导出工作</span></div> <div style="text-align: justify; font-family: 宋体, Verdana, Arial, Helvetica, sans-serif; line-height: 1.5;"><span style="font-family: 'Lucida Console';">1.  exp &nbsp;</span><wbr><wbr><span style="font-family: 'Lucida Console';">system/managerr@servicename owner=username1 file=expfile.dmp  &nbsp;</span><wbr><wbr><span style="font-family: 'Lucida Console';">full=y&nbsp;</span><wbr><wbr></div> <div style="text-align: justify; font-family: 宋体, Verdana, Arial, Helvetica, sans-serif; line-height: 1.5;"><span style="font-family: 'Lucida Console';">2.  imp &nbsp;</span><wbr><wbr><span style="font-family: 'Lucida Console';">ystem/manager@servicename fromuser=username1 touser=username2  ignore=y file=expfile.dmp &nbsp;</span><wbr><wbr><span style="font-family: 'Lucida Console';">full=y</span></div><img src ="http://www.blogjava.net/wilsonyq/aggbug/418949.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wilsonyq/" target="_blank">wilsonyq</a> 2014-10-22 17:24 <a href="http://www.blogjava.net/wilsonyq/archive/2014/10/22/418949.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>