Saturday, December 11, 2010

RAID levels

RAID 0: block-level striping without parity or mirroring.
RAID 1: mirroring without parity or striping.
RAID 2: bit-level striping with dedicated Hamming-code parity.
RAID 3: byte-level striping with dedicated parity. Hot parity disk.
RAID 4: block-level striping with dedicated parity. Hot parity disk.
RAID 5: block-level striping with distributed parity. Tolerate single disk failure.
RAID 6: block-level striping with double distributed parity. Tolerate double disk failure.

Commonly used: RAID 5 or combination of RAID 0 and 1.

RAID 0+1: striped sets in a mirrored set. Strip first, then mirror.
RAID 1+0: mirrored sets in a striped set. Mirror first, then strip.
RAID 5+0:
RAID 5+1: mirrored striped set with distributed parity.

For database: RAID1+0 and RAID 5.

REF:
http://en.wikipedia.org/wiki/RAID

How to clear java cache

1. clear all caches

cd $COMMON_TOP/_pages

cat refresh_cache.sh
rm -r _oa__html.old _oa__java.old
mv _oa__html _oa__html.old
mv _oa__java _oa__java.old
mkdir _oa__html _oa__java

2. clear OA Framework cache
• Go to "Functional Administrator" responsibility.
• Under tab "Core Services" -> click on "Caching Framework"
• Click on " Global Configuration"
• Click "Clear ALL Cache"

3. Bounce the Apache server

drop six internal controls manager flexfields

Compile flexfield: adadmin (3,3) or

/data/appldev/11i/fnd/11.5.0/bin/fdfcmp APPS/***** 0 Y

Following flexfield got compilation error:
AMW_AP_ATTR_GROUP_TYPE
AMW_CONSTRAINT_ATTR_GROUP_TYPE
AMW_CTRL_ATTR_GROUP_TYPE
AMW_PROCESS_ATTR_GROUP_TYPE
AMW_PROC_ORG_ATTR_GROUP_TYPE
AMW_RISK_ATTR_GROUP_TYPE


---------------------------------------------------------
Application Id: 242
Short Name: AMW
Name: Internal Controls Manager
Flexfield Name: AMW_AP_ATTR_GROUP_TYPE
Title: Audit Procedure

Compilation aborted for current descriptive flexfield...

APP-FND-00854: FDFBDF: Cannot find descriptive column information.
APP-FND-01564: ORACLE error 1403 in FDFBCO

Cause: FDFBCO failed due to ORA-01403: no data found.

The SQL statement being executed at the time of the error was: and was executed from the file &ERRFILE.

Continuing...

---------------------------------------------------------
Application Id: 242
Short Name: AMW
Name: Internal Controls Manager
Flexfield Name: AMW_CONSTRAINT_ATTR_GROUP_TYPE
Title: Constraint

Compilation aborted for current descriptive flexfield...

APP-FND-00854: FDFBDF: Cannot find descriptive column information.
APP-FND-01564: ORACLE error 1403 in FDFBCO

Cause: FDFBCO failed due to ORA-01403: no data found.

The SQL statement being executed at the time of the error was: and was executed from the file &ERRFILE.

Continuing...

---------------------------------------------------------
Application Id: 242
Short Name: AMW
Name: Internal Controls Manager
Flexfield Name: AMW_CTRL_ATTR_GROUP_TYPE
Title: Control

Compilation aborted for current descriptive flexfield...

APP-FND-00854: FDFBDF: Cannot find descriptive column information.
APP-FND-01564: ORACLE error 1403 in FDFBCO

Cause: FDFBCO failed due to ORA-01403: no data found.

The SQL statement being executed at the time of the error was: and was executed from the file &ERRFILE.

Continuing...

---------------------------------------------------------
Application Id: 242
Short Name: AMW
Name: Internal Controls Manager
Flexfield Name: AMW_PROCESS_ATTR_GROUP_TYPE
Title: Risk Library Process

Compilation aborted for current descriptive flexfield...

APP-FND-00854: FDFBDF: Cannot find descriptive column information.
APP-FND-01564: ORACLE error 1403 in FDFBCO

Cause: FDFBCO failed due to ORA-01403: no data found.

The SQL statement being executed at the time of the error was: and was executed from the file &ERRFILE.

Continuing...

---------------------------------------------------------
Application Id: 242
Short Name: AMW
Name: Internal Controls Manager
Flexfield Name: AMW_PROC_ORG_ATTR_GROUP_TYPE
Title: Organization Process

Compilation aborted for current descriptive flexfield...

APP-FND-00854: FDFBDF: Cannot find descriptive column information.
APP-FND-01564: ORACLE error 1403 in FDFBCO

Cause: FDFBCO failed due to ORA-01403: no data found.

The SQL statement being executed at the time of the error was: and was executed from the file &ERRFILE.

Continuing...

---------------------------------------------------------
Application Id: 242
Short Name: AMW
Name: Internal Controls Manager
Flexfield Name: AMW_RISK_ATTR_GROUP_TYPE
Title: Risk

Compilation aborted for current descriptive flexfield...

APP-FND-00854: FDFBDF: Cannot find descriptive column information.
APP-FND-01564: ORACLE error 1403 in FDFBCO

Cause: FDFBCO failed due to ORA-01403: no data found.

The SQL statement being executed at the time of the error was: and was executed from the file &ERRFILE.

Continuing...

---------------------------------------------------------
Application Id: 242
Short Name: AMW
Name: Internal Controls Manager
Flexfield Name: AMW_WORK_ATTR_GROUP_TYPE
Title: Work

Compilation was successful for current descriptive flexfield.


Run afdff040_amw.sql from oracle support (SR #3-1515967891: AMW flexfield compilation error for bug 9748057) and then compiling the flexfield again. No issues.

/**/
REM $Header: afdff040.sql 115.14.1151.5 2002/02/20 10:48:00 pkm ship $

