Archive for February, 2012

Whenever sysaux goes to recovery state, you won’t be able to do the exp or expdp. You will get error like ‘not able to read/write sysaux’ datafiles. If you don’t have the archivelog to recover the sysaux, then you can follow below steps to atleast get the exp work. expdp doesn’t work still.

Shutdown immediate;

startup upgrade

@?/rdbms/admin/catnoqm.sql

shutdown immediate

startup

There you go, your export will work. Pls note, you may have to rebuild to have perfect system.

convert this post to pdf.

“SMON: parallel recovery restart with degree=0 (!=32)”

We were doing imp on a table populating many millions of records. In the middle i have killed and restarted the import. The sequent import went slow, when checked noticed below event in v$session

“wait for stopper event to be increased”

This event is because of parallel rollback of the previous import.

We disabled the behaviour using below command and restart the db.
alter system set fast_start_parallel_rollback = false scope=spfile;

import stated going fast.

convert this post to pdf.

CREATE TABLE TAB1
(
“TAB1_KEY” NUMBER,
“NUMB1″     NUMBER,
“ACTION_DT” DATE,
“USER_ID”     VARCHAR2(60 BYTE),
“ACTION”      VARCHAR2(1500 BYTE)
);

CREATE TABLE TAB_HIST
(
“ACTION_DT” DATE,
“USER_ID”     VARCHAR2(60 BYTE),
“ACTION”      VARCHAR2(1500 BYTE)
);

– Compound Trigger

create or replace
TRIGGER TRG_TAB1_INSERT
FOR INSERT ON TAB1
COMPOUND TRIGGER

