Showing posts with label Database. Show all posts
Showing posts with label Database. Show all posts

Thursday, May 5, 2011

During an 11GR2 DB installation Solaris OS Patch 124861-15 missing




If you are not installing the Pro*C precompiler, this message can be safely ignored by checking the box "Ignore all" and pressing "Next" and continue with installation.

If you wish to install the Pro*C precompiler, please install Sun Studio 12 plus patch 124861-15 (NOT Sun Studio 12 Update 1) before installing the Oracle software

Ref - BUG:9214210

Thanks to Metalink note id - 969497.1

Thursday, October 14, 2010

New System Privilege 'SYSASM' to manage ASM instance in 11g

Hello All,

Today when I was trying to shutdown a 11g ASM instance connected as sysdba it was not allowing me to shutdown and gave 'ORA-01031: insufficient privileges'.

After a bit of research found that in 11g there is a new privilege called 'SYSASM' which is separate for ASM storage administration privilege and for maintaining ASM instance.The basic idea was to separate the storage administrator and the database administrator responsbilities.

Below is what I was trying to do.


[oracle@oelbox1 ~]$ echo $ORACLE_SID
+ASM

[oracle@oelbox1 ~]$ ps -ef | grep -i pmon
oracle 11810 1 0 18:58 ? 00:00:00 asm_pmon_+ASM
oracle 22821 22724 0 22:19 pts/5 00:00:00 grep -i pmon

