oracle10g导入到12c,10g 数据泵导出,12c数据泵导入

10g

1、创建test用户相关信息

create directory dump_dir as '/home/oracle';

grant read,write on directory dump_dir to test;

grant exp_full_database to test;

2、导出test下面的相关信息

expdp test/test dumpfile=t.dmp

12c

create user test identified by test;

grant connect, resource to test;

grant exp_full_database to test;

grant imp_full_database to test;

GRANT UNLIMITED TABLESPACE TO test; 没有分配这一项,报错,相关信息如下。

我的导入:

impdp test/test directory=dump_dir dumpfile=t.dmp ;

Import: Release 12.1.0.2.0 - Production on Mon Apr 22 16:34:54 2019

Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

ORA-31626: job does not exist

ORA-31633: unable to create master table "TEST.SYS_IMPORT_FULL_05"

ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95

ORA-06512: at "SYS.KUPV$FT", line 1048

ORA-01950: no privileges on tablespace 'USERS'

sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Mon Apr 22 16:37:56 2019

Copyright (c) 1982, 2014, Oracle. All rights reserved.

Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> GRANT UNLIMITED TABLESPACE TO test;

Grant succeeded.

SQL> exit

Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

impdp test/test directory=dump_dir dumpfile=t.dmp ;

Import: Release 12.1.0.2.0 - Production on Mon Apr 22 16:38:14 2019

Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

Master table "TEST"."SYS_IMPORT_FULL_01" successfully loaded/unloaded

Starting "TEST"."SYS_IMPORT_FULL_01": test/**** directory=dump_dir dumpfile=t.dmp

Processing object type SCHEMA_EXPORT/USER

ORA-31684: Object type USER:"TEST" already exists

Processing object type SCHEMA_EXPORT/SYSTEM_GRANT

Processing object type SCHEMA_EXPORT/ROLE_GRANT

Processing object type SCHEMA_EXPORT/DEFAULT_ROLE

Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA

Processing object type SCHEMA_EXPORT/TABLE/TABLE

Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA

. . imported "TEST"."TEST" 5.554 KB 24 rows

Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE

Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE

Processing object type SCHEMA_EXPORT/VIEW/VIEW

Job "TEST"."SYS_IMPORT_FULL_01" completed with 1 error(s) at Mon Apr 22 16:38:33 2019 elapsed 0 00:00:14

字符集问题:

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

select userenv('language') from dual;和新echo $LANG都一致但是导入还是有中文乱码,经过查询查找,发现源端设置了export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK,目标端没有设置,目标端设置以后,导入没有乱码了。

附录:

create user test identified by test;

grant connect, resource to test;

grant exp_full_database to test;

grant imp_full_database to test;

create directory dump_dir as '/home/oracle';

grant read,write on directory dump_dir to test;

GRANT UNLIMITED TABLESPACE TO test;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Oracle 12c中,使用exp导出数据,使用imp导入数据,需要执行以下步骤: 1. 以管理员身份登录数据库。 2. 创建一个新用户。可以使用以下命令创建一个名为“new_user”的用户: CREATE USER new_user IDENTIFIED BY password; 注意替换“password”为新用户的密码。 3. 授予新用户适当的权限。可以使用以下命令将所有权限授予新用户: GRANT ALL PRIVILEGES TO new_user; 如果您只想授予特定权限,可以替换“ALL PRIVILEGES”为适当的权限。 4. 在管理员账号下,使用exp命令导出数据。可以使用以下命令导出名为“old_table”的表: exp username/password@database file=C:\path\to\export.dmp tables=old_table; 注意替换“username/password”为管理员账号的用户名和密码,“database”为数据库的名称,“C:\path\to\export.dmp”为导出文件的路径和文件名,以及“old_table”为要导出的表名。 5. 退出管理员账号,以新用户身份登录。 6. 在新用户账号下,使用imp命令导入数据。可以使用以下命令导入导出数据: imp username/password@database file=C:\path\to\export.dmp full=y; 注意替换“username/password”为新用户账号的用户名和密码,“database”为数据库的名称,“C:\path\to\export.dmp”为导出文件的路径和文件名,以及“full=y”表示导入所有表和数据。 7. 验证数据已成功导入。可以使用以下命令查看新表中的数据: SELECT * FROM old_table; 如果数据成功导入,您应该会看到新表中的所有行和列。 这些步骤将创建一个新用户,使用exp导出数据,使用imp导入数据。请注意,这只是一个简单的例子,实际上可能需要更多的步骤和更复杂的命令来创建和导入数据

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值