zoukankan      html  css  js  c++  java
  • cmd下操作oracle数据导库

    1.cmd窗口下,登陆管理员用户:sqlplus sys/1 as sysdba 

    2.创建新用户并为用户授权:

      (1)创建用户

    ---Create the user
    create user Helq3_Pro
    identified by "1"
    default tablespace MOF
    temporary tablespace TEMP
    profile DEFAULT;

      (2)为用户授权

    SQL> grant dba to helq3_cpbgt_20200714 with admin option;
    SQL> grant unlimited tablespace to helq3_cpbgt_20200714 with admin option;
    SQL> grant imp_full_database to helq3_cpbgt_20200714;

    3.数据导入

      (1)imp导入:imp userid=helq3_cpbgt_20200714/1@orcl file=E:\cpcz.dmp full=y ignore=y 

      (2)数据泵导入impdp

        首先,创建,并为用户授权此文件夹

        数据泵导入:impdp helq3_cpbgt_20200714/1 dumpfile=cpcz.dmp directory=expdp_dir remap_schema=helq3_cpbgt_20200714(导出时的用户名):helq3_cpbgt_20200714  

    4.数据导出

      (1)exp导出: exp helq3_cpbgt_20200714/1@orcl file=E:\cpcz.dmp log=cpcz.log

        导出带空表的数据库->先做查询,再正常导出:select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0;

       (2)expdp 数据泵导出:expdp helq3_cpbgt_20200714/1@orcl schemas=helq3_cpbgt_20200714 dumpfile=cpcz.dmp directory=expdp_dir logfile=cpcz.log

  • 相关阅读:
    用tar命令把目标压缩包解压到指定位置
    testing and Deployment
    项目第二阶段进展
    注解使用中 @RequestMapping 和 @GetMapping @PostMapping 区别
    导入项目之最多的问题
    0 for前端之数据交互
    Required String parameter 'xxxxx' is not present] 报错400
    CDI Features
    初始化数据库问题
    mysql的时区问题
  • 原文地址:https://www.cnblogs.com/helq/p/13301302.html
Copyright © 2011-2022 走看看