[oracle@oelbox1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Thu Oct 14 22:19:07 2010
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Automatic Storage Management option

SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
+ASM

SQL> shutdown immediate
ORA-01031: insufficient privileges
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Pr oduction
With the Automatic Storage Management option

[oracle@oelbox1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.2.0 Production on Thu Oct 14 22:19:46 2010
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SQL> connect sys as sysasm
Enter password:
Connected.
SQL>
SQL> shut immediate
ASM diskgroups volume disabled
ASM diskgroups dismounted
ASM instance shutdown
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Pr oduction With the Automatic Storage Management option

Wednesday, June 30, 2010

Storage Migration on OCR and Voting Disk



Dear Viewer,

Recently I have done with renaming of OCR and Voting Disks during the Storage Migration.

Here are the high level action plan which I performed in our Non-Prod RAC instances as root user,

OCR :
===

ocrcheck
ocrconfig -export /oracle/export/CRS/OCR_Backup -s online <-- Taking OCR Backup -- Monitor the recent log file under $CRS_Home/log//client
ocrconfig -replace ocr /dev/mapper/tst-db-01-02_cluster_ocr_001_1000M
-- Monitor the recent log file under $CRS_Home/log//client
ocrconfig -replace ocrmirror /dev/mapper/tst-db-01-02_cluster_ocrmirr_002_1000M
-- Monitor the recent log file under $CRS_Home/log//client
ocrcheck

VOTING DISK :
============

crsctl stop crs
crsctl query css votedisk
crsctl add css votedisk /dev/mapper/tst-db-01-02_cluster_vote_003_1000M -force
crsctl add css votedisk /dev/mapper/tst-db-01-02_cluster_votemirr_004_1000M -force
crsctl delete css votedisk /dev/mapper/oraMFGSTGclus02_1708_42B2_voting_1000 -force
crsctl delete css votedisk /dev/mapper/oraMFGSTGclus02_1708_42B2_voting_1000 -force
crsctl start crs

-- Monitor /var/log/message file for any errors.

Session Log :
===========

Getting Current Status Information :
==================================

[root@tst-db-01 crs_home]# export PATH=$PATH:/oracle/product/crs_home/bin
[root@tst-db-01 crs_home]# clear
[root@tst-db-01 crs_home]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 1048040
Used space (kbytes) : 3636
Available space (kbytes) : 1044404
ID : 1397237804
Device/File Name : /dev/mapper/MFGSTGclus02_1708_42B6_ocr_1000
Device/File integrity check succeeded
Device/File Name : /dev/mapper/MFGSTGclus02_1708_42B0_ocr_mirror1_1000
Device/File integrity check succeeded

Cluster registry integrity check succeeded

[root@tst-db-01 crs_home]# crsctl query css votedisk
0. 0 /dev/mapper/oraMFGSTGclus02_1708_42B2_voting_1000
1. 0 /dev/mapper/oraMFGSTGclus02_1708_42B3_voting_mirror1_1000

located 2 votedisk(s).
[root@tst-db-01 crs_home]# ps -eaf|grep pmon
root 943 31154 0 07:43 pts/0 00:00:00 grep pmon
[root@tst-db-01 crs_home]#

Voting Disk :
===========

1. Bring down the CRS

[root@tst-db-01 /]# /etc/init.d/init.crs stop
Shutting down Oracle Cluster Ready Services (CRS):
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.

2. Take the backup

[root@tst-db-01 /]# dd if=/dev/mapper/oraMFGSTGclus02_1708_42B2_voting_1000 of=/oracle/export/CRS/voting.dmp
2096640+0 records in
2096640+0 records out

[root@tst-db-01 /]# ls -l /oracle/export/CRS/voting.dmp
-rw-r--r-- 1 root root 1073479680 Jun 22 08:51 /oracle/export/CRS/voting.dmp

3. Add Voting Disk

[root@tst-db-01 /]# crsctl add css votedisk /dev/mapper/tst-db-01-02_cluster_vote_003_1000M -force
Now formatting voting disk: /dev/mapper/tst-db-01-02_cluster_vote_003_1000M
successful addition of votedisk /dev/mapper/tst-db-01-02_cluster_vote_003_1000M.

4. Add addition Voting Disk

[root@tst-db-01 /]# crsctl add css votedisk /dev/mapper/tst-db-01-02_cluster_votemirr_004_1000M -force
Now formatting voting disk: /dev/mapper/tst-db-01-02_cluster_votemirr_004_1000M
successful addition of votedisk /dev/mapper/tst-db-01-02_cluster_votemirr_004_1000M.

5. Deleting old Voting Disk

[root@tst-db-01 /]# crsctl delete css votedisk /dev/mapper/oraMFGSTGclus02_1708_42B2_voting_1000 -force
successful deletion of votedisk /dev/mapper/oraMFGSTGclus02_1708_42B2_voting_1000.

[root@tst-db-01 /]# crsctl delete css votedisk /dev/mapper/oraMFGSTGclus02_1708_42B3_voting_mirror1_1000 -force
successful deletion of votedisk /dev/mapper/oraMFGSTGclus02_1708_42B3_voting_mirror1_1000.

6. Bring up the CRS

[root@tst-db-01 /]# /etc/init.d/init.crs start
Startup will be queued to init within 30 seconds.
[root@tst-db-01 /]# tail -f /var/log/messages
Jun 22 08:58:47 tst-db-01 prashasi: Oracle Cluster Ready Services starting by user request.
Jun 22 08:59:00 tst-db-01 logger: Cluster Ready Services completed waiting on dependencies.
Jun 22 08:59:03 tst-db-01 last message repeated 2 times
Jun 22 08:59:03 tst-db-01 logger: Running CRSD with TZ =

7. Verify the CRS Services

[root@tst-db-01 /]# crsctl check crs

CSS appears healthy
Cannot communicate with CRS
EVM appears healthy

8. Verify the Voting Disk Changes

[root@tst-db-01 /]# crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@tst-db-01 /]# crsctl query css votedisk
0. 0 /dev/mapper/tst-db-01-02_cluster_vote_003_1000M
1. 0 /dev/mapper/tst-db-01-02_cluster_votemirr_004_1000M

located 2 votedisk(s).


OCR Disk :
========

1. Take the backup

[root@tst-db-01 export]# cd /oracle/export
[root@tst-db-01 export]# cd CRS
[root@tst-db-01 CRS]# ocrconfig -export /oracle/export/CRS/OCR_Backup -s online

2. Add the OCR and OCR Mirror Disk

[root@tst-db-01 CRS]# ls -l /dev/mapper/tst-db-01-02_cluster_ocr_001_1000M
brw-rw---- 1 root disk 253, 385 Jun 21 12:18 /dev/mapper/tst-db-01-02_cluster_ocr_001_1000M
[root@tst-db-01 CRS]# ocrconfig -replace ocr /dev/mapper/tst-db-01-02_cluster_ocr_001_1000M
[root@tst-db-01 CRS]# ocrconfig -replace ocrmirror /dev/mapper/tst-db-01-02_cluster_ocrmirr_002_1000M

3. Verify the OCR Changes

[root@tst-db-01 CRS]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 1048040
Used space (kbytes) : 3636
Available space (kbytes) : 1044404
ID : 1397237804
Device/File Name : /dev/mapper/tst-db-01-02_cluster_ocr_001_1000M
Device/File integrity check succeeded
Device/File Name : /dev/mapper/tst-db-01-02_cluster_ocrmirr_002_1000M
Device/File integrity check succeeded

Cluster registry integrity check succeeded

[root@tst-db-01 CRS]#


Regards,
Sasikumar.M

Tuesday, June 29, 2010

When Opening Database - 'ORA-01113: file 1 needs media recovery '

Hello All,

After restore and recovery is complete ,trying to open database with resetlogs option showed the following error message

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '/u02/oracle/UPG/apps/apps_st/db/system01.dbf' was restored from an oldbackup

I have verified the time and the scn number until which I ran to restore, everything was correct but still unable to open the database.I tried applying archive logs and then to open failed again.

Research

I have issued the following command to recover 'recover database using backup controlfile' .

After some research and googling I issued the following command to open database

sqlplus > recover database using backup controlfile until cancel;

When prompted issued CANCEL.Now tried to open the database with resetlogs and database opened without any issues.

Session Details

SQL> recover database using backup controlfile until cancel;
ORA-00279: change 370577110 generated at 06/12/2010 16:19:22 needed for thread
1
ORA-00289: suggestion :
/u01/oracle/UPG/db/apps_st/arch/UPG_1_2671_699752349.arc
ORA-00280: change 370577110 for thread 1 is in sequence #2671


Specify log: {=suggested | filename | AUTO | CANCEL}
/u01/oracle/UPG/db/apps_st/arch/UPG_1_2671_699752349.arc
ORA-00279: change 370578253 generated at 06/12/2010 16:27:55 needed for thread
1
ORA-00289: suggestion :
/u01/oracle/UPG/db/apps_st/arch/UPG_1_2672_699752349.arc
ORA-00280: change 370578253 for thread 1 is in sequence #2672
ORA-00278: log file
'/u01/oracle/UPG/db/apps_st/arch/UPG_1_2671_699752349.arc' no longer
needed for this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
/u01/oracle/UPG/db/apps_st/arch/UPG_1_2672_699752349.arc
ORA-00279: change 370610644 generated at 06/12/2010 18:27:47 needed for thread
1
ORA-00289: suggestion :
/u01/oracle/UPG/db/apps_st/arch/UPG_1_2673_699752349.arc
ORA-00280: change 370610644 for thread 1 is in sequence #2673
ORA-00278: log file
'/u01/oracle/UPG/db/apps_st/arch/UPG_1_2672_699752349.arc' no longer
needed for this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
CANCEL
Media recovery cancelled.
SQL>
SQL> alter database open resetlogs;

Database altered.

SQL> select * from v$recover_file;

no rows selected

SQL> select distinct status from v$datafile;

STATUS
-------
ONLINE
SYSTEM


- Hope this helps when performing simple recovery to a different server.

RMAN Duplication - UNTIL scn (.......) is ahead of last scn in archived logs (........)

Hello All,


When performing duplication of database with rman connected to the Source received the following error

upg db009 oracle102 > rman target sys/sys@upg auxiliary /

Recovery Manager: Release 10.2.0.4.0 - Production on Tue Jun 29 17:26:47 2010

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: UPG (DBID=1899709187)
connected to auxiliary database: STAGE (not mounted)

RMAN>

RMAN> run {
SET UNTIL SCN 379298362;
allocate auxiliary channel t1 type disk;
allocate auxiliary channel t2 type disk;
allocate auxiliary channel t3 type disk;
switch datafile all;
duplicate target database to stage;
}2> 3> 4> 5> 6> 7> 8>

executing command: SET until clause

allocated channel: t1
channel t1: sid=1587 devtype=DISK

allocated channel: t2
channel t2: sid=1586 devtype=DISK

allocated channel: t3
channel t3: sid=1585 devtype=DISK


Starting Duplicate Db at 28-JUN-10
released channel: t1
released channel: t2
released channel: t3
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 06/28/2010 14:58:18
RMAN-06457: UNTIL scn (379298362) is ahead of last scn in archived logs (379296482)

RMAN> exit


Issue and Verification

On Checking the Source DB,found that the last scn was older than what I have specified in run block of RMAN.Hence issued checkpoint connected to the source DB.

SQL> select thread#, status, enabled, checkpoint_time, checkpoint_change# from v$thread;

THREAD# STATUS ENABLED CHECKPOINT_TIME CHECKPOINT_CHANGE#
---------- ------ -------- ------------------ ------------------
1 OPEN PUBLIC 28-JUN-10 379296482



SQL> alter system checkpoint;

System altered.

SQL> select thread#, status, enabled, checkpoint_time, checkpoint_change# from v$thread;

THREAD# STATUS ENABLED CHECKPOINT_TIME CHECKPOINT_CHANGE#
---------- ------ -------- ------------------ ------------------
1 OPEN PUBLIC 28-JUN-10 379299681

SQL>

Now re-started the duplication and it completed successfully.

Saturday, June 12, 2010

10gR2 : OPatch failed with Unable to create patchObject



Hi Viewer,

After long time, I am posting an interesting issue which I faced when applying the CPU patch with OPATCH utility.

When I tried to run opatch lsinventory, I got the following error message

[oracle@proddb ContentsXML]$ opatch lsinventory
Invoking OPatch 10.2.0.4.2

Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.


Oracle Home : /oracle/product/10.2.0.4/PROD
Central Inventory : /oracle/product/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /oracle/product/10.2.0.4/PROD/oui
Log file location : /oracle/product/10.2.0.4/PROD/cfgtoollogs/opatch/opatch2010-06-09_02-10-45AM.log



Inventory load failed... OPatch cannot load inventory for the given Oracle Home.

LsInventorySession failed: Unable to create patchObject

OPatch failed with error code 73
[oracle@proddb ContentsXML]$

So I set the OPATCH_DEBUG=TRUE environment variable for debugging more on this issue, I found the following extra error information,

OracleHomeInventory::load() begins to process raw data from OUI to build up OPatch primitive classes
PatchObject(oracleHomePath,patchID)
PatchObject::PatchObject looks for the actions file /oracle/product/10.2.0.4/PROD/inventory/oneoffs/8576156/etc/config/actions.xml
PatchObject::PatchObject looks for the inventory file /oracle/product/10.2.0.4/PROD/inventory/oneoffs/8576156/etc/config/inventory.xml
parserXMLFile : start
parserXMLFile : start
.
.
JarAction::getCompleteFileListPath() returns :ORACLE_HOME/rdbms/jlib/qsma.jar
PatchObject(oracleHomePath,patchID)
PatchObject::PatchObject looks for the actions file /oracle/product/10.2.0.4/PROD/inventory/oneoffs/8436582/etc/config/actions.xml
PatchObject::PatchObject looks for the inventory file /oracle/product/10.2.0.4/PROD/inventory/oneoffs/8436582/etc/config/inventory.xml
parserXMLFile : start
parserXMLFile : start
.
.
PatchObject(oracleHomePath,patchID)
PatchObject::PatchObject looks for the actions file /oracle/product/10.2.0.4/PROD/inventory/oneoffs/8788977/etc/config/actions.xml
PatchObject::PatchObject looks for the inventory file /oracle/product/10.2.0.4/PROD/inventory/oneoffs/8788977/etc/config/inventory.xml
parserXMLFile : start


Inventory load failed... OPatch cannot load inventory for the given Oracle Home.

Locker::release()
OUISessionManager::unRegister()
Un-Registering the caller : OPatch
LsInventory::getInstance() returns
LsInventorySession failed: Unable to create patchObject
Cleaning up the directory : "/oracle/product/10.2.0.4/PROD/.patch_storage/patch_unzip"...

OPatch failed with error code 73
[oracle@proddb ContentsXML]$

Referred the following support notes for further troubleshooting, but it didn't fix the issue.

SOLARIS: "opatch lsinventory" is failing with error code 73 on Remote Node in 10.2.0.4 RAC environment [ID 793600.1]
Opatch Lsinventory Fails With "Unable to create patchObject" OPatch failed with error code 73 [ID 751152.1]
Opatch error: "Apply Session failed: ApplySession failed to prepare the system. No detail available." [ID 864803.1]

Tried recreating OraInventory using runInstaller utility. But that option also did not help.

After spending a lot of time, I upgraded the OPATCH utility from 10.2.0.4.2 to 10.2.0.4.8. Finally it fixed the issue.

Comments are Welcome!!!

Tuesday, March 2, 2010

RPM Dependency Loop

I had to install that dependency package for 11g R1.

When applying the necessary RPM , I came accross this dependency loop situation.
In general it is a loop of the dependency i.e, when you first install a package it will ask for another package and when trying to apply the requested package the dependency checks ask for the parent package.

[root@skrajend rpm]# rpm -ivh elfutils-libelf-devel-0.137-3.el5.i386.rpm
error: Failed dependencies:
        elfutils-libelf-devel-static-i386 = 0.137-3.el5 is needed by elfutils-libelf-devel-0.137-3.el5.i386
[root@skrajend rpm]# rpm -ivh elfutils-libelf-devel-static-0.137-3.el5.i386.rpm
error: Failed dependencies:
        elfutils-libelf-devel-i386 = 0.137-3.el5 is needed by elfutils-libelf-devel-static-0.137-3.el5.i386
[root@skrajend rpm]#


I tried with yum but no success.
[root@skrajend rpm]# yum install elfutils-libelf-devel-0.137-3.el5.i386.rpm
Loaded plugins: security
Setting up Install Process
Examining elfutils-libelf-devel-0.137-3.el5.i386.rpm: elfutils-libelf-devel-0.137-3.el5.i386
Marking elfutils-libelf-devel-0.137-3.el5.i386.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package elfutils-libelf-devel.i386 0:0.137-3.el5 set to be updated
--> Processing Dependency: elfutils-libelf-devel-static-i386 = 0.137-3.el5 for package: elfutils-libelf-devel
--> Finished Dependency Resolution
elfutils-libelf-devel-0.137-3.el5.i386 from /elfutils-libelf-devel-0.137-3.el5.i386 has depsolving problems
  --> Missing Dependency: elfutils-libelf-devel-static-i386 = 0.137-3.el5 is needed by package elfutils-libelf-devel-0.137-3.el5.i386 (/elfutils-libelf-devel-0.137-3.el5.i386)
Error: Missing Dependency: elfutils-libelf-devel-static-i386 = 0.137-3.el5 is needed by package elfutils-libelf-devel-0.137-3.el5.i386 (/elfutils-libelf-devel-0.137-3.el5.i386)
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.
[root@skrajend rpm]#


Solution is to use wild cards in the rpm command.

[root@skrajend rpm]# rpm -ivh elfutils-libelf-devel-*
Preparing...                ########################################### [100%]
   1:elfutils-libelf-devel-s########################################### [ 50%]
   2:elfutils-libelf-devel  ########################################### [100%]
[root@skrajend rpm]#

[root@skrajend rpm]# rpm -qa|grep -i elfutils-libelf-devel
elfutils-libelf-devel-static-0.137-3.el5
elfutils-libelf-devel-0.137-3.el5
[root@skrajend rpm]#

Finally got those loop dependency patches installed.

Tuesday, February 23, 2010

Rare Index with Double Quotes


Came across this rare index.

SQL> select index_name from dba_indexes where tablespace_name='MEDIUM_DATA';

INDEX_NAME
UK_F_PLAN_FC_ACT_jan
F_PLAN_FC_ACT_OLTAS_INDEX1_jan

2 rows selected.

SQL> alter index star.UK_F_PLAN_FC_ACT_jan rebuild;
alter index star.UK_F_PLAN_FC_ACT_jan rebuild
*
ERROR at line 1:
ORA-01418: specified index does not exist


SQL> alter index star."UK_F_PLAN_FC_ACT_jan" rebuild;

Index altered.

SQL>

Found a hint that it needs to be invoked with double quotes ""

Monday, February 15, 2010

Change Domainname - Oracle EBS R12

Hi All,

Today we will discuss on how to change the domain name of a server.
Before we do this please ensure you take one complete cold backup of the system.
The domain name change described here is for EBS R12 applications.
Domain name change is accomplished in 2 parts
>< Configure the Database to the new domainname
>< Configure applications to the new domainname

One would assume that before we start changing the domainname at the database and applications the values are already set at the Operating System level
with the help of SA.

- As a DBA ensure the hostname is followed by the correct domainname in the /etc/hosts file.

Config Changes on the DB Side
=============================


1. Shutdown application services
2. Ensure all services are down.
3. On the DB server node (DB should be up and running)
4. Execute the below command

orauat server050 oracle102 > perl /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/bin/adgentns.pl appspass=apps contextfile=/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml -removeserver


##########################################################################
Generate Tns Names
##########################################################################
Classpath :

:/u01/oracle/UAT/db/tech_st/10.2.0/jdbc/lib/ojdbc14.jar:/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/java/xmlparserv2.jar:/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/java:/u01/oracle/UAT/db/tech_st/10.2.0/jlib/netcfg.jar:/u01/oracle/UAT/db/tech_st/10.2.0/jlib/ldapjclnt10.jar

Loading ORACLE_HOME environment from /u01/oracle/UAT/db/tech_st/10.2.0
Logfile: /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/log/UAT_server050/02051831/NetServiceHandler.log

adgentns.pl exiting with status 0
ERRORCODE = 0 ERRORCODE_END



5. Now login into the Database as apps user and run the below sql queries and the results should be "no rows selected"
If the below query returns rows ,then
a) Shutdown DB
b) execute step 4 above again.