BEFORE STATEMENT IS
BEGIN
INSERT INTO TAB_HIST(ACTION_DT,USER_ID,action) VALUES(SYSDATE,’Trigger’,'START BEFORE STATEMENT’);
–    NULL; — Do something here.
INSERT INTO TAB_HIST(ACTION_DT,USER_ID,action) VALUES(SYSDATE,’Trigger’,'END BEFORE STATEMENT’);

END BEFORE STATEMENT;

BEFORE EACH ROW IS
BEGIN
INSERT into TAB_HIST(ACTION_DT,USER_ID,action) values(sysdate,’Trigger’,'START BEFORE EACH ROW’);

INSERT into TAB_HIST(ACTION_DT,USER_ID,action) values(sysdate,’Trigger’,'END BEFORE EACH ROW’);
END BEFORE EACH ROW;

AFTER EACH ROW IS
BEGIN
INSERT into TAB_HIST(ACTION_DT,USER_ID,action) values(sysdate,’Trigger’,'START  AFTER EACH ROW’);

INSERT INTO TAB_HIST(ACTION_DT,USER_ID,action) VALUES(SYSDATE,’Trigger’,'END AFTER EACH ROW’);
END AFTER EACH ROW;

AFTER STATEMENT IS
BEGIN
INSERT into TAB_HIST(ACTION_DT,USER_ID,action) values(sysdate,’Trigger’,'START AFTER STATEMENT’);

INSERT into TAB_HIST(ACTION_DT,USER_ID,action) values(sysdate,’Trigger’,'END AFTER STATEMENT’);
END AFTER STATEMENT;

END TRG_TAB1_INSERT;

– Test execution of the inserts in loop
BEGIN
FOR  i in 1..5
LOOP
INSERT INTO TAB1 (TAB1_KEY,ACTION_DT,ACTION) values(123,sysdate,’Tested’);
END LOOP;
COMMIT;
END;
/

in 11gR2:
SQL> select count(*) from TAB_HIST;

COUNT(*)
———-
40

in 11.1.0.7

SQL> select count(*) from TAB_HIST;

COUNT(*)
———-
8

11.1.0.7, version has lot of know bug with compound triggers.

This issue is fixed in below patch,
Patch 8850303: ORA-600 [PEVMEXE.C: BREAK: BUG 281522 : HIT OPCODE BREAK] – COMPOUND TRIGGER

convert this post to pdf.

There is marginal spike in the data transfer over the network when we were testing for 11g migration. On investigation we figured out that 11g on some platform will be sending more data compared to 9i

 

9i DB with explicite 4K SDU SIZE :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[03-DEC-2011 20:31:03:968] nspsend: 106 bytes to transport ⎝ most likely write size. Some reason read size is not captured in 9i.
[03-DEC-2011 20:31:03:968] nspsend: packet dump
[03-DEC-2011 20:31:03:968] nspsend: 00 6A 00 00 06 00 00 00  |.j……|
[03-DEC-2011 20:31:03:968] nspsend: 00 00 11 69 27 01 01 01  |…i’…|
[03-DEC-2011 20:31:03:968] nspsend: 01 03 03 5E 28 02 80 61  |…^(..a|
[03-DEC-2011 20:31:03:968] nspsend: 00 01 01 2D 01 01 0C 00  |…-….|
[03-DEC-2011 20:31:03:968] nspsend: 01 00 01 01 00 00 00 00  |……..|
[03-DEC-2011 20:31:03:968] nspsend: 00 00 00 01 01 00 2D 73  |……-s|
[03-DEC-2011 20:31:03:968] nspsend: 65 6C 65 63 74 20 2A 20  |elect.*.|
[03-DEC-2011 20:31:03:968] nspsend: 66 72 6F 6D 20 64 62 61  |from.dba|
[03-DEC-2011 20:31:03:968] nspsend: 5F 6F 62 6A 65 63 74 73  |_objects|
[03-DEC-2011 20:31:03:968] nspsend: 20 77 68 65 72 65 20 72  |.where.r|
[03-DEC-2011 20:31:03:968] nspsend: 6F 77 6E 75 6D 20 3C 20  |ownum.<.|
[03-DEC-2011 20:31:03:968] nspsend: 32 30 30 30 01 01 00 00  |2000….|
[03-DEC-2011 20:31:03:968] nspsend: 00 00 00 00 01 01 00 00  |……..|
[03-DEC-2011 20:31:03:968] nspsend: 00 00                    |..      |
[03-DEC-2011 20:31:03:968] nspsend: normal exit

11g DB with explicite 4K SDU SIZE:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(388201200) [03-DEC-2011 10:18:54:083] nttfpwr: entry
(388201200) [03-DEC-2011 10:18:54:083] nttfpwr: socket 8 had bytes written=306 ⎝ write size. In 9i it’s 106 bytes.
(388201200) [03-DEC-2011 10:18:54:083] nttfpwr: exit
(388201200) [03-DEC-2011 10:18:54:083] nsbasic_bsd: packet dump
(388201200) [03-DEC-2011 10:18:54:084] nsbasic_bsd: 01 32 00 00 06 00 00 00  |.2……|
..
(388201200) [03-DEC-2011 10:18:54:084] nsbasic_bsd: 00 00 00 00 00 00 00 00  |……..|
(388201200) [03-DEC-2011 10:18:54:084] nsbasic_bsd: 2D 73 65 6C 65 63 74 20  |-select.|
(388201200) [03-DEC-2011 10:18:54:084] nsbasic_bsd: 2A 20 66 72 6F 6D 20 64  |*.from.d|
(388201200) [03-DEC-2011 10:18:54:084] nsbasic_bsd: 62 61 5F 6F 62 6A 65 63  |ba_objec|
(388201200) [03-DEC-2011 10:18:54:084] nsbasic_bsd: 74 73 20 77 68 65 72 65  |ts.where|
(388201200) [03-DEC-2011 10:18:54:084] nsbasic_bsd: 20 72 6F 77 6E 75 6D 20  |.rownum.|
(388201200) [03-DEC-2011 10:18:54:084] nsbasic_bsd: 3C 20 32 30 30 30 01 00  |<.2000..|
(388201200) [03-DEC-2011 10:18:54:084] nsbasic_bsd: 00 00 00 00 00 00 00 00  |……..|
..
(388201200) [03-DEC-2011 10:18:54:084] nsbasic_bsd: 00 00                    |..      |
(388201200) [03-DEC-2011 10:18:54:084] nsbasic_bsd: exit (0)
(388201200) [03-DEC-2011 10:18:54:084] nsbasic_brc: entry: oln/tot=0
(388201200) [03-DEC-2011 10:18:54:084] nttfprd: entry
(388201200) [03-DEC-2011 10:18:54:116] nttfprd: socket 8 had bytes read=1393 ⎝ Read bytes
(388201200) [03-DEC-2011 10:18:54:116] nttfprd: exit

Seems like 11g is sending more data. After further investigation looks like windows and linux is sending more data compared to solari and aix.

convert this post to pdf.

There will be cases where number of tracefiles generation will be huge in some of environments. In 11g instead of using log clearing script we can use the incident packing service (adrci) to control purging policy.  But default, itís 30 days for trace files and 1 years for rest of the files.

$ adrci

ADRCI: Release 11.2.0.2.0 – Production on Tue Oct 18 08:02:01 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

ADR base = “/u01/app/oracle”
adrci>

adrci> show homes
ADR Homes:
diag/rdbms/orcl/orcl1

adrci> set home diag/rdbms/orcl/orcl1

adrci> set control (SHORTP_POLICY = <number of hrs to retain>)

adrci> set control (LONGP_POLICY = <number of hrs to retain>)

SHORTP_POLICY is for trace directory and LONGP_POLICY for rest of the directories like CDUMP,HM,INCIDENT etc.,

If you want to manually purge files older than 2 days(2880 mins) then,

adrci> purge -age 2880 -type incident
adrci> purge -age 2880 -type ALERT
adrci> purge -age 2880 -type TRACE
adrci> purge -age 2880 -type CDUMP
adrci> purge -age 2880 -type HM

convert this post to pdf.