To record a response file:
/home/oracle/runInstaller -record -destinationFile response_filename
/home/oracle/runInstaller -record -destinationFile /tmp/response_10g_ni.rsp
When Oracle Installer displays the Summary screen, perform:
* Click Install to create the response file, then continue with the installation.
* Click Cancel and then Yes to create the response file or it will just exit (and create the file).
Wednesday, 17 August 2011
Tuesday, 2 August 2011
Log Miner
Log miner, example code.
For prouction, I logmine and quickly make a copy of content and then stop logmining to minimize any impact on live.
[18 Apr 2013: Performed similar on live database, worked fine.]
[1 Aug 2011: Performed this on a restored prod database, worked fine. (was not open, open resetlog will allow you to mine)]
You need enable supplemental logging before generating log files that will be analyzed by LogMiner.
Specify Redo/Archive Log Files for Analysis (first line different)
Then start Log Miner
Copy the content of Log Miner in a fixed table
To properly end a LogMiner session
Disabling Supplemental Logging
Examine the fixed log mining table e.g.
For prouction, I logmine and quickly make a copy of content and then stop logmining to minimize any impact on live.
[18 Apr 2013: Performed similar on live database, worked fine.]
[1 Aug 2011: Performed this on a restored prod database, worked fine. (was not open, open resetlog will allow you to mine)]
You need enable supplemental logging before generating log files that will be analyzed by LogMiner.
select SUPPLEMENTAL_LOG_DATA_MIN from V$DATABASE;
-- On live took around 4 - 6 minutes (depends on db)
alter database add SUPPLEMENTAL LOG DATA;
Specify Redo/Archive Log Files for Analysis (first line different)
EXEC DBMS_LOGMNR.ADD_LOGFILE(logfilename => '/u11/oracle/arch_PRDB1/1_149910_698844939.arc', options => DBMS_LOGMNR.NEW);
EXEC DBMS_LOGMNR.ADD_LOGFILE(logfilename => '/u11/oracle/arch_PRDB1/1_149911_698844939.arc', options => DBMS_LOGMNR.ADDFILE);
EXEC DBMS_LOGMNR.ADD_LOGFILE(logfilename => '/u11/oracle/arch_PRDB1/1_149912_698844939.arc', options => DBMS_LOGMNR.ADDFILE);
EXEC DBMS_LOGMNR.ADD_LOGFILE(logfilename => '/u11/oracle/arch_PRDB1/1_149913_698844939.arc', options => DBMS_LOGMNR.ADDFILE);
EXEC DBMS_LOGMNR.ADD_LOGFILE(logfilename => '/u11/oracle/arch_PRDB1/1_149914_698844939.arc', options => DBMS_LOGMNR.ADDFILE);
EXEC DBMS_LOGMNR.ADD_LOGFILE(logfilename => '/u11/oracle/arch_PRDB1/1_149915_698844939.arc', options => DBMS_LOGMNR.ADDFILE);
EXEC DBMS_LOGMNR.ADD_LOGFILE(logfilename => '/u11/oracle/arch_PRDB1/1_149916_698844939.arc', options => DBMS_LOGMNR.ADDFILE);
EXEC DBMS_LOGMNR.ADD_LOGFILE(logfilename => '/u11/oracle/arch_PRDB1/1_149917_698844939.arc', options => DBMS_LOGMNR.ADDFILE);
EXEC DBMS_LOGMNR.ADD_LOGFILE(logfilename => '/u11/oracle/arch_PRDB1/1_149918_698844939.arc', options => DBMS_LOGMNR.ADDFILE);
EXEC DBMS_LOGMNR.ADD_LOGFILE(logfilename => '/u11/oracle/arch_PRDB1/1_149919_698844939.arc', options => DBMS_LOGMNR.ADDFILE);
EXEC DBMS_LOGMNR.ADD_LOGFILE(logfilename => '/u11/oracle/arch_PRDB1/1_149920_698844939.arc', options => DBMS_LOGMNR.ADDFILE);
EXEC DBMS_LOGMNR.ADD_LOGFILE(logfilename => '/u11/oracle/arch_PRDB1/1_149921_698844939.arc', options => DBMS_LOGMNR.ADDFILE);
EXEC DBMS_LOGMNR.ADD_LOGFILE(logfilename => '/u11/oracle/arch_PRDB1/1_149922_698844939.arc', options => DBMS_LOGMNR.ADDFILE);
Then start Log Miner
EXECUTE DBMS_LOGMNR.START_LOGMNR(OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG);
Copy the content of Log Miner in a fixed table
create table ni_copy_logminer tablespace USERS as select * from V$LOGMNR_CONTENTS;
SELECT username AS USR, (XIDUSN || '.' || XIDSLT || '.' || XIDSQN) AS XID,SQL_REDO, SQL_UNDO
FROM ni_copy_logminer WHERE username IN ('NISLAM_PROD');
SELECT username AS USR, (XIDUSN || '.' || XIDSLT || '.' || XIDSQN) AS XID,SQL_REDO, SQL_UNDO
FROM ni_copy_logminer
To properly end a LogMiner session
EXECUTE DBMS_LOGMNR.END_LOGMNR;
Disabling Supplemental Logging
ALTER DATABASE DROP SUPPLEMENTAL LOG DATA;
Examine the fixed log mining table e.g.
select SEG_OWNER, count(*) from ni_copy_logminer group by SEG_OWNER;
Subscribe to:
Posts (Atom)