一、准备工作
二、安装LogMiner
三、使用LogMiner同步迁移数据
示例一:同步迁移数据
BEGIN
DBMS_LOGMNR_D.BUILD (DICTFILENAME => '/u01/app/oracle/redodict.ora',
DICTIONARY_ENCODING => 'WE8ISO8859P1');
END;
/
BEGIN
DBMS_LOGMNR.START_LOGMNR(STARTTIME => SYSDATE - 1,
ENDTIME => SYSDATE,
OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG +
DBMS_LOGMNR.CONTINUOUS_MINE +
DBMS_LOGMNR.NO_SQL_DELIMITER +
DBMS_LOGMNR.NO_ROWID_IN_STMT);
END;
/
SELECT SQL_REDO
FROM V$LOGMNR_CONTENTS
WHERE OPERATION = 'INSERT'
AND SEG_OWNER = 'SCOTT'
AND SEG_NAME = 'EMP';
示例二:限制条件挖掘数据
BEGIN
DBMS_LOGMNR_D.BUILD (DICTFILENAME => '/u01/app/oracle/redodict.ora',
DICTIONARY_ENCODING => 'WE8ISO8859P1');
END;
/
BEGIN
DBMS_LOGMNR.START_LOGMNR(STARTTIME => SYSDATE - 1,
ENDTIME => SYSDATE,
OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG +
DBMS_LOGMNR.CONTINUOUS_MINE +
DBMS_LOGMNR.NO_SQL_DELIMITER +
DBMS_LOGMNR.NO_ROWID_IN_STMT);
END;
/
SELECT SQL_REDO
FROM V$LOGMNR_CONTENTS
WHERE OPERATION = 'INSERT'
AND USERNAME = 'SCOTT';
四、注意事项
以上就是通过LogMiner实现Oracle数据库同步迁移的完整攻略,包括准备工作、安装LogMiner、使用LogMiner同步迁移数据、注意事项等方面的内容。
本文链接:http://task.lmcjl.com/news/14088.html