目的
将客户测试完的A服务器的u1用户完全导入到B服务器给内部测试,改名为u2通过dblink网络传输,不需要有dmp文件保留’
Impdp test/[email protected]:1521/sid_name network_link=db_A remap_schema=u1:u2 remap_tablespace=users:user01
(
test / test @192.168.0. B :1521 / sid_name 填写导到目标库服务器地址)、(network_link= db_A 要导的用户的 link)例如
A 的U1导入到 B U2要在 B 上创建DBlink为:create public database link db_
A connect to 用户 identified by 密码 using '(DESCRIPTION =(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = IP) (PORT = 端口号 )))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = 实例 )))';Impdp命令参数参考: impdp –help(impdp help=y
)
E:\app\Administrator\product\11.2.0\dbhome_1\BIN>impdp.exe test/[email protected]:1521/sid_name
Import: Release 11.2.0.1.0 - Production on 星期四 12月 5 18:46:51 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
UDI-31623: 操作产生了 ORACLE 错误 31623
ORA-31623: 作业没有通过指定的句柄连接到此会话
ORA-06512: 在 "SYS.DBMS_DATAPUMP", line 3326
ORA-06512: 在 "SYS.DBMS_DATAPUMP", line 4551
ORA-06512: 在 line 1
[root@kfdb trace]# tail -f alert_sid_name.log
Thu Dec 05 18:19:16 2013
Errors in file /oradata2/app/oracle/diag/rdbms/sid_name/sid_name/trace/sid_name_ora_30023.trc (incident=60782):
ORA-04031: 鏃犳硶鍒嗛厤 32 瀛楄妭鐨勫叡浜?唴瀛("streams pool","unknown object","streams pool","fixed allocation callback")
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Thu Dec 05 18:19:17 2013
Sweep [inc][60782]: completed
ORA-4031:一般都因为内存不够大造成(SHARED POOL SIZE ,Large_pool,Java_pool, streams pool…)
(空间不足可能包括碎片 而不能找到足够的内存块)
streams pool流池:用于缓存流进程用于移动和复制数据所使用的队列消息
扩大streams pool、SGA
实施:
检查系统和数据空间
[root@kfdb trace]# df -h Filesystem 容量 已用 可用 已用% 挂载点 /dev/cciss/c0d0p1 29G 25G 3.3G 89% / none 8.0G 9.6M 8.0G 1% /dev/shm /dev/cciss/c0d0p3 354G 139G 197G 42% /u01 /dev/cciss/c0d1p1 216G 185G 20G 91% /oradata2 [root@kfdb trace]# 2、SGA大小 SQL> show parameter sga_ NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ sga_max_size big integer 1536M sga_target big integer 1536M 3、流池大小 SQL> show parameter stream NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ streams_pool_size big integer 0 |
修改SGA和流池大小重启数据库
SQL> alter system set sga_target=2048M scope=spfile sid='sid_name'; SQL> alter system set streams_pool_size=50M scope=spfile sid='sid_name'; SQL> shutdown immediate SQL> startup |
查看是否修改正确
SQL> show parameter sga_ NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ sga_max_size big integer 2G sga_target big integer 2G SQL> show parameter streams_ NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ streams_pool_size big integer 64M SQL> |
重新测试导入
E:\app\Administrator\product\11.2.0\dbhome_1\BIN>impdp.exe test/[email protected]:1521/s inodb network_link=db_A remap_schema=u1:u2 remap_tablespace=users:user01 Import: Release 11.2.0.1.0 - Production on 星期四 12月 5 18:48:59 2013 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. 连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 启动 "test"."SYS_IMPORT_SCHEMA_01": test/********@192.168.0.B:1521/sid_name network_link =db_A remap_schema=u1:u2 remap_tablespace=users:user01 正在使用 BLOCKS 方法进行估计... 处理对象类型 SCHEMA_EXPORT/TABLE/TABLE_DATA 使用 BLOCKS 方法的总估计: 20.47 GB 处理对象类型 SCHEMA_EXPORT/USER ORA-31684: 对象类型 USER:"u2" 已存在 处理对象类型 SCHEMA_EXPORT/SYSTEM_GRANT 处理对象类型 SCHEMA_EXPORT/ROLE_GRANT 处理对象类型 SCHEMA_EXPORT/DEFAULT_ROLE 处理对象类型 SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA 处理对象类型 SCHEMA_EXPORT/SEQUENCE/SEQUENCE 处理对象类型 SCHEMA_EXPORT/TABLE/TABLE . . 导入了 "u2"."CS_ORDER_ITEM_DRAFT_REC" 10683193 行 |
DataPump的内存组件有PGA和SGA中的共享池Shared Pool、流池Streams Pool。
Expdp/Impdp对shared Pool的开销主要体现在其运行过程中需要调用一系列的包体PACKGE BODY
它们包括:
PACKAGE_NAME TYPE SHARABLE_MEM
---------------------------------------- -------------------- ------------
SYS.KUPM$MCP PACKAGE BODY 425448 ...
DataPump内部利用高级队列 Advanced Queue技术,所以也会用到流池Streams Pool,与之相关的Streams Pool组件包括:
POOL NAME BYTES
------------ -------------------------- ----------
streams pool sob_kgqmrec 19584 ....
此外DataPump还可能从Large Pool中分配PX msg pool作为并行进程通信池,但是这种内存开销很小。
DataPump工具Expdp/Impdp需要从PGA和SGA的Shared Pool、Streams Pool、Streams Pool和Large Pool分配必要的内存。为了避免Expdp/Impdp出现ORA-04031/ORA-04030错误,我们有必要在自动管理模式下设置合理的pga_aggregate_target和sga_target(抑或者memory_target)内存初始化参数,如果使用手动的SGA管理的话,那么有必要保证shared_pool_size的设置适宜,对于Streams Pool和Large Pool一般设置为150MB大小
(/oradata2/app/oracle/diag/rdbms/sid_name/sid_name/trace/sid_name_ora_30023.trc)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28602568/viewspace-1101362/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/28602568/viewspace-1101362/