Skip to main content

Posts

Showing posts from July, 2013

find unindexed foreign key columns

I use the following query to find the unindexed columns. column columns format a35 word_wrapped column table_name format a35 word_wrapped col a_column format a35 word_wrapped col b_column format a35 word_wrapped col status format a9 word_wrapped select * from ( select owner,decode( b.table_name, NULL, 'unindexed', 'ok' ) Status,       a.table_name, a.columns a_column, b.columns b_column from ( select a.owner,substr(a.table_name,1,30) table_name,             substr(a.constraint_name,1,30) constraint_name,         max(decode(position, 1,     substr(column_name,1,30),NULL)) ||         max(decode(position, 2,', '||substr(column_name,1,30),NULL)) ||         max(decode(position, 3,', '||substr(column_name,1,30),NULL)) ||         max(decode(position, 4,', '||substr(column_name,1,30),NULL)) ||         max(decode(position, 5,', '||substr(column_name,1,30),NULL)) ||         max(decode(position, 6,', '||substr(column_name

cost of turning off rebalance of ASM diskgroup

One time I turned of the rebalance of ASM diskgroup when adding new disk and forgot about it until the developer told me that they run into error ORA-01653,  unable to extend table in tablespace.   Usually this is caused by a few scenarios(no space on disk, data file reach to max, datafile is not auextensible etc), but this time it's caused by asm disk not balanced. the datafile is 16GB, let me try to extend it to 20GB. 14:14:56 RMS8DEV> alter database datafile 26 resize 20000m; alter database datafile 26 resize 20000m * ERROR at line 1: ORA-01237: cannot extend datafile 26 ORA-01110: data file 26: '+DATA2/rms8dev/datafile/radiostage_data.282.819106481' ORA-17505: ksfdrsz:1 Failed to resize file to size 2560000 blocks ORA-15041: diskgroup "DATA2" space exhausted it failed, but the disk /dev/rhdisk18 has 79GB free space! why cannot I use it? ASMCMD [+] > lsdsk -k Total_MB  Free_MB   OS_MB  Name        Failgroup   Failgroup

duplicate database without rman catalog db

############################################################################ Source db            :               PROG RAC on agcoux169/agcoux170 Auxiliary               :               PROGRM on agcoux136 Date, author      :               July 10, 2013, Jiulu Sun Goal                       :               duplicate PROGRM database from PROG without rman catalog db prerequisite: database and archivelog backup is transferred to auxiliary database server ############################################################################## Reference           :               http://docs.oracle.com/cd/B19306_01/backup.102/b14191/rcmdupdb.htm "By default, the DUPLICATE command creates the duplicate database from the most recent backups of the target database and then performs recovery to the most recent consistent point contained in the archived redo logs. You can duplicate a database as it stood at a past point in time in the current incarnation, by using a RUN block with