REM dbdrv: none

REM +======================================================================+
REM | Copyright (c) 1999 Oracle Corporation Redwood Shores, California, USA|
REM | All rights reserved. |
REM +======================================================================+
REM NAME
REM afdff040.sql
REM DESCRIPTION
REM Drops obsolete/re-created flexfields of all products
REM
REM NOTES
REM
REM HISTORY
REM 02/18/2002 nlo Removed GL_JE_SOURCES,GL_JE_CATEGORIES
REM 02/29/00 ssung Included MRP_SEIBAN_NUMBERS,
REM MRP_PROJECT_PARAMERTERS,
REM GL_CHARTS_OF_ACCOUNTS.
REM 02/03/00 nlo Added AK flexfields
REM 02/01/00 nlo Added JG flexfield contexts
REM 01/17/00 ssung fixes for Bug#1151660
REM 11/09/99 ssung Added AP_LOOKUP_CODES,
REM AS_WORD_PROCESSORS,
REM BOM_STANDARD_COMMENTS,
REM BOM_STANDARD_INSTRUCTIONS,
REM GL_JE_SOURCES, GL_JE_CATEGORIES,
REM AP_EFT_POPUP, AP_DIST_SET_PA_POPUP,
REM AP_PO_NUM_POPUP, AP_LOOKUP_CODES,
REM AP_DIST_PA_POPUP, AP_INV_PA_POPUP
REM 10/28/99 nlo Added JA obsolete descriptive flexfields
REM 10/26/99 nlo Added JG obsolete Flexfield Contexts
REM 10/08/99 nlo Added JA obsolete Flexfield Contexts & JG flexfields
REM 09/15/99 ssung Added some obsolete Flexfield Contexts,
REM list provided by kmaheswa
REM 08/16/99 Murali Added obsolete JL descriptive flexfields
REM 06/25/99 Nlo Deleted JG obsolete descriptive flexfields
REM and specific contexts
REM 05/03/99 Murali Added obsolete descriptive flexfield
REM 04/21/99 Golgun OTHERS exception handlers, and
REM set_session_mode calls are added.
REM 03/08/99 Murali Added obsolete descriptive flexfields
REM 08/28/98 Murali Re-wrote this script as procedures
REM 08/15/97 Murali Created
REM +======================================================================+

