oracle LogMiner¼ò½é
ÔÎĵØÖ·£ºhttp://www.phontol.com/20090719_525808_1.html
1 LogMiner µÄÓÃ;
¡¡¡¡Oracle LogMiner ÊÇ Oracle¹«Ë¾´Ó²úÆ· 8iÒÔºóÌṩµÄÒ»¸öʵ¼Ê·Ç³£ÓÐÓõķÖÎö¹¤¾ß£¬Ê¹Óøù¤¾ß¿ÉÒÔÇáËÉ»ñµÃ OracleÖØ×÷ÈÕÖ¾Îļþ£¨¹éµµÈÕÖ¾Îļþ£©ÖеľßÌåÄÚÈÝ£¬ÌرðÊÇ£¬¸Ã ¹¤¾ß¿ÉÒÔ·ÖÎö³öËùÓжÔÓÚÊý¾Ý¿â²Ù×÷µÄ DML£¨insert¡¢update¡¢delete µÈ£©Óï¾ä£¬9iºó¿ÉÒÔ·ÖÎö DDLÓï¾ä£¬ÁíÍ⻹¿É·ÖÎöµÃµ½Ò»Ð©±ØÒªµÄ»Ø¹ö SQLÓï¾ä¡£ÆäÖÐÒ»¸ö×îÖØÒªµÄÓÃ;¾ÍÊDz» ÓÃÈ«²¿»Ö¸´Êý¾Ý¿â¾Í¿ÉÒÔ»Ö¸´Êý¾Ý¿âµÄij¸ö±ä»¯¡£¸Ã¹¤¾ßÌرðÊÊÓÃÓÚµ÷ÊÔ¡¢Éó¼Æ»òÕß»ØÍËij ¸öÌض¨µÄÊÂÎñ¡£
¡¡¡¡LogMiner ¹¤¾ß¼´¿ÉÒÔÓÃÀ´·ÖÎöÔÚÏߣ¬Ò²¿ÉÒÔÓÃÀ´·ÖÎöÀëÏßÈÕÖ¾Îļþ£¬¼´¿ÉÒÔ·ÖÎö±¾Éí ×Ô¼ºÊý¾Ý¿âµÄÖØ×÷ÈÕÖ¾Îļþ£¬Ò²¿ÉÒÔÓÃÀ´·ÖÎöÆäËûÊý¾Ý¿âµÄÖØ×÷ÈÕÖ¾Îļþ¡£ ×ܵÄ˵À´£¬LogMiner¹¤¾ßµÄÖ÷ÒªÓÃ;ÓУº
¡¡¡¡1£® ¸ú×ÙÊý¾Ý¿âµÄ±ä»¯£º¿ÉÒÔÀëÏߵĸú×ÙÊý¾Ý¿âµÄ±ä»¯£¬¶ø²»»áÓ°ÏìÔÚÏßϵͳµÄÐÔÄÜ¡£
¡¡¡¡2£® »ØÍËÊý¾Ý¿âµÄ±ä»¯£º»ØÍËÌض¨µÄ±ä»¯Êý¾Ý£¬¼õÉÙ point-in-time recovery µÄÖ´ÐС£
¡¡¡¡3£® ÓÅ»¯ºÍÀ©Èݼƻ®£º¿Éͨ¹ý·ÖÎöÈÕÖ¾ÎļþÖеÄÊý¾ÝÒÔ·ÖÎöÊý¾ÝÔö³¤Ä£Ê½¡£
¡¡¡¡4.¡¡¡¡È·¶¨Êý¾Ý¿âµÄÂß¼Ëð»µÊ±¼ä£º×¼È·¶¨Î»²Ù×÷Ö´ÐеÄʱ¼äºÍ SCN¡¡ ==>»ùÓÚʱ¼äºÍ
SCNµÄ»Ö¸´
¡¡¡¡5.¡¡¡¡È·¶¨ÊÂÎñ¼¶ÒªÖ´Ðеľ«Ï¸Âß¼»Ö¸´²Ù×÷¡¡¡¡¡¡¡¡¡¡//È¡µÃÏàÓ¦µÄ UNDO²Ù×÷
¡¡¡¡6.¡¡¡¡Ö´ÐкóÐøÉó¼Æ¡¡¡¡¡¡¡¡ //DML¡¡ DDL¡¡ DCL¡¡ Ö´ÐÐʱ¼ä¡¢Óû§
¡¡¡¡×¢ÒâÊÂÏ
¡¡¡¡1.¡¡¡¡LogMiner ¿ÉÒÔ°ïÄãÈ·¶¨ÔÚij¶Îʱ¼äËù·¢µÄ¸÷ÖÖ DML£¬DDL²Ù×÷µÄ¾ßÌåʱ¼äºÍ SCN
¡¡¡¡ºÅ£¬ËüËùÒÀ¾ÝµÄÊǹ鵵ÈÕÖ¾Îļþ¼°Áª»úÈÕÖ¾Îļþ¡£
¡¡¡¡2.¡¡¡¡ËüÖ»ÄÜÔÚ Oracle8i¼°ÒÔºóµÄ°æ±¾ÖÐʹÓ㬲»¹ýËü¿ÉÒÔ·ÖÎö Oracle8µÄÈÕÖ¾¡£
¡¡¡¡3.¡¡¡¡Oracle8i Ö»ÄÜÓÃÓÚ·ÖÎö DML²Ù×÷£¬µ½ Oracle9iÔò¿ÉÒÔ·ÖÎö DDL²Ù×÷ÁË¡£
Ïà¹ØÎĵµ£º
¸ü¸Ä±íµÄ½á¹¹
1.±à¼±íµÄ×Ö¶Î
ÐÞ¸ÄÒ»¸öÁеÄÊý¾ÝÀàÐÍ(Ò»°ãÏÞÓÚÐ޸ij¤¶È£¬ÐÞ¸ÄΪһ¸ö²»Í¬ÀàÐÍʱÓÐÖî¶àÏÞÖÆ):
Óï·¨:
ALTER TABLE ±íÃû MODIFY(ÁÐÃû Êý¾ÝÀàÐÍ);
eg1:
alter table skate_test modify (author number(10,0) )
ÔÚÐÞ¸ÄÁеij¤¶Èʱºò,Ö»Äܱ ......
ʵÀý£º
1¡¢Í¨¹ýDBLINKµÄ·½Ê½£º±í¿Õ¼ä²»Ò»Ñù
impdp logfile=DUP_MCMDB.LOG network_link=to_crm_7 schemas=MCMDB REMAP_TABLESPACE=table_space11:table_space12,table_space21:table_space22
2¡¢Í¨¹ýDBLINKµÄ·½Ê½£º·½°¸£¨schemas£©²»Ò»Ñù
impdp logfile=DUP_MCMDB.LOG net ......
Ò»¸öÓû§¿ÉÒÔʹÓÃÒ»¸ö»ò¶à¸ö±í¿Õ¼ä£¬Ò»¸ö±í¿Õ¼äÒ²¿ÉÒÔ¹©¶à¸öÓû§Ê¹Óá£Óû§ºÍ±í¿Õ¼äûÓÐÁ¥Êô¹Øϵ£¬±í¿ÕÊÇÒ»¸öÓÃÀ´¹ÜÀíÊý¾Ý´æ´¢Âß¼¸ÅÄ±í¿Õ¼äÖ»ÊǺÍÊý¾ÝÎļþ·¢Éú¹Øϵ£¬Êý¾ÝÎļþÊÇÎïÀíµÄ£¬Ò»¸ö±í¿Õ¼ä¿ÉÒÔ°üº¬¶à¸öÊý¾ÝÎļþ£¬¶øÒ»¸öÊý¾ÝÎļþÖ»ÄÜÁ¥ÊôÒ»¸ö±í¿Õ¼ä¡£
Óû§ÊôÓÚÊý¾Ý¿âʵÀýµ ......
package com.svse.dao;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UserDAO {
/*
* javaµ÷Óô洢¹ý³Ì
*/
public int addUser(String username,int userage)
{
Connection conn = null;
int useri ......