Saturday, June 18, 2011

Identify fragmented tables and resolve fragmentation

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com
Problem Description: How to identify fragmented tables

Symptoms

1. Run the below statement to identified fragmented tables

--Query1

-- TABLE Size with Fragmentation
select table_name,round(blocks*8,2)||'kb' "size fragmented" ,round((num_rows*avg_row_len/1024),2)||'kb' "actual size" from dba_tables where owner='ECS';

and 

-- Query2 to order most fragmented tables by size
-- Most Fragmented Tables 

select table_name,round(blocks*8,2) - round((num_rows*avg_row_len/1024),2) " Fragmented Data in KB" from dba_tables where owner='ECS' order by 2 desc;

2. Then on the most fragmented tables and indexes identified from the above statement, Run 

Alter table xx move tablespace xx;
Alter index ee rebuild tablespace ee;

Then I re run the above statements and I noticed not that much space reclaimed from mostly fragmented tables.

Solution:

1. analyze on all the tables of the schema before running the script to get the correct size.

2. Determine fragmented tables by running:

select table_name,round(blocks*8,2)||'kb' "size fragmented" ,round((num_rows*avg_row_len/1024),2)||'kb' "actual size" from dba_tables where owner='ECS';

3. The move table method is the best way to remove fragmentation as much as possible.

4. Fragmentation cannot be completely removed in case there chained/migrated rows.

Chaining
---------
Occurs when the row is too large to fit into one data block when it is first
inserted. In this case, Oracle stores the data for the row in a chain of data 
blocks (one or more) reserved for that segment. Row chaining most often occurs
with large rows, such as rows that contain a column of datatype LONG, LONG RAW,
LOB, etc. Row chaining in these cases is unavoidable.


A row is too large to fit into a single database block. For example, if you use a 4KB block size
for your database,and you need to insert a row of 8KB into it, Oracle will use 3 blocks and store
the row in pieces. Some conditions that will cause row chaining are:

In this case, Oracle stores the data for the row in a chain of data blocks (one or more) reserved 
for that segment.So, instead of just having a forwarding address on one block and the data on another
we have data on two or more blocks.


How you can identify the Chained and Migrated rows ?
=====================================================
You can use the ANALYZE command to list the Chained/Migrated rows in a table, but you should consider the followings:

A-For conventional Non index_organized tables you can create chained-rows table using the following script locally or in another schema:

create table CHAINED_ROWS (
owner_name varchar2(30),
table_name varchar2(30),
cluster_name varchar2(30),
partition_name varchar2(30),
subpartition_name varchar2(30),
head_rowid rowid,
analyze_timestamp date );


Note : If you created the chained-rows table in another schema then in the analyze command prefix the name by the schema name.


sql>analyze table <Non IOT > list chained rows into <chained-rows table name> ;

Reference:
Article-ID: Note 337651.1
Title: How to find Objects Fragmentated below High water mark



    
Get Oracle Certifications for all Exams
Free Online Exams.com

'Assertion Failed WExpression: Window !=(ixobj *)0" on Oracle Forms 10.1.2.0.2 version

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com
Problem Description: Getting error 'Assertion Failed WExpression: Window !=(ixobj *)0" on Oracle Forms 10.1.2.0.2 version

Symptoms

1. Following C++ Runtime Library error occurs on the Application Server:

Assertion Failed! Program: ...\oracle\product\10.1.2\asmid_1\bin\frmweb.exe File: C:\forms\1012\src\if\iff\ifrlf.c line:nnn

2. If any question on the dialog error box is answered the OS completely crashes.

3. Problem happens when using Java plug-in. No reports of it occurring with JInitiator.

4. When the error occurs there is no impact on users. (Unless the dialog box is responded to causing the Application Server to crash).

5. The error cannot be traced to any user activity.
Cause :

The C++ Runtime Assertion Failed message is a low level error message. The failure simply means that a variable in the C++ code that was 'asserted' to have a certain value or range of values failed the assertion. This is the reason for the error message, but the high level cause in this particular situation has yet to be determined. There is more than one high level cause for this type of failure


Solution:

For some customers, Oracle has found that the following has resolved the issue:

1. Upgrade to the latest Sun JRE Plug-in version for the Forms client. See -> 10gR2 Statement of Direction http://www.oracle.com/technology/products/forms/htdocs/10gR2/clientsod_forms10gR2.html
2. Apply the latest Forms Focus patch for the Forms version.


References:

Note.271566.1 GO_BLOCK WITH NO WINDOWS OPEN CAUSES ASSERTION FAILURE
Note.196798.1 Web Forms Hangs with Assertion Failed Error
Note.117604.1 Assertion Failed with Exit Forms on Routine ixfs.c 
Note.111595.1 Assertion Failed in File ixfs.c line 67 With Vertical Toolbar in Webforms
Note.559794.1 C++ Runtime Assertion Failed - frmweb.exe File: C:\forms\1012\src\if\iff\ifrlf.c Line nnn



    
Get Oracle Certifications for all Exams
Free Online Exams.com

Webcache and Apache listen ports change to port 80 and use it alone with another port

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com
Problem Description: How to Change to Apache listen port to 80
Solution:

1 - Stop the HTTP Server

2 - Confirm that the port 80 is NOT in use , by [ netstat -an | findstr "80" ]   and check in output the port 80 is not used. [Disable oracle web cache if it is using port 80 and if you are using Oracle Forms]

3 - Edit httpd.conf and change listen port to 80 as follows:

   Port 80
   Listen 80

4 - Edit httpd.conf as below if you want to use more than one port, like 80 and 7778
 
   Port 7778
   Port 80
   Listen 7778
   Listen 80


5 - run >dcmctl updateconfig 

6 - Start the HTTP Server and test the homepage with port 80 and 7778

Reference:

Oracle® Application Server Administrator's Guide 10g Release 2 (10.1.2)  B13995-08
4.3.3 Changing the Oracle HTTP Server Listen Ports
http://download.oracle.com/docs/cd/B14099_19/core.1012/b13995/ports.htm



     
Get Oracle Certifications for all Exams
Free Online Exams.com

udump generates after control autobackup

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com
Problem Description: Starting control autobackup genrates trace files and messages on the alert log file

alert.log showing the below;
Comments
--------
Starting control autobackup
Tue Nov 10 09:20:55 2009
Errors in file \udump\dnadb_ora_3384.trc:

Tue Nov 10 09:20:55 2009
Errors in file \udump\dnadb_ora_3384.trc:

Tue Nov 10 09:20:55 2009
Errors in file \udump\dnadb_ora_3384.trc:

Control autobackup written to DISK device
handle 'E:\BACKUP\RMAN\DNADB\BACKUPSETS\CONTROL_DNADB_C-3965614685-20091110-00.CTL'
Tue Nov 10 09:21:08 2009


Trace file \udump\dnadb_ora_2168.trc shows the following;

FileComment
-----------
Redo thread mounted by this instance: 1

Oracle process number: 23

Windows thread id: 2168, image: ORACLE.EXE (SHAD)


*** 2009-11-16 21:05:59.529
*** ACTION NAME:(0000022 STARTED111) 2009-11-16 21:05:59.404
*** MODULE NAME:(backup full datafile) 2009-11-16 21:05:59.404
*** SERVICE NAME:(SYS$USERS) 2009-11-16 21:05:59.404
*** SESSION ID:(170.14906) 2009-11-16 21:05:59.404
*** 2009-11-16 21:06:22.357
*** ACTION NAME:(0000050 STARTED111) 2009-11-16 21:06:22.357
*** MODULE NAME:(backup archivelog) 2009-11-16 21:06:22.357



Solution:

From the alert.log and trace file there is no error message. Also the control file auto backup completed successfully.
hence you can ignore this message



       
Get Oracle Certifications for all Exams
Free Online Exams.com

Wednesday, June 15, 2011

Resetting the Administrator (oc4jadmin) Password

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com

Problem: Forgot OC4JADMIN password:

If you are maintaining Oracle Application Server 10g Release 3 (10g AS R3)  and you wish to reset OC4JADMIN password , here what you have to do:

1. oc4jadmin is  created during installation and the default password is (secure)

2. This password is stored in encrypted format in file $ORACLE_HOME/j2ee/home/config/system-jazn-data.xml


3.Stop OC4J and the Application Server Control.
Enter the following command in the Oracle home of the application server instance:
(UNIX) ORACLE_HOME/opmn/bin/opmnctl stopproc ias-component=OC4J 
4. Locate and open the following file in a text editor:Locate the line that defines the credentials property for the oc4jadmin user. 

<user>
<name>oc4jadmin</name>
<display-name>OC4J Administrator</display-name>
<description>OC4J Administrator</description>
<credentials>{903}4L50lHJWIFGwLgHXTub7eYK9e0AnWLUH</credentials>
</user>
Replace the existing encrypted password with the new password.
Be sure to prefix the password with an exclamation point (!). For example:

5. 
Delete cached password data by deleting the contents of the following directory:
ORACLE_HOME/j2ee/oc4jinstance/persistence/ascontrol/ascontrol/securestore/
6.
Start OC4J and the Application Server Control.
After the restart, the Application Server Control will use your new Administrator (oc4jadmin) password, which will be stored in encrypted format within the system-jazn-data.xml file.

<credentials>!mynewpassword123</credentials>

(UNIX)ORACLE_HOME/j2ee/home/config/system-jazn-data.xml
    
Get Oracle Certifications for all Exams
Free Online Exams.com

OPMN Report Error 'BAD STRING' When Checking the Apps Services Status on Solaris

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com
Problem: OPMN Report Error 'BAD STRING' When Checking the Apps Services Status on Solaris
 cd $ADMIN_SCRIPTS_HOME

./adopmnctl.sh status & ./adapcctl.sh fails with the following error:


./adopmnctl.sh status

You are running adopmnctl.sh version 120.4.12000000.3

Checking status of OPMN managed processes...
Bad string
Unable to connect to opmn.
Opmn may not be up.

adopmnctl.sh: exiting with status 0

*******

Cause:

The opmnctl script makes use of the UNIX command "tr" as

MODIFIED_ORA_CONFIG_HOME="`echo $ORACLE_CONFIG_HOME | tr -d "[:space:]"`"

While running adopmnctl.sh, the environment file .env under $ORA_CONFIG_HOME/10.1.3 is sourced.
.env gets instantiated from template iAS_1013_env.tmp under $AD_TOP.

The template file has env variable PATH variable defined as $ORACLE_HOME/bin:$ORACLE_CONFIG_HOME/opmn/bin:$ORACLE_CONFIG_HOME/Apache/Apache/bin:$ORACLE_HOME/Apache/Apache/bin:$ORACLE_HOME/oui/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/appsutil/jdk/bin:$ORACLE_HOME/jdk/jre/bin:$ORACLE_HOME/perl/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:$PATH"

The "tr" command from /usr/bin is picked up for execution as per the PATH environment variable. As per Solaris documentation mentioned below to use "tr" command, /usr/xpg4/bin should be used. This is the root cause of the bug.

On Solaris, if the command "tr" from /usr/bin is used, the character class expressions "[:space:]" is not recognized in multibyte support environment (MSE).
As per Solaris documentations, in such cases, the "tr" command from /usr/xpg4/bin should be used.


For Solaris documentation:
You can see the note below in manual pages for tr command by executing `man tr` command.

Note: /usr/bin/tr supports character class expressions only in singlebyte locales. Use /usr/xpg4/bin/tr to support these expressions in any locale.



Solution:


Take backup for /usr/bin/tr
copy /usr/xpg4/bin/tr /usr/bin


    
Get Oracle Certifications for all Exams
Free Online Exams.com

OPMN is not start while applying patch 10.1.3.5 stops at 83%

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com
Problem:OPMN is not start while applying patch 10.1.3.5 stops at 83%

While Upgrading to the Latest OracleAS 10g 10.1.3.x Patch Set in Oracle E-Business Suite Release 12 [ID 454811.1] 

Installer gave an error as show below exactly when reaching 83%

#########
OPMN is failing to start. OPMN must be started in order to correctly install and configure the patchset. Please start OPMN manually in order to continue with the patchset installation.
#########





$IAS_ORACLE_HOME/opmn/bin/opmnctl is trying to read opmn.xml from path pointed by $ORACLE_CONFIG_HOME which points to 10.1.2 home instead opmnctl should need 10.1.3 home
Do below:
Point ORACLE_CONFIG_HOME to 10.1.3 home and test by running the below command before running the installer again.
$IAS_ORACLE_HOME/opmn/bin/opmnctl status (or) startall
Export the environment variable before invoking runinstaller and this should be able to bypass the issue.

Solution:
$ echo $ORACLE_CONFIG_HOME
/erpapp/aderp/inst/apps/adtmp_erptest-temp/ora/10.1.2
$ export ORACLE_CONFIG_HOME=/erpapp/aderp/inst/apps/adtmp_erptest-temp/ora/10.1.3
$ echo $ORACLE_CONFIG_HOME
/erpapp/aderp/inst/apps/adtmp_erptest-temp/ora/10.1.3


Run the installer again and you will pass the 83% error.


      



Get Oracle Certifications for all Exams
Free Online Exams.com