SET VERIFY OFF
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;

REM Descriptive FlexFields

set serveroutput on size 20000;

declare

procedure delete_dsc_flexfield(p_prod IN varchar2,
p_desc_flex IN varchar2)
is
begin

fnd_flex_dsc_api.delete_flexfield(appl_short_name => p_prod,
flexfield_name => p_desc_flex);

exception
when others then
dbms_output.put_line('Flexfield '||p_desc_flex||' for '||
p_prod||' does not exist');
null;
end;

procedure delete_key_flexfield(p_prod IN varchar2,
p_key_flex IN varchar2)
is
begin

fnd_flex_key_api.delete_flexfield(appl_short_name => p_prod,
flex_code => p_key_flex);

exception
when others then
dbms_output.put_line('Flexfield '||p_key_flex||' for '||
p_prod||' does not exist');
null;
end;

procedure delete_key_flex_segment(
p_prod IN varchar2,
p_flexname IN varchar2,
p_structure IN varchar2,
p_segment IN varchar2)
is
l_segment fnd_flex_key_api.segment_type;
l_flexfield fnd_flex_key_api.flexfield_type;
l_structure fnd_flex_key_api.structure_type;
begin

begin
l_flexfield := fnd_flex_key_api.find_flexfield(p_prod, p_flexname);
exception
when no_data_found then
dbms_output.put_line('Flex '||p_flexname||' does not exist');
return;
end;

begin
l_structure := fnd_flex_key_api.find_structure(l_flexfield,
p_structure);
exception
when no_data_found then
dbms_output.put_line('Structure '||p_structure||' not found in '||
p_flexname);
return;
end;

begin
l_segment := fnd_flex_key_api.find_segment(
l_flexfield,
l_structure,
p_segment);

fnd_flex_key_api.delete_segment(l_flexfield, l_structure, l_segment);

exception
WHEN no_data_found THEN
dbms_output.put_line('Flex segment '||p_segment||' does not exist');
end;
exception
WHEN others THEN
dbms_output.put_line('delete_key_flex_segment is failed.');
end;


procedure delete_dsc_context(p_prod IN varchar2,
p_desc_flex IN varchar2,
p_desc_ctxt IN varchar2)
is
begin

fnd_flex_dsc_api.delete_context(appl_short_name => p_prod,
flexfield_name => p_desc_flex,
context => p_desc_ctxt);

exception
when others then
dbms_output.put_line('Flexfield '||p_desc_flex||' with context '||
p_desc_ctxt || ' for '|| p_prod||' does not exist');
null;
end;

begin
fnd_flex_dsc_api.set_session_mode('customer_data');
delete_dsc_flexfield('AMW','AMW_AP_ATTR_GROUP_TYPE');
delete_dsc_flexfield('AMW','AMW_CONSTRAINT_ATTR_GROUP_TYPE');
delete_dsc_flexfield('AMW','AMW_CTRL_ATTR_GROUP_TYPE');
delete_dsc_flexfield('AMW','AMW_PROCESS_ATTR_GROUP_TYPE');
delete_dsc_flexfield('AMW','AMW_PROC_ORG_ATTR_GROUP_TYPE');
delete_dsc_flexfield('AMW','AMW_RISK_ATTR_GROUP_TYPE');

-- Descriptive FlexField Segments

---No segments created in customer environment

-- Flexfield Contexts

exception
when others then
dbms_output.put_line('afdff040.sql failed.');
end;
/
/*{TOAD_FILE_CHUNK}*/

commit;
exit;

enable or disable low-level logging

Enable low-level logging

1. change system profile FND: Debug Log level from unexpected to statement
2. change system profile FND: Debug Log Enabled from No to Yes.

When testing begins, run following:

Select max(log_sequence) from apps.fnd_log_messages

When testing ends, run:
Above again.

