⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 在oracle中导出、导入dmp数据库文件 - 数据库 - whatiswhat.htm

📁 sql初学者不错的教程
💻 HTM
📖 第 1 页 / 共 2 页
字号:
iImg.title="展开";}}navHover();</SCRIPT>

<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0 
cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD height=3></TD></TR></TBODY></TABLE><BR>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0 
cellPadding=0 width="90%" align=center border=0>
  <TBODY>
  <TR>
    <TD width=18 height=28><IMG alt="" 
      src="在Oracle中导出、导入dmp数据库文件 - 数据库 - whatiswhat.files/bg_art_left_top.gif" 
      border=0></TD>
    <TD 
    background="在Oracle中导出、导入dmp数据库文件 - 数据库 - whatiswhat.files/bg_art_top.gif">
      <P style="MARGIN: 5px; LINE-HEIGHT: 150%"></P></TD>
    <TD width=18 height=28><IMG alt="" 
      src="在Oracle中导出、导入dmp数据库文件 - 数据库 - whatiswhat.files/bg_art_right_top.gif" 
      border=0></TD></TR>
  <TR>
    <TD width=18 
    background="在Oracle中导出、导入dmp数据库文件 - 数据库 - whatiswhat.files/bg_art_left.gif"></TD>
    <TD align=middle bgColor=#f5fdee><BR><FONT style="FONT-SIZE: 14pt" 
      color=#295200><B>在Oracle中导出、导入dmp数据库文件</B></FONT> 
      <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#a5bd6b cellSpacing=1 
      cellPadding=0 width="100%" border=1>
        <TBODY>
        <TR>
          <TD align=middle>
            <TABLE style="BORDER-COLLAPSE: collapse; WORD-WRAP: break-word" 
            cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD align=middle>
                  <TABLE 
                  style="BORDER-COLLAPSE: collapse; WORD-WRAP: break-word" 
                  cellSpacing=0 cellPadding=0 width="100%" border=0>
                    <TBODY>
                    <TR>
                      <TD>
                        <DIV id=art 
                        style="MARGIN: 15px">Oracle数据导入导出imp/exp就相当于oracle数
                        <DIV 
                        style="DIRECTION: ltr"><WBR>据还原与备份。exp<BR>命令可以把数据从远程数据库服务器导出到本地的dmp文件<WBR>,imp命令可以把dmp文件从本地导入到远处的数据库服务器中<WBR>。<BR>利用这个功能可以构建两个相同的数据库,一个用来测试<WBR>,一个用来正式使用。<BR><BR>执行环境:可以在SQLPLUS.EXE或者DOS(命令行<WBR>)中执行,DOS中可以执行时由于 
                        在oracle 8i 
                        中<BR>安装目录\ora81\BIN被设置为全局路径,该目录下有EX<WBR>P.EXE与IMP.EXE文件被用来执行导入导出<WBR>。oracle用java编写,<BR>SQLPLUS.EXE、EXP.EXE、IMP<WBR>.EXE这两个文件有可能是被包装后的类文件。SQLPLUS<WBR>.EXE调用EXP.EXE、<BR>IMP.EXE所包裹的类,完成导入导出功能。<BR><BR>下面介绍的是导入导出的实例。<BR><BR>数据导出:<BR><BR>1 
                        将数据库TEST完全导出,用户名system 密码manager 
                        导出到D:\daochu.dmp中<BR>&nbsp; exp system/manager@TEST 
                        file=d:\daochu.dmp full=y<BR><BR>2 
                        将数据库中system用户与sys用户的表导出<BR>&nbsp; exp 
                        system/manager@TEST file=d:\daochu.dmp 
                        owner=(system,sys)<BR><BR>3 
                        将数据库中的表inner_notify、notify<WBR>_staff_relat导出<BR>&nbsp; 
                        &nbsp;exp aichannel/aichannel@TESTDB2 file= 
                        d:\data\newsmgnt.dmp<BR>tables=(inner_notify,notify<WBR>_staff_relat)<BR><BR>4 
                        将数据库中的表table1中的字段filed1以"00<WBR>"打头的数据导出<BR>&nbsp; exp 
                        system/manager@TEST file=d:\daochu.dmp tables=(table1) 
                        query=\"<BR>where filed1 like 
                        '00%'\"<BR><BR>上面是常用的导出,对于压缩,既用winzip把dmp文件可以<WBR>很好的压缩。也可以在上面命令后面 
                        加上 compress=y 来实现。<BR><BR>数据的导入<BR>1 将D:\daochu.dmp 
                        中的数据导入 TEST数据库中。<BR>&nbsp; imp system/manager@TEST 
                        &nbsp;file=d:\daochu.dmp<BR>&nbsp; imp 
                        aichannel/aichannel@HUST full=y &nbsp;file=file= 
                        d:\data\newsmgnt.dmp ignore=y<BR>&nbsp; 
                        上面可能有点问题,因为有的表已经存在,然后它就报错<WBR>,对该表就不进行导入。<BR>&nbsp; 
                        在后面加上 ignore=y 就可以了。<BR><BR>2 将d:\daochu.dmp中的表table1 
                        导入<BR>&nbsp; imp system/manager@TEST 
                        &nbsp;file=d:\daochu.dmp 
                        &nbsp;tables=(table1)<BR><BR>基本上上面的导入导出够用了。不少情况要先是将表彻底删除<WBR>,然后导入。<BR><BR>注意:<BR>操作者要有足够的权限,权限不够它会提示。<BR>数据库时可以连上的。可以用tnsping 
                        TEST 
                        来获得数据库TEST能否连上。<BR><BR>附录一:<BR>给用户增加导入数据权限的操作<BR>第一,启动sql*puls<BR>第二,以system/manager登陆<BR>第三,create 
                        user 用户名 IDENTIFIED BY 密码 (如果已经创建过用户,这步可以省略)<BR>第四,GRANT 
                        CREATE USER,DROP USER,ALTER USER ,CREATE ANY VIEW 
                        ,<BR>&nbsp; DROP ANY 
                        VIEW,EXP_FULL_DATABASE,IMP<WBR>_FULL_DATABASE,<BR>&nbsp; 
                        DBA,CONNECT,RESOURCE,CREATE SESSION &nbsp;TO 用户名字<BR>第五, 
                        运行-cmd-进入dmp文件所在的目录,<BR>&nbsp; imp userid=system/manager 
                        full=y file=*.dmp<BR>&nbsp; 或者 imp userid=system/manager 
                        full=y 
                        file=filename.dmp<BR><BR>执行示例:<BR>F:\Work\Oracle_Data\backup&gt;imp 
                        userid=test/test full=y 
                        file=inner_notify.dmp<BR><BR>屏幕显示<BR>Import: Release 
                        8.1.7.0.0 - Production on 星期四 2月 16 16:50:05 2006<BR>(c) 
                        Copyright 2000 Oracle Corporation. &nbsp;All rights 
                        reserved.<BR><BR>连接到: Oracle8i Enterprise Edition 
                        Release 8.1.7.0.0 - Production<BR>With the Partitioning 
                        option<BR>JServer Release 8.1.7.0.0 - 
                        Production<BR><BR>经由常规路径导出由EXPORT:V08.01.07创建的文件<BR>已经完成ZHS16GBK字符集和ZHS16GBK 
                        NCHAR 字符集中的导入<BR>导出服务器使用UTF8 NCHAR 字符集 
                        (可能的ncharset转换)<BR>. 正在将AICHANNEL的对象导入到 AICHANNEL<BR>. . 
                        正在导入表 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
                        &nbsp; &nbsp;"INNER_NOTIFY" &nbsp; &nbsp; &nbsp; &nbsp; 
                        &nbsp;4行被导入<BR>准备启用约束条件...<BR>成功终止导入,但出现警告。<BR><BR>附录二:<BR>Oracle 
                        不允许直接改变表的拥有者, 
                        利用Export/Import可以达到这一目的.<BR>先建立import9.par,<BR>然后,使用时命令如下:imp 
                        parfile=/filepath/import9.par<BR>例 import9.par 
                        内容如下:<BR>&nbsp; &nbsp; &nbsp; 
                        &nbsp;FROMUSER=TGPMS<BR>&nbsp; &nbsp; &nbsp; 
                        &nbsp;TOUSER=TGPMS2<BR>(注:把表的拥有者由FROMUSER改为TOUSER<WBR>,FROMUSER和TOUSER的用户可以不同)<BR>&nbsp; 
                        &nbsp; &nbsp; &nbsp;ROWS=Y<BR>&nbsp; &nbsp; &nbsp; 
                        &nbsp;INDEXES=Y<BR>&nbsp; &nbsp; &nbsp; 
                        &nbsp;GRANTS=Y<BR>&nbsp; &nbsp; &nbsp; 
                        &nbsp;CONSTRAINTS=Y<BR>&nbsp; &nbsp; &nbsp; 
                        &nbsp;BUFFER=409600<BR>&nbsp; &nbsp; &nbsp; 
                        &nbsp;file==/backup/ctgpc_20030623<WBR>.dmp<BR>&nbsp; 
                        &nbsp; &nbsp; 
                        &nbsp;log==/backup/import_20030623<WBR>.log</DIV></DIV></TD></TR></TBODY></TABLE>
                  <P style="MARGIN: 5px; LINE-HEIGHT: 150%"></P></TD></TR>
              <TR>
                <TD align=middle height=25><FONT color=#295200>发表于: 2008-04-23 
                  ,修改于: 2008-04-23 09:42,已浏览70次,有评论0条</FONT> <A id=star 
                  title=推荐这篇文章 onclick="NewWindows(this.href);return false;" 
                  href="http://blog.chinaunix.net/u2/star.php?blogid=44734&amp;artid=573510">推荐</A> 
                  <A id=complaint title=投诉这篇文章 
                  onclick="NewWindows(this.href);return false;" 
                  href="http://blog.chinaunix.net/u2/complaint.php?blogid=44734&amp;artid=573510">投诉</A> 
                </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
    <TD width=18 
    background="在Oracle中导出、导入dmp数据库文件 - 数据库 - whatiswhat.files/bg_art_right.gif"></TD></TR>
  <TR>
    <TD width=18 height=28><IMG alt="" 
      src="在Oracle中导出、导入dmp数据库文件 - 数据库 - whatiswhat.files/bg_art_left_bottom.gif" 
      border=0></TD>
    <TD 
    background="在Oracle中导出、导入dmp数据库文件 - 数据库 - whatiswhat.files/bg_art_bottom.gif">
      <P style="MARGIN: 5px; LINE-HEIGHT: 150%"></P></TD>
    <TD width=18 height=28><IMG alt="" 
      src="在Oracle中导出、导入dmp数据库文件 - 数据库 - whatiswhat.files/bg_art_right_bottom.gif" 
      border=0></TD></TR></TBODY></TABLE><BR>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#a5bd6b cellSpacing=1 
cellPadding=0 width="90%" align=center border=1>
  <TBODY>
  <TR>
    <TD style="COLOR: #295200" bgColor=#eff7de height=25><B>网友评论</B></TD></TR>
  <TR>
    <TD bgColor=#ffffff height=1></TD></TR>
  <TR>
    <TD align=middle bgColor=#f9f5e7>
      <TABLE 
      style="COLOR: #295200; BORDER-COLLAPSE: collapse; WORD-WRAP: break-word" 
      cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
        <TBODY></TBODY></TABLE></TD></TR></TBODY></TABLE><BR>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#a5bd6b cellSpacing=1 
cellPadding=0 width="90%" align=center border=1>
  <TBODY>
  <TR>
    <TD style="COLOR: #295200" bgColor=#eff7de height=25><B>发表评论</B></TD></TR>
  <TR>
    <TD bgColor=#ffffff height=1></TD></TR>
  <TR>
    <TD align=middle bgColor=#f9f5e7><IFRAME name=comment 
      src="在Oracle中导出、导入dmp数据库文件 - 数据库 - whatiswhat.files/comment.htm" 
      frameBorder=0 width="100%" 
height=160></IFRAME></TD></TR></TBODY></TABLE></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -