zoukankan      html  css  js  c++  java
  • 【Vegas原创】imp/exp导入导出数据

    imp:

    1,当数据库没有此表时:

    $ imp uid/pwd@erptest  file=dts1202.dmp  tables=salgbl

    2,当数据库有此表时:

    imp uid/pwd@erptest1  file=dts1202.dmp  tables=salgbl ignore=y

    3,导入bach用户的所有schema到dtowh数据库时:

    imp uid/pwd@dtowh  file=dtlb1210.dmp  fromuser=bach touser=bach

    exp:

    Linux:

    #!/bin/bash
    exp uid/pwd@dtserp file=/u01/app/oracle/fin_monthlyend/dts/dtsfin`date '+%Y%m'`.dmp owner=bach log=/u01/app/oracle/fin_monthlyend/dts/dtsfin`date '+%Y%m'`.log

    Windows:

    set ORACLE_SID=HISDB
    set NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
    set a=%date:~10,4%%date:~4,2%%date:~7,2%
    @echo %a%
    exp uid/pwd@hisdb file=F:\HISDBDmp\hisdb_%a%.dmp log=F:\HISDBDmp\hisdb_log_%a%.log

    将一个dmp文件导入到一个新的数据库,做测试使用:

    如将原来的数据库HIS的nhi用户的dmp文件,导入到一个新的test数据库,用户名为test,密码为test,供测试使用:

    1,create tablespace test:

    CREATE TABLESPACE TEST
    LOGGING
    DATAFILE
    'F:\oracle\product\10.2.0\oradata\test\TEST.dbf' SIZE 50M
    REUSE AUTOEXTEND
    ONNEXT 10M;

    2,create user test:

    createuser test identified by test default tablespace test;

    3,给test用户赋予权限:

    grant connect,resource,dba to test;

    4,导入原nhi用户的数据:

    imp test/test@testfile=F:\abc\hisdb_20100204.dmp log=F:\abc\hisdb_20100204.log fromuser=nhi touser=test

     

    注意:

    1,imp时,不要将sys的内容导入~

  • 相关阅读:
    sql server:Monty Hall problem (蒙提霍尔问题)
    sql server: Graphs, Trees, Hierarchies and Recursive Queries
    csharp:SMO run sql script
    csharp: sum columns or rows in a dataTable
    sql server: quering roles, schemas, users,logins
    sql: Query to Display Foreign Key Relationships and Name of the Constraint for Each Table in Database
    Hadoop基本概念
    OVS架构解析
    Linux下实现修改IP选项字段
    linux下实现UDP通信
  • 原文地址:https://www.cnblogs.com/amadeuslee/p/3744422.html
Copyright © 2011-2022 走看看