Then run

Select * from apps.fnd_log_messages where log_sequence between {from} to {to} and messages_text like ‘PrintAM%’

Above is trouble-shooting java class PrintAM.

The other choice is to use TIMESTAMP.

Reset back to original values for the system profiles after testing as there are performance impacts.

backup and recovery (2) -- recovery from rollback segment corruption when in noarchive mode

1) Backup the database while the database is closed.

THE INSTRUCTIONS HERE ARE DESTRUCTIVE. YOU ARE STRONGLY ADVISED TO BACKUP THE DATABASE BEFORE PROCEEDING. IF YOU DO NOT DO THIS YOU MAY LOSE THE CHANCE TO TRY OTHER OPTIONS.


2) If your datafiles are from different points in time, it is best to try to use system tablespace datafiles at a similar timestamp to the OLDEST files you have online in the database. This reduces the chance that you will get problems during the bootstrap phase of opening the database.

3) Edit your *init.ora file to change undo_management and add one parameter.

* Change UNDO_MANAGEMENT=AUTO to UNDO_MANAGEMENT=MANUAL
* Remove or comment out UNDO_TABLESPACE and UNDO_RETENTION.

* Add

_OFFLINE_ROLLBACK_SEGMENTS =(comma separated list of Automatic Undo segments)

Example:

_OFFLINE_ROLLBACK_SEGMENTS = (_SYSSMU1$, _SYSSMU2$, _SYSSMU3$, _SYSSMU4$, _SYSSMU5$, _SYSSMU6$, _SYSSMU7$, _SYSSMU8$, _SYSSMU9$, _SYSSMU10$)

(There are 25 system managed undo segments in OAICM)

Note, sometimes the alert log will tell you what Automatic Undo segments are in use. Search the alert log for SYSS. If the alert log does not contain that information then use _SYSSMU1$ through _SYSSMU10$ as shown in the example above.

In UNIX you can issue this command to get the undo segment names:

$ strings system01.dbf | grep _SYSSMU | cut -d $ -f 1 | sort -u

From the output of the strings command above, add a $ to end of each _SYSSMU undo segment name.

* If you only have a spfile available, you can from the closed, nomount or the mount stage create an init.ora file as follows:

SQL> CREATE PFILE FROM SPFILE;

Do NOT edit the SPFILE.

4) Invoke SQL*Plus, startup mount, check that correct init.ora was used and all datafiles are in the status of online or system.

$ sqlplus "/as sysdba"

SQL> startup mount pfile = (full path / file name to init.ora)

Example:
SQL> startup mount pfile=/db00/db04/oracle/oaicmdb/9.2.0/dbs/initOAICM.ora.forrecovery

Confirm that the hidden parameters from step 3 were used:

SQL> show parameters offline

You should see the hidden parameter listed. If not, the wrong init.ora may have been modified. Do not continue until "show parameters corrupt" shows the hidden parameter.

SQL> show parameters undo

You should see undo management set to manual. If not, the wrong init.ora may have been modified. Do not continue until "show parameters undo" shows undo management as manual.

5) Alter database datafile 'undo datafile' offline drop;

example: alter database datafile ‘/db00/db04/oracle/oaicmdata/undo01.dbf’ offline drop;

6) alter database open;

6) drop all rollback segment with status need recovery:

select owner,segment_name,status
from dba_rollback_segs;

drop rollback segment "_SYSSMU1$"; -- 10 system undo segments were dropped.


7) drop tablespace including contents and datafiles;

example: drop tablespace apps_undots1 including contents and datafiles;

8) create undo tablespace apps_undots1 datafile ‘/db00/db04/oracle/oaicmdata/undo01.dbf’ size 1000m resuse autoextend on next 100m maxsize 8000m.

9) shutdown the database

10) change the following parameters in the init.ora :
UNDO_MANAGEMENT=AUTO
#_OFFLINE_ROLLBACK_SEGMENTS=(_SYSSMU1$, _SYSSMU2$, _SYSSMU3$, ...etc)

11) startup



