迁移数据库

我现在采用了一个新的方式,重新搭建数据库。

步骤:

  1、先导出数据库,但不包含表数据。rows=N

  2、查询数据小于50M的表。

  3、导出小于50M的表数据,包含对象。rows=y  parfile=d:\useingdb\ha.txt 

  4、导入数据库。

  5、导入表数据。

 select t.segment_name, sum(t.bytes) / 1024 / 1024

                    from user_segments  t    
                    WHERE t.segment_type LIKE 'TABLE%'         
                     group by t.segment_name 
                     having sum(t.bytes) / 1024 / 1024 <=50
                     
 
exp ha/ha@to_192.168.1.103 file=D:\useingdb\ha.dmp log=D:\useingdb\ha.log buffer=20480000  rows=Y
 
              parfile=d:\useingdb\ha.txt 
 
ha.txt 为小于50M的表名 用逗号个看如 tables=(table1,table2,table3)
 
 
imp ha/ha@to_192.168.1.103 file=D:\useingdb\ha.dmp full=y buffer=20480000  
posted @ 2013-07-24 09:14  lishoubin  阅读(215)  评论(0编辑  收藏  举报