oracle 迁移到达梦的场景
一、分析待迁移的数据库
确定迁移的用户后,查看数据量
select OWNER,sum(bytes)/1024/1024/1024 from dba_segments where owner in('LQG','YX') GROUP BY OWNER;
查看有无lob 表
select OWNER,count(*) from dba_lobs where OWNER in('LQG','YX') group by owner;
列出lob详细表名,迁移的时候可以把lob 表分开迁移。
select OWNER,TABLE_NAME from dba_lobs where OWNER in('LQG','YX');
查看lob表总大小。
select a.owner,sum(a.bytes/1024/1024/1024) GB
from dba_segments a,dba_lobs b
where a.segment_name=b.segment_name
and a.owner in ('LQG','YX')
group by a.owner;
达梦数据库新建用户
create user LQG identified by "xxxxxX" default tablespace "TS_EPI" default index tablespace "TS_EPI";
create user YX identified by "xxxxxX" default tablespace "TS_EPI" default index tablespace "TS_EPI";
ORACLE 数据库新建用户 赋权,用于迁移 数据库用户登录。
Create user dmdts identified by xxx;
Grant connect, resource,dba to xxx;
Oracle 查询role 到达梦端创建。
SELECT 'SELECT DBMS_METADATA.GET_DDL(''ROLE'',''' || GRANTED_ROLE ||''')||'';'' GET_DDL_SQL FROM DUAL;' FROM DBA_ROLE_PRIVS where GRANTEE IN('LQG','YX');