12) best practice:
Put a copy of controlfile and online redo logs on local (internal) disk to prevent from database corruption due to temporary storage problems.

add and delete nodes for a RAC

Add a new node to the RAC

1. install and config OS and hardware for new node
$ cluvfy stage –pre crsinst –n node1,node2 –r 10gR2
2. add Oracle Clusterware to the new node
$ $CRS_ORACLE_HOME/oui/bin/addNode.sh (run this on the first node)

Open a new OS window to run $CRS_ORACLE_HOME/install/rootaddnode.sh on the first node).

On the new node, run $ORACLE_HOME/root.sh which will start Clusterware stack and run VIPCA to configure nodeapps.

3. configure ONS for the new node
cat $CRS_ORACLE_HOME/opmn/conf/ons.config on the first node
$CRS_ORACE_HOME/bin/racgons add_config {new node}:{
4. add ASM home to the new node
On the first node, run $ASM_ORACLE_HOME/oui/bin/addNode.sh, then run $ASM_ORACLE_HOME/root.sh on the new node.

5. add RAC home to the new node
On the first node, run $ORACLE_HOME/oui/bin/addNode.sh, then run $ORACLE_HOME/root.sh on the new node.

6. add a listener to the new node
run netca to add a listener: LISTENER_{New Node Name} on the new node.

7. add a database instance to the new node
run dbca on the first node.

Delete a node from the RAC

1. delete the instance on the node to be deleted.
Run dbca on the node to be deleted.

2. clean up the ASM instance
srvctl stop asm –n {node to be deleted}
srvctl remove asm –n {node to be deleted}
rm –f $ASM_ORACLE_HOME/dbs/*ASM*
rm –rf $ASM_ORACLE_HOME/admin/+ASM

3. remove the listener from the node to be deleted.
Run netca from the node to be deleted.

4. remove the node from the database
4.1 update inventory
on the node to be removed
$ORACLE_HOME/oui/bin/runInstaller –updateNodeList ORACLE_HOME={database home} “CLUSTER_NODES={node to be removed}” -local
On the remaining nodes
$ORACLE_HOME/oui/bin/runInstaller –updateNodeList
ORACLE_HOME={database home} “CLUSTER_NODES={remaining nodes}”

4.2 remove the database software installation
./runInstaller

5. remove the node from ASM
repeat step 4 for ASM home.

6. remove ONS configuration from the node to be deleted.
On the first node:
$CRS_ORACLE_HOME/bin/racgons remove_config {node to be removed}:{remote port}

7. remove the node from the clusterware.
As root: on the node to be removed
$CRS_ORACLE_HOME/install/rootdelete.sh
As root: on the first node
$CRS_ORACLE_HOME/bin/olsnodes –n ##to delete node number to be deleted
$CRS_ORACLE_HOME/install/rootdeletenode.sh

On the node to be deleted
$CRS_ORACLE_HOME/oui/bin/runInstaller –updateNodeList ORACLE_HOME={CRSOH} “CLUSTER_NODES={node to be deleted}” CRS=TRUE -local

On the first node
$CRS_ORACLE_HOME/oui/bin/runInstaller –updateNodeList
ORACLE_HOME={CRSOH} “CLUSTER_NODES={remaining nodes}”
CRS=TRUE

Verify
srvctl status nodeapps –n {deleted node}
crs_stat | grep –i {deleted node}
olsnodes –n

change VIP address

1. determine the interface used to support the VIP
$ ifconfig –a

2. stop all resources depending on the VIP
$ srvctl stop instance –d DBRAC –i DB1
$ srvctl stop asm –n node1
$ srvctl stop nodeapps –n node1

3. verify that the VIP is no longer running
$ ifconfig –a
And/Or
$ crs_stat

4. change IP in /etc/hosts and DNS

5. modify the VIP address using srvctl
$ srvctl modify nodeapps –n node1 –A 192.168.2.125/255.255.255.0/eth0

6. start nodeapps and all resources depending on it
$ srvctl start nodeapps –n node1