orauat server050 oracle102 >

as apps

SQL> select DB_NAME from FND_DATABASES;

no rows selected



SQL> select NAME, SERVER_TYPE from FND_APP_SERVERS, FND_NODES where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID and
SERVER_TYPE='DB' and FND_NODES.NODE_NAME=upper('server050'); 2 3

no rows selected



6. Remove the Database server entry from FND_NET services by executing the below procedure

SQL> begin
FND_NET_SERVICES.remove_server('UAT', 'server050');
end; 2 3
4 /

PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.




7. Now generate a New CONTEXT_FILE on the DB server .

Note:- 1. When prompted for "Do you want the inputs to be validated " say "n".
2. When it prompts for the contextfile name give a new name and take a note of the new contextfile and location

orauat server050 oracle102 > perl adclonectx.pl contextfile=/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml

Copyright (c) 2002 Oracle Corporation
Redwood Shores, California, USA

Oracle Applications Rapid Clone

Version 12.0.0

adclonectx Version 120.18.12000000.7

Running:
/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/clone/bin/../jre/bin/java -Xmx600M -classpath /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/clone/bin/../jlib/ojdbc14.jar:/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/clone/bin/../jlib/xmlparserv2.jar:/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/clone/bin/../jlib/javaoracle.apps.ad.context.CloneContext -e /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml
Enter the APPS password : apps

Log file located at /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/clone/bin/CloneContext_0205185434.log

Provide the values required for creation of the new Database Context file.

Target System Hostname (virtual or normal) [server050] :

It is recommended that your inputs are validated by the program.
However you might choose not to validate them under following circumstances:

-If cloning a context on source system for a remote system.
-If cloning a context on a machine where the ports are taken and
you do not want to shutdown the services at this point.
-If cloning a context but the database it needs to connect is not available.

Do you want the inputs to be validated (y/n) [n] ? : n

Target Instance is RAC (y/n) [n] :

Target System Database SID : UAT

Target System Base Directory : /u01/oracle/UAT

Oracle OS User [orauat] :

Oracle OS Group [dba] :

Target System utl_file_dir Directory List : /u01/oracle/UAT/db/tech_st/10.2.0/admin/UAT_server050/tmp

Number of DATA_TOP's on the Target System [1] :

Target System DATA_TOP Directory 1 [/u01/oracle/UAT/db/apps_st/data] :

Target System RDBMS ORACLE_HOME Directory [/u01/oracle/UAT/db/tech_st/10.2.0] :

Target System Archive Log Directory [/u01/oracle/UAT/db/apps_st/data/archive] :

Do you want to preserve the Display [server050:0.0] (y/n) ? :

Invalid input value. 'y' or 'n' required.


Do you want to preserve the Display [server050:0.0] (y/n) ? : y

Target System Port Pool [0-99] : 1
Report file located at /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/temp/portpool.lst
Complete port information available at /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/temp/portpool.lst

New context path and file name [/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml] : /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT1_server050.xml

Creating the new Database Context file from :
/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/template/adxdbctx.tmp

The new database context file has been created :
/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT1_server050.xml

Log file located at
/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/clone/bin/CloneContext_0205185434.log
contextfile=/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT1_server050.xml

Check Clone Context logfile

/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/clone/bin/CloneContext_0205185434.log for details.



8. Once the above command successfully completes you should see a new contextfile with the new given at the location /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT1_server050.xml

9. Copy the new contextfile to the original name /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml (UAT1 to UAT)

10. There will be a entry for the location of the context file within the Context file search for the below string and replace with (it would be reflecting new xml file name ,replace UAT1 to UAT)

<oa_context_file_loc oa_var="s_contextfile">/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml</oa_context_file_loc>

11. Save and quit

12. Run autoconfig on Database node

orauat server050 oracle102 > ./adconfig.sh
Enter the full path to the Context file: /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml
Enter the APPS user password:
The log file for this session is located at: /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/log/UAT_server050/02051902/adconfig.log

AutoConfig is configuring the Database environment...

AutoConfig will consider the custom templates if present.
Using ORACLE_HOME location : /u01/oracle/UAT/db/tech_st/10.2.0
Classpath :

:/u01/oracle/UAT/db/tech_st/10.2.0/jdbc/lib/ojdbc14.jar:/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/java/xmlparserv2.jar:/u01/oracle/UAT/db/tech_st/10.2.0/appsutil/java:/u01/oracle/UAT/db/tech_st/10.2.0/jlib/netcfg.jar:/u01/oracle/UAT/db/tech_st/10.2.0/jlib/ldapjclnt10.jar

Using Context file : /u01/oracle/UAT/db/tech_st/10.2.0/appsutil/UAT_server050.xml

Context Value Management will now update the Context file

Updating Context file...COMPLETED

Attempting upload of Context file and templates to database...COMPLETED

Updating rdbms version in Context file to db102
Updating rdbms type in Context file to 64 bits
Configuring templates from ORACLE_HOME ...

AutoConfig completed successfully.


13. Login into the Database as apps user and run the below queries to check if the node values are populated correctly

orauat server050 oracle102 > sqlplus apps

SQL*Plus: Release 10.2.0.3.0 - Production on Fri Feb 5 19:03:35 2010

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

Enter password:

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> select DB_NAME from FND_DATABASES;

DB_NAME
--------
UAT


SQL>
SQL>
SQL> select NAME, SERVER_TYPE from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID and
SERVER_TYPE='DB' and FND_NODES.NODE_NAME=upper('server050'); 2 3

NAME SERVER_TYPE
------------------------ -----------------------------
server050_UAT_DB DB



SQL>

14. End of Configuration change on Database side


Config Changes on the Application Side
=================================


1. Take a backup of the context file .
2. Replace all the old values for the domainname with the new domainname. (Use OAM or vi editor)
3. Save and quit the contextfile
4. Run Autoconfig.
5. Start the applications and it should come up.

Monday, February 8, 2010

Oracle Enterprise Manager ( OEM ) Online Training URL from Oracle University

Team,

Sharing the following online trainings from Oracle University,

Oracle EM 10g R4 -
http://oukc.oracle.com/static05/opn/oracle9i_database/47238/011708_47238/index.htm
Understanding Grid Control :
http://oukc.oracle.com/static05/opn/oracle9i_database/40263//013107_40263/index.htm
Oracle EM 10g :
http://oukc.oracle.com/static05/opn/oracle9i_database/47242/022808_47242/index.htm
Oracle EM 10g R4 - Application Server Diagnostics :
http://oukc.oracle.com/static05/opn/oracle9i_database/47240/021408_47240_source/index.htm
Enterprise Manager 10g Application Management Pack for Oracle Ebusiness Suite :
http://oukc.oracle.com/static05/opn/oracle9i_database/47241/022108_47241_source/index.htm
Oracle EM 10g Release 3 :
http://oukc.oracle.com/static05/opn/oracle9i_database/47193//103107_47193_source/index.htm
Oracle EM 10g Data Masking :
http://oukc.oracle.com/static05/opn/oracle9i_database/47237/011008_47237/index.htm

Comments are most welcome.

Thanks.

Sample Dataset for Oracle

I was recently working on a project where there was a demand to have random set of sales and transaction data to test performance. Well I thought of a better solution and it worked out with this website http://www.generatedata.com

Interestingly the dataset can be generated directly on the website itself and the maximum rows that will be generated is 5000.

The result output can be on different forms like excel,csv,html,xml and sql.
SQL was the best part , the page gives option to select the database type and then the tablename.
By default it creates the script with the create tablename and then the insert statements.

I hope this will help people who need sample dataset.

Wednesday, January 20, 2010

RMAN SLOW PERFORMANCE ON EXIT

Hello Readers,

When it comes to backup and recovery,there are various pros and cons on each method we follow.As a DBA we may need to determine the best and most efficient way for backup and in worst scenarios recovery methodologies.

When saying this we use RMAN in our environment for backups.
The backup scripts are normal RMAN backup commands which are fired against Oracle Database 10g(10.2.0.3).

We noticed that after the backup was completed the RMAN prompt would never come.
It took nearly 2hours to come to a RMAN prompt.

We thought it was problem in the Media management layer and some believed that the tape drive was really slow.

On research found that the TEMP tablespace was also utilised to huge extent and most of the time TEMP tablespace would blow up.

The workaround would be to perform the following :-

server50 $ rman / target catalog rman/rman@catalog
RMAN > sql "alter session set optimizer_mode=RULE";


Run the above sql in the RMAN prompt and then perform normal RMAN operations.

Saturday, January 16, 2010

Updating Partitioned Tables

Recently there was a requirement to update a huge partition table. The change was to set a unique value to a column which is spread across year and month partition. I could achieve it easier with the help of partition clause in the update statement.

Below is the sample script used to update the table partition wise.

begin
for samplep in (select partition_name from user_tab_partitions where table_name='SAMPLETABLE')
loop
update sampletable s partition (samplep.partition_name) set s.samplename='x';
commit;
end loop;
end;

Table Structure looks similar to the below;

create table sampletable (id number,samplename varchar2(20),sampleyyyymm number)
partition by range (sampleyyyymm)
(
partition p1 values less than (200901),
partition p2 values less than (200902),
partition p3 values less than (200903),
partition p4 values less than (200904),
partition p5 values less than (200905),
partition p6 values less than (200906),
partition p7 values less than (200907),
partition p8 values less than (200908),
partition p9 values less than (200909),
partition p10 values less than (200910),
partition p11 values less than (200911),
partition p12 values less than (200912),
partition p13 values less than (maxvalue)
);

ASM ReBalance Power

Database administrators are sometimes kept busy adding and removing disks in the ASM Instance.
Adding and Removing the disks are quite easy but at the backend ASM has to redistribute the data evenly which is completely automatic.

By default ASM runs with the rebalance power of 1.

This can be altered by running the command 'alter diskgroup dg1 rebalance power 11;'
11 is the maximum and 1 is the default

Caution should be taken when running with power 11 as ASM takes high resource to process the request.
ASM Rebalance power can be altered at any time and it is change the power as and when the command is issued.

v$asm_operation helps to find the status of the operation.

Sunday, January 3, 2010

Hot Backup

Dear Friends,

From long back, I have doubt on What exactly happening when Database is in HOT BACKUP mode ?

Here we have explaniation for this,

 - When an 'alter tablespace begin backup' command is issued the datafiles that belong to the tablespace are marked as hot-backup-in-progress. 

 - The dirty databuffers in the database buffer cache that belong to the database files are written out to the files and the datafiles are checkpointed. 

 - The datafile headers are updated to the SCN captured when the begin backup is issued. 

 - The datafile headers are not updated until the 'alter tablespace end backup' command is issued;

 - However, the datablock within the database files can continue to be read and updated. 

 - When the datafile is restored from a hot backup, the recovery will begin from the SCN captured during the begin backup is issued. 

 - All changes applied during the hot backup time period will be rolled forward from the redo logs.

Hope this information will clear all our doubts.

Friday, January 1, 2010

SPFILE and INIT.ORA

Hi Peers,


This is the article which will explain you about init parameter reposistory feature.
However this is basic level but helping us to understand stronger.


SPFILE and INIT.ORA

Oracle9i allows more and more parameters to be changed on-the-fly without having torestart the database. Consequently, the DBA has to remember, more and more often, to change the parameter file accordingly before the next restart of the database. Oracle9i enables dynamically altered parameters to be simultaneously written to the parameter file using server parameter files (SPFILE) so that changes are consistent with ALTER SYSTEM.


$ Up to version 8i, Oracle traditionally stored initialization parameters in a text file INIT.ORA (PFILE).
$ With Oracle9i, server parameter files (SPFILE) can also be used.
$ An SPFILE can be regarded as a repository for initialization parameters which is located on the database server.
$ SPFILEs are small binary files that cannot be edited.
$ Editing SPFILEs corrupts the file and either the instance fails to start or an active instance may crash.

eg ( Content ):


*.db_block_size=8192
*.db_domain='ttc.trivadis.com'
*.db_file_multiblock_read_count=16
*.db_files=1022
*.db_name='TVD901A'
...

*. means:


all instances of this database system. This is also valid syntax in conventional INIT.ORA files.



*. This is particularly interesting for Real Application Cluster (RAC) – see below for more information.


At database startup, if no PFILE is specified at the OS-dependent default location

($ORACLE_HOME/dbs under UNIX, $ORACLE_HOME\database under NT),


the startup command searches for:

1. spfile${ORACLE_SID}.ora

2. spfile.ora

3. init${ORACLE_SID}.ora



Of course, the option of explicitly specifying a PFILE is still available.
 
SQL> connect sys/manager as sysdba


Connected to an idle instance.

SQL> startup pfile=/tmp/initTVD901A.ora

ORACLE instance started.

Total System Global Area 172967504 bytes

...

SQL>

However, a SPFILE cannot be specified for STARTUP with PFILE :


SQL> startup pfile='tmp/spfileTVD901A.ora'

LRM-00101: unknown parameter name 's044'

ORA-01078: failure in processing system parameters

To facilitate this, the best option is to create a conventional INIT.ORA with default name:



init${ORACLE_SID}.ora


This file only contains the path of the SPFILE:

SPFILE = c:\oracle\admin\db1\pfile\spfileDB1.ora

Create SPFILE

A SPFILE is initially created from a conventional text initialization parameters file (PFILE,
INIT.ORA). This can be carried out without a started instance. SYSDBA or SYSOPER
privileges are required to create the SPFILE.


If SPFILE is available at the default location, STARTUP uses this SPFILE if no PFILE is specified.

Creating an SPFILE from a PFILE at the default location:

SQL> CREATE SPFILE FROM PFILE='/u00/app/oracle/admin/TVD901A/pfile/initTVD901A.ora';

File created.

SQL>

Creating an SPFILE from a PFILE at the non-default location:


SQL> CREATE SPFILE='/u00/app/oracle/admin/TVD901A/pfile/spfileTVD901A.ora'

FROM PFILE='/u00/app/oracle/admin/TVD901A/pfile/initTVD901A.ora';

File created.

SQL>
 
The best solution is to create a (conventional) INIT.ORA with default name in the default location,
which contains only the path to the SPFILE.
Working with links, if necessary, on UNIX:

sqlplus "/ as sysdba"

startup create spfile='/u00/app/oracle/admin/TDBT901A/pfile/spfileTVD901A.ora' from
pfile='/u00/app/oracle/admin/SID/pfile/initTVD901A.ora';

shutdown immediate

exit

cd $ORACLE_HOME/dbs

ln -s /u00/app/oracle/admin/TDBT901A/pfile/spfileTVD901A.ora .

sqlplus "/ as sysdba"

startup

Backing up an SPFILE




The CREATE PFILE command can be used to back up an SPFILE:



SQL> CREATE PFILE='/u00/app/oracle/admin/TVD901A/pfile/bck_init.ora' FROM SPFILE;



File created.



SQL>


This creates a directly usable INIT.ORA file:


*.background_dump_dest='/u00/app/oracle/admin/TVD901A/bdump'
*.compatible='9.0.1'
*.control_file_record_keep_time=90
*.core_dump_dest='/u00/app/oracle/admin/TVD901A/cdump'


Continue.........

OPatch - Prerequisite check "CheckRollbackable" on auto-rollback patches failed.

Hello Friends,

Today, I faced the following OPATCH issue when I tried to apply the patch 8450774.

/oracle/product/10.2.0.4/TEST01/PATCHES/8450774 > opatch apply -invPtrLoc $ORACLE_HOME/oraInst.loc
Invoking OPatch 10.2.0.4.3

Oracle Interim Patch Installer version 10.2.0.4.3
Copyright (c) 2007, Oracle Corporation.  All rights reserved.


Oracle Home       : /oracle/product/10.2.0.4/TEST01
Central Inventory : /oracle/product/10.2.0.4/TEST01/oraInventory
   from           : /oracle/product/10.2.0.4/TEST01/oraInst.loc
OPatch version    : 10.2.0.4.3
OUI version       : 10.2.0.4.0
OUI location      : /oracle/product/10.2.0.4/TEST01/oui
Log file location : /oracle/product/10.2.0.4/TEST01/cfgtoollogs/opatch/opatch2009-12-07_09-55-44AM.log

ApplySession applying interim patch '8450774' to OH '/oracle/product/10.2.0.4/TEST01'
Interim patch 8450774 is a superset of the patch(es) [  7263055 ] in OH /oracle/product/10.2.0.4/TEST01
OPatch will rollback the subset patches and apply the given patch.

Running prerequisite checks...
Prerequisite check "CheckRollbackable" on auto-rollback patches failed.
The details are:

Patch 7263055:
Archive Action: Source file "/oracle/product/10.2.0.4/TEST01/.patch_storage/7263055_Jul_21_2008_01_37_17/files/lib/libserver10.a/kwqmn.o" does not exist.
'oracle.rdbms, 10.2.0.4.0': Cannot update file '/oracle/product/10.2.0.4/TEST01/lib/libserver10.a' with '/kwqmn.o'
Archive Action: Source file "/oracle/product/10.2.0.4/TEST01/.patch_storage/7263055_Jul_21_2008_01_37_17/files/lib/libserver10.a/knlp.o" does not exist.
'oracle.rdbms, 10.2.0.4.0': Cannot update file '/oracle/product/10.2.0.4/TEST01/lib/libserver10.a' with '/knlp.o'
Archive Action: Source file "/oracle/product/10.2.0.4/TEST01/.patch_storage/7263055_Jul_21_2008_01_37_17/files/lib/libserver10.a/kwqa.o" does not exist.
'oracle.rdbms, 10.2.0.4.0': Cannot update file '/oracle/product/10.2.0.4/TEST01/lib/libserver10.a' with '/kwqa.o'
Archive Action: Source file "/oracle/product/10.2.0.4/TEST01/.patch_storage/7263055_Jul_21_2008_01_37_17/files/lib/libserver10.a/kwqit.o" does not exist.
'oracle.rdbms, 10.2.0.4.0': Cannot update file '/oracle/product/10.2.0.4/TEST01/lib/libserver10.a' with '/kwqit.o'
Copy Action: Source file "/oracle/product/10.2.0.4/TEST01/.patch_storage/7263055_Jul_21_2008_01_37_17/files/rdbms/admin/prvtaqds.plb" does not exist.
'oracle.rdbms, 10.2.0.4.0': Cannot copy file from 'prvtaqds.plb' to '/oracle/product/10.2.0.4/TEST01/rdbms/admin/prvtaqds.plb'

ApplySession failed during prerequisite checks: Prerequisite check "CheckRollbackable" on auto-rollback patches failed.
System intact, OPatch will not attempt to restore the system
--------------------------------------------------------------------------------
The following warnings have occurred during OPatch execution:
1) OUI-67078:Interim patch 8450774 is a superset of the patch(es) [  7263055 ] in OH /oracle/product/10.2.0.4/TEST01
--------------------------------------------------------------------------------

OPatch failed with error code 74
 db-node1 TEST01
/oracle/product/10.2.0.4/TEST01/PATCHES/8450774 >


This issue is because, opatch is trying to rollback the existing patch ( because of confilct issue ) from backup area i.e $ORACLE_HOME/.patch_storage. But somehow, the backup of that particular patch is not there. So, OPatch is failing with this error message.

So, When I checked the URL " http://download.oracle.com/docs/cd/B14099_19/manage.1012/b16227/oui8_opatch.htm ", I came to know the option " -no_sysmod ".no_sysmod used to Specifies that the OPatch utility need not update the files in the system. It will only update the inventory.

/oracle/product/10.2.0.4/TEST01/PATCHES/8450774 > opatch rollback -id 7263055 -no_sysmod -invPtrLoc $ORACLE_HOME/oraInst.loc
Invoking OPatch 10.2.0.4.3

Oracle Interim Patch Installer version 10.2.0.4.3
Copyright (c) 2007, Oracle Corporation.  All rights reserved.


Oracle Home       : /oracle/product/10.2.0.4/TEST01
Central Inventory : /oracle/product/10.2.0.4/TEST01/oraInventory
   from           : /oracle/product/10.2.0.4/TEST01/oraInst.loc
OPatch version    : 10.2.0.4.3
OUI version       : 10.2.0.4.0
OUI location      : /oracle/product/10.2.0.4/TEST01/oui
Log file location : /oracle/product/10.2.0.4/TEST01/cfgtoollogs/opatch/opatch2009-12-07_10-02-14AM.log

RollbackSession rolling back interim patch '7263055' from OH '/oracle/product/10.2.0.4/TEST01'

Running prerequisite checks...

OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.


Skip patching component oracle.rdbms, 10.2.0.4.0 and its actions.
The actions are reported here, but are not performed.

Deleting "lib/libserver10.a/kwqmn.o" from archive "/oracle/product/10.2.0.4/TEST01/lib/libserver10.a"
ArchiveAction::rollback() failed: File is not present in backup area so kwqmn.ois not modified
Deleting "lib/libserver10.a/knlp.o" from archive "/oracle/product/10.2.0.4/TEST01/lib/libserver10.a"
ArchiveAction::rollback() failed: File is not present in backup area so knlp.ois not modified
Deleting "lib/libserver10.a/kwqa.o" from archive "/oracle/product/10.2.0.4/TEST01/lib/libserver10.a"
ArchiveAction::rollback() failed: File is not present in backup area so kwqa.ois not modified
Deleting "lib/libserver10.a/kwqit.o" from archive "/oracle/product/10.2.0.4/TEST01/lib/libserver10.a"
ArchiveAction::rollback() failed: File is not present in backup area so kwqit.ois not modified
Running make for target ioracle
RollbackSession removing interim patch '7263055' from inventory

OPatch succeeded.
 db-node1 TEST01
/oracle/product/10.2.0.4/TEST01/PATCHES/8450774 >


So, I have rollback the patch manually with using option called " -no_sysmod " and continued with main patch.

Wednesday, December 30, 2009

Table ReOrg Analyzer

Table ReOrg Analyzer


Finding and repairing chained rows is an important part of Oracle administration. When an Oracle rows expands,
it sometimes chains onto multiple data blocks. Excessive row chaining can cause a dramatic increase in disk I/O
because several I/O’s are required to fetch the block instead of one single I/O.






Of course, row chaining can be prevented by setting the PCTFREE storage parameter high enough to keep space on each data block
for row expansion. In cases where the data columns contain RAW and LONG RAW columns, row chaining may be unavoidable because the average row
length may exceed the data block size. That is why the query below filters out tables with RAW data types.
Here is the code that we use to generate a report showing all tables with excessive chained rows. Note that the use of this script is
predicated on the use of Oracle’s ANALYZE command to populate the chain_cnt and num_rows columns of the DBA_TABLES data dictionary view.
Once identified, the tables should be reorganized using Create Table As Select (CTAS) or by using the Oracle export-import utilities.



spool chain.lst;
set pages 9999;
column c1 heading "Owner" format a9;
column c2 heading "Table" format a12;
column c3 heading "PCTFREE" format 99;
column c4 heading "PCTUSED" format 99;
column c5 heading "avg row" format 99,999;
column c6 heading "Rows" format 999,999,999;
column c7 heading "Chains" format 999,999,999;
column c8 heading "Pct" format .99;
set heading off;
select 'Tables with chained rows and no RAW columns.' from dual;
set heading on;
select
owner c1,
table_name c2,
pct_free c3,
pct_used c4,
avg_row_len c5,
num_rows c6,
chain_cnt c7,
chain_cnt/num_rows c8
from
dba_tables
where
owner not in ('SYS','SYSTEM')
and
table_name not in
(select table_name from dba_tab_columns
where
data_type in ('RAW','LONG RAW')
)
and
chain_cnt > 0
order by
chain_cnt desc ;
This will produce a nice report that shows tables that you will want to reorganize:
Owner Table PCTFREE PCTUSED avg row Rows Chains Pct
------ --------- ------- ------- ------- --------- --------- ----
SAPR3 ZG_TAB 10 40 80 5,003 1,487 .30
SAPR3 ZMM 10 40 422 18,309 509 .03
SAPR3 Z_Z_TBLS 10 40 43 458 53 .12
SAPR3 USR03 10 40 101 327 46 .14
SAPR3 Z_BURL 10 40 116 1,802 25 .01
SAPR3 ZGO_CITY 10 40 56 1,133 10 .01
6 rows selected.



Cheers,


SpicyOracle.