• linux测试系统使用expdp迁移数据到windos系统,11.2.0.4版本测试


    测试,使用linux 系统,迁移至windos测试系统,迁移用户scott

    1.源端导出(linux)

    2.传输

    3.目标端导入(windows)

    1.源端导出,本次使用expdp

    1)创建操作系统转储目录,存放expdp导出的dump文件

    [oracle@enmo ~]$ cd /picclife/software/dump/

    [oracle@enmo dump]$ ls -lrt /picclife/software/|grep dump
    drwxr-xr-x 2 oracle oinstall 4096 Jan 12 09:02 dump

    2)查询or创建数据库转储目录

    SQL> select * from dba_directories;

    SQL> create directory scott_dump as '/picclife/software/dump';

    Directory created.

    授予权限

    SQL> grant read,write on directory scott_dump to scott;

    Grant succeeded.

    3)操作系统oracle用户使用迁移用户进行导出

    expdp scott/tiger DIRECTORY=scott_dump dumpfile=scott_dump%U logfile=expdp_dump schemas=scott

    2.文件传输

    D: mp

    scott_dump01.dmp

    3.目标端导入windows系统

    1)测试环境,删除用户

    SQL> drop user scott cascade;

    2)创建表空间

    查询数据文件目录

    SQL> select name from v$datafile;

    根据源端scott用户,使用的表空间进行创建

    SQL> create tablespace test datafile 'C:WIN_ORACLE_11_DATABASEAPPORADATAWIN11 est01.dbf' size 1m;

    表空间已创建。

    linux系统,查询迁移用户之前的表空间

    SQL> select username,DEFAULT_TABLESPACE from dba_users where username='SCOTT';

    USERNAME DEFAULT_TABLESPACE
    -------------------- --------------------
    SCOTT test

    3)创建用户

    *注意,迁移新环境的用户默认表空间需要与生产环境中的保持一致,本次查询上述是test

    SQL> create user scott identified by tiger default tablespace test;

    4)创建转储目录,并授予权限

    SQL> create directory imp_scott as 'D: mp';

    SQL>  grant read,write on directory imp_scott to scott;

    5)权限同步

    导入数据前,需要一些权限,因此在源端linux查询相应权限后,目标端windows进行同步

    linux查询

    select * from dba_role_privs where grantee='SCOTT'

    GRANTEE GRANTED_ROLE ADMIN_ DEFAUL
    -------------------- -------------------- ------ ------
    SCOTT RESOURCE NO YES
    SCOTT CONNECT NO YES

    select * from dba_sys_privs where grantee='SCOTT'

    GRANTEE PRIVILEGE ADMIN_
    -------------------- -------------------- ------
    SCOTT UNLIMITED TABLESPACE NO

    *由于只是导入一个用户,因此无需同步其它用户的对象权限

    windows授予

    SQL> grant connect,resource to scott;

    SQL> grant unlimited tablespace to scott;

    5)进行导入

    C:UsersThinkpad>impdp scott/tiger directory=imp_scott dumpfile=scott_dump%U logfile=scott_impdp

  • 相关阅读:
    zabbix_server调优
    zabbix图形刷新延迟解决
    ntp同步报错解决
    python3.5 字典遍历
    python3.5 append使用
    python3.5 元组
    pycharm修改代码后第一次运行不生效解决
    Intellij IDEA 使用Spring-boot-devTools无效解决办法
    TOP命令各个参数代表意义详解
    ps命令各个内容信息详解
  • 原文地址:https://www.cnblogs.com/lvcha001/p/10261287.html
Copyright © 2020-2023  润新知