Oracle不导入dblink,(转)记一次远程不落地dblink数据迁移的全过程

那么问题来了,因冻结期无法分盘挂存储,expdp导入导出数据要落地根本行不通,怎么办呢?方案制定因数据无法落地,考虑使用目标端创建dblink指向源库,在目标库上使用impdp的network_link参数进行远程数据导入实施准备源库scheam表空间、户查询检查表空间对应的数据文件大小

select tablespace_name, file_name, bytes / 1024 /

1024  from dba_data_files

where tablespace_name in (‘FAXDBSERVER’);

检查用户所对应表空间

select username, default_tablespace from dba_users order by 1;

检查用户状态及默认表空间

select username, account_status, default_tablespace

from dba_users  where username

in (‘FAXDBSERVER’)  order by

2;

检查所属owner

select distinct owner, segment_type, tablespace_name

from dba_extents

where owner in

(‘FAXDBSERVER’);

检查表的行数

select table_name, num_rows  from

all_tables where owner =

‘FAXDBSERVER’ group by table_name, num_rows

having num_rows > 500  order

by table_name;

TABLE_NAME NUM_ROWS

——————————

—————————————-

T_DNINFO

26878

T_FAXRECINFO  98120

T_FAXSENDINFO 219703

T_FAXSENDINFO_BK  3563

检查对象的数量

Select owner, object_type, count(*)

from

dba_objects where owner =

‘FAXDBSERVER’ group by owner,

object_type order by owner,

object_type;

OWNER OBJECT_TYPE COUNT(*)

——————————

——————- —————————–

FAXDBSERVER INDEX  5

FAXDBSERVER SEQUENCE  3

FAXDBSERVER TABLE  6

FAXDBSERVER TRIGGER  2

源库scheam对象、数据、特殊字符类型查询方案执行NO

1目标库创建所需的表空间create

tablespace B2C_DATE datafile ‘/oradata/sx11t01/B2C_DATE _u01.dbf’

size 200m autoextend on next 100m maxsize 8192m;

create

tablespace B2C_INDEX  datafile

‘/oradata/sx11t01/B2C_INDEX_u01.dbf’ size 200m autoextend on next

100m maxsize 8192m;

方案执行NO 2目标端创建db_link(使用源库的DBA账号:observer

)create database link expdp_link connect to observer

identified by **********

using

‘(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS =

(PROTOCOL = TCP)(HOST = 10.188.100.123)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = ITSHOWDB)

)

)’;

方案执行NO 3创建directory

create or

replace directory imp_itshow as ‘/oradata/dump’;

grant

read, write on directory imp_itshow to public;

方案执行NO 4源库后台进行远程数据导入

nohup

impdp  \’/ as sysdba\’

directory=imp_itshow

network_link=expdp_link

schemas=ITSHOW

logfile=impdp_0120.log &

数据  验证导入完毕后对目标库数据验证思考network_link参数1、network_link不支持long字段的迁移

2、network_link通过insert,select + dblink来实现,迁移速度慢

3、创建dblink如果只针对私有用户则需要给该用户Aexp_full_database权限

4、使用network_link进行数据迁移可能会遇到Wait for shrink lock2 或wait for unread

message on broadcas等待事件造成impdp hang

你可能感兴趣的:(Oracle不导入dblink)