Skip to main content

Posts

Showing posts from June, 2011

run startup/shutdown script on windows.

I need to map a network drive to backup mssql database, I used to use windows 2003 resource kit to run autoexnt service, but I found the following method is also working for me on windows 2008 standard edition. here you go. http://www.tutorial5.com/content/view/157/47/ Now if you want to integrate any kind of script to automatically run when Windows starts or shuts down (user logon/logoff), you must follow these steps: 1. Click Start - Run and type mmc (note that you must be logged in with an administrator account for this) 2. On the Management console that starts, click File -> Add/Remove Snap-in. 3. On the window that opens, search for Group Policy Object editor on the left panel, click Add and in the properties window that pops out leave the settings that are selected (Local computer) and click ok. The result should be like in the picture bellow Click "OK" 4. Navigate through the left panel by opening each branch like this: Console Root -> Computer configuration ->

msconfig disable startup app

Recently my windows PC take 5 minutes to reboot and the logon take another 5 minutes, a friend showed me how to disable background application when booting up windows, that helps me to reduce rebooting time dramatically. what you need to do is to run msconfig from command and get a GUI window, click up "startup" tab and disable things that you do not need, and reboot.

rollback in-doube distributed transaction

user run a select statement on a local table but get "ora-01591:lock held by in-doubt distribted transaction 3.1.116925" error, somehow a developer update a record through database link to sybase but forgot to commit on oracle side. here is how to troubleshoot and resolve it. 1. find out the pending transactions. in oracle 10g: sqlplus > select * from dba_2pc_pending; sqlplus > select * from DBA_2PC_NEIGHBORS; record local_tran_id (in oracle 9i sqlplus > select * from sys.pending_trans$; the query result shows the local_tran_id (3.1.116925), os_user (a developer name shows here) and a os_terminal (the developers pc name), fail time (recent) and state (prepared). ) 2. rollback the pending transaction, query the state again, the state is changed from prepared to "forced rollback" sqlplus > rollback force '3.1.116925'; 3. clear the records. execute DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY('3.1.116925') commit; now query the sys.pending_trans$

rman delete backup without mounting db

######################################################## Description : BIDTST database is accidently dropped before it's RMAN database backups on tapes are removed. so we need to remove the backups without having BIDTST db mounted. The doc retains the error messages which help troubleshooting... Date : June 1, 2011 DBA : Jiulu Sun & Kevin Ma ######################################################## $ rman catalog rman/password@catalog target / Recovery Manager: Release 10.2.0.4.0 - Production on Thu Jun 2 15:26:52 2011 Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: DUMMY (not mounted) connected to recovery catalog database RMAN> @generic_config.rman RMAN> configure channel device type sbt parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo_rman_agcoux043.opt)'; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMA

rman query catalog

the following query will show the last full/incremental/archivelog/controlfile backup. select name, full, inc, log, ctl from rman.rc_database d, (select db_id, max(START_TIME) full from rman.rc_backup_set s where s.backup_type in ('D') and controlfile_included = 'NONE' group by db_id) f, (select db_id, max(START_TIME) inc from rman.rc_backup_set s where s.backup_type in ('I') group by db_id) i, (select db_id, max(START_TIME) log from rman.rc_backup_set s where s.backup_type in ('L') group by db_id) l, (select db_key, max(completion_TIME) ctl from rman.rc_backup_controlfile s group by db_key) c where f.db_id(+) = d.dbid and i.db_id(+) = d.dbid and l.db_id(+) = d.dbid and c.db_key(+) = d.db_key order by 1 sample output shown below. NAME FULL INC LOG CTL -------- ----------------- ----------------- ----------------- ----------------- datab1 17-feb-2011:01:09 datab2 29-may-2011:18:30 31-may-2011:18:10 31-may-2