zoukankan      html  css  js  c++  java
  • dmp文件导入的方法

    1,使用oracle的imp命令导入*.dmp文件
    
    首先要明确知道,使用oracle的imp命令进行导入,要在一个空的数据库下,才是最好的,否则,数据表存在的话,就要先删除数据表中的数据
    步骤1:禁用约束 alter table table disable constraint FK_ForeignKey ;
    使用sqlplus命令登录到oracle数据库,举例如下:
    比如你要用scott这个用户进行导入数据,首先要保证这个用户有dba权限,因此要用oracle的system用户登录数据库,对scott用户授权
    sqlplus system/123456
    grant dba to scott
    退出sqlplus 注:exit命令

    sqlplus scott/tiger
    删除表数据 truncate table table_name
    退出sqlplus

    使用这个导入命令将备份导入
    imp scott/tiger@testdb full=y file=d:scott.dmp ignore=y log=d:log.txt
    testdb :数据库名字 log=d:log.txt为报错的时候日志记录 scott/tiger:登录用户名和密码
    导出成功后,再次登录oracle
    sqlplus scott/tiger
    执行启用约束
    alter table table enable constraint FK_ForeignKey ;
  • 相关阅读:
    saltstack笔记
    saltstack学习篇
    tomcat学习篇
    memcache笔记
    sed、awk学习篇
    javascript function call
    jvm性能调优工具
    spring boot 单元测试
    activemq 分布式事务
    sringboot 集成dobbo2.5.3
  • 原文地址:https://www.cnblogs.com/yanhan/p/3317354.html
Copyright © 2011-2022 走看看