Oracle 11g在同一台Linux服务器从实例1全库导入到实例2上

php中文网
发布: 2016-06-07 15:54:58
原创
1189人浏览过

Oracle 11g在同一台Linux服务器从实例1全库导入到实例2上

前期导出命令:

[root@powerlong4 ~]# su - Oracle [oracle@powerlong4 ~]$ export ORACLE_SID=pt1; [oracle@powerlong4 ~]$ expdp \'sys/systestpd as sysdba\' DIRECTORY=dir_dump_t3 FULL=YES DUMPFILE=expdpfull_pd_20150529_02.dmp ...... 1,开始导入

先在实例2上建立管道目录:

[oracle@pttest4 ~]$ export ORACLE_SID=pt2; [oracle@pttest4 ~]$ sqlplus / as sysdba SQL*Plus: Production Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> CREATE OR REPLACE DIRECTORY dir_dump_t3 AS '/home/oracle/expdpimpdp/'; Directory created. SQL>

开始导入全库备份集:

impdp \'sys/syspddev@pt2 as sysdba\' directory=dir_dump_t3 dumpfile=expdpfull_pd_20150529_02.dmp nologfile=y TABLE_EXISTS_ACTION=REPLACE ...... 2,导入报错: ORA-02374: conversion error loading table "puser"."RES_APPROVE_CONTENT" ORA-12899: value too large for column CREATED_POSITION_CD (actual: 24, maximum: 20) 3,怀疑导入目标错误,验证: [oracle@pttest4 admin]$ export ORACLE_SID=pt2; [oracle@pttest4 admin]$ [oracle@pttest4 admin]$ sqlplus / as sysdba SQL*Plus: Production Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> SQL> SQL> select name from v$database; NAME ------------------ pt2 SQL> 4,检查两者的编码

到出库实例库1:

Natural Language Playlist
Natural Language Playlist

探索语言和音乐之间丰富而复杂的关系,并使用 Transformer 语言模型构建播放列表。

Natural Language Playlist 67
查看详情 Natural Language Playlist
SQLFROM V$NLS_PARAMETERS WHERE PARAMETER IN ('NLS_CHARACTERSET', 'NLS_NCHAR_CHARACTERSET'); PARAMETER VALUE ---------------------------------------------------------------- ---------------------------------------------------------------- NLS_CHARACTERSET ZHS16GBK NLS_NCHAR_CHARACTERSET AL16UTF16 SQL>

到导入的库实例2库

SQLFROM V$NLS_PARAMETERS WHERE PARAMETER IN ('NLS_CHARACTERSET', 'NLS_NCHAR_CHARACTERSET'); PARAMETER VALUE ---------------------------------------------------------------- ---------------------------------------------------------------- NLS_CHARACTERSET AL32UTF8 NLS_NCHAR_CHARACTERSET AL16UTF16 SQL>

看到导出导入库实例1实例2的字符集不同,所以问题就在这里了

5,,解决: [oracle@pttest4 admin]$ export ORACLE_SID=pt2; [oracle@pttest4 admin]$ [oracle@pttest4 admin]$ sqlplus / as sysdba SQL*Plus: Release Production Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> SQL>connect username/password as SYSDBA; SQL>SHUTDOWN IMMEDIATE; SQL>STARTUP MOUNT; SQL>ALTER SYSTEM ENABLE RESTRICTED SESSION; SQL>ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0; SQL>ALTER SYSTEM SET AQ_TM_PROCESSES=0; SQL>ALTER DATABASE OPEN; SQL> ALTER DATABASE CHARACTER SET ZHS16GBK ; ALTER DATABASE CHARACTER SET ZHS16GBK; *ERROR at line 1: ORA-12712: new character set must be a superset of old character set 报字符集不兼容,此时下INTERNAL_USE指令不对字符集超集进行检查: SQL>ALTER DATABASE CHARACTER SET INTERNAL_USE ZHS16GBK; SQL>SHUTDOWN IMMEDIATE; SQL>STARTUP; 6,再去检查两个实例的编码 [oracle@pttest4 expdpimpdp]$ sqlplus / as sysdba SQL*Plus: Production Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select name from v$database; NAME --------- pt2 SQL> SQL> SELECT * FROM V$NLS_PARAMETERS WHERE PARAMETER IN ('NLS_CHARACTERSET', 'NLS_NCHAR_CHARACTERSET'); Warning: connection was lost and re-established PARAMETER VALUE ---------------------------------------------------------------- ---------------------------------------------------------------- NLS_CHARACTERSET ZHS16GBK NLS_NCHAR_CHARACTERSET AL16UTF16 SQL>
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号