Blog dedicated to Oracle Applications (E-Business Suite) Technology; covers Apps Architecture, Administration and third party bolt-ons to Apps
Monday, June 30, 2008
Database scripts for estimating growth
=======
Script:
=======
select to_char(creation_time, 'RRRR Month') "Month",
sum(bytes)/1024/1024
"Growth in Meg"
from sys.v_$datafile
where creation_time > SYSDATE-365
group by to_char(creation_time, 'RRRR
Month');
==============================
Sample Output from the script:
==============================
Month
Growth in
-------------------------------- ----------
2000 December 1068.625
2001 February 70
Using Big IP hardware load balancers with 11i and R12
380489.1 Using Load-Balancers with Oracle E-Business Suite Release 12 (Relevant for 11i too)
217368.1 Advanced Configurations and Topologies for Enterprise Deployments of E-Biz Suite 11i
601694.1 How To Check Session Persistence On a BigIP F5 Load Balancer
456906.1 11i/R12 How to Debug "Transaction Context Is Lost"
387306.1 Random error Your login session has expired when using Load Balancing
When a hardware load balancer is used, the context file variables which need to be changed are:
s_webentryurlprotocol http or https
s_webentryhost load balancer hostname
s_webentrydomain load balancer domain name
s_active_webport load balancer port
s_login_page load balancer url
s_external_url load balancer url
Load balancer settings:
persistence timeout = 1 day
persistence type = cookie based persistence
Friday, June 27, 2008
Does Autoconfig modify init.ora ?
QUESTION 2: Is Autoconfig modifying init.ora?
ANSWER 2: No. Autoconfig is not modifying the init.ora file. Autoconfig will generate a new init.ora just in the case it is not finding the init.ora in the expected location. So all the changes in init.ora shoud be made by the DBA.
Thursday, June 26, 2008
FND_STATS and DBMS_STATS
6) 10g has a new feature that gather statistics automatically, using the GATHER_STATS_JOB. Can the automatic statistics gathering job be used in 10G databases for Apps 11i?
No. The GATHER_STATS_JOB job collects stats using DBMS_STATS and should be disabled for Apps 11i.
If it is currently running, the automatic statistics gathering job should be disabled by running the following command:
dbms_scheduler.disable(''GATHER_STATS_JOB'');
Note: Normally, it is not necessary to disable this job, because this should be done by the script adstats.sql, which runs during the DB upgrade process.
Metalink Note :556121.1 says that "ORA-08103: object no longer exists" would occur if the GATHER_STATS_JOB is left enabled in an 11i/10g instance.
I went through the code inside FND_STATS and DBMS_STATS. DBMS_STATS code is encrypted and can't be read. FND_STATS code is readable. In many metalink notes, FND_STATS is described as a wrapper over DBMS_STATS package.
I gave this query to cross check:
1 select line,text
2 from dba_source
3 where text like '%DBMS_STATS%'
4* and name='FND_STATS'
SQL> /
249
DBMS_STATS.CREATE_STAT_TABLE(fnd_statown,fnd_stattab);
267
DBMS_STATS.CREATE_STAT_TABLE(schemaname,tabname,tblspcname);
359
DBMS_STATS.EXPORT_SCHEMA_STATS(schemaname, fnd_stattab, statid,
363
DBMS_STATS.EXPORT_SCHEMA_STATS(c_schema.sname, fnd_stattab, statid,
429
DBMS_STATS.EXPORT_TABLE_STATS(schemaname,
449
DBMS_STATS.IMPORT_SCHEMA_STATS(schemaname, fnd_stattab, statid,
453
DBMS_STATS.IMPORT_SCHEMA_STATS(c_schema.sname, fnd_stattab, statid,
517
DBMS_STATS.IMPORT_TABLE_STATS(ownname,tabname,partname,
532
DBMS_STATS.IMPORT_INDEX_STATS(ownname,indname,partname,fnd_stattab,
548
DBMS_STATS.IMPORT_COLUMN_STATS(ownname, tabname, colname, partname,
587
DBMS_STATS.IMPORT_COLUMN_STATS(c_rec.ownname,c_rec.tabname,
640
DBMS_STATS.GATHER_TABLE_STATS( ownname => ownname ,
655
l_tmp_str:= 'BEGIN DBMS_STATS.GATHER_TABLE_STATS( ownname => :ownname ,'||
712
DBMS_STATS.GATHER_INDEX_STATS( ownname => ownname ,
718
l_tmp_str:= 'BEGIN DBMS_STATS.GATHER_INDEX_STATS( ownname => :ownname ,'||
1030
EXECUTE IMMEDIATE 'BEGIN DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO; END;' ;
1226
dlog('Please use DBMS_STATS package to gather stats on SYS objects.');
1294
DBMS_STATS.EXPORT_INDEX_STATS( ownname, indname, null,
1465
DBMS_STATS.EXPORT_TABLE_STATS(ownname, tabname, partname,
1544
-- Due to the limitations of in DBMS_STATS in 8i we need to call
1707
DBMS_STATS.EXPORT_COLUMN_STATS(list_ownname(i),
2048
DBMS_STATS.EXPORT_COLUMN_STATS ( ownname,
2099
DBMS_STATS.SET_TABLE_STATS(ownname,
2143
DBMS_STATS.SET_INDEX_STATS(ownname,
24 rows selected.
As per eTRM:
APPS.FND_STATS references the following:
-
APPLSYS -
FND_HISTOGRAM_COLS -
FND_ORACLE_USERID -
FND_PRODUCT_INSTALLATIONS -
FND_STATS_HIST -
FND_STATS_HIST_S -
APPS -
FND_FILE - show dependent code -
FND_GLOBAL - show dependent code -
FND_HISTOGRAM_COLS -
FND_INSTALLATION - show dependent code -
FND_ORACLE_USERID -
FND_PRODUCT_INSTALLATIONS -
FND_STATS - show dependent code -
FND_STATS_HIST -
FND_STATS_HIST_S -
PUBLIC -
DBA_HISTOGRAMS -
DBA_INDEXES -
DBA_IND_COLUMNS -
DBA_TABLES -
DBA_TAB_COLUMNS -
DBA_TAB_PARTITIONS -
DBMS_OUTPUT -
DBMS_SPACE -
DBMS_STATS -
DUAL -
PLITBLM -
V$INSTANCE -
V$PARAMETER -
SYS -
DBA_INDEXES -
DBA_IND_COLUMNS -
DBA_TABLES -
DBA_TAB_COLUMNS -
DBA_TAB_HISTOGRAMS -
DBA_TAB_MODIFICATIONS -
DBA_TAB_PARTITIONS -
DBMS_OUTPUT - show dependent code -
DBMS_SPACE - show dependent code -
DBMS_STANDARD - show dependent code -
DBMS_STATS - show dependent code -
DUAL -
PLITBLM - show dependent code -
STANDARD - show dependent code -
V_$INSTANCE -
V_$PARAMETER
FND_STATS also collects Histograms automatically which is not done by DBMS_STATS. Metalink Note 429002.1 has more details:
Goal
How to collect histograms in Apps Ebusiness Suite using FND_STATSSolution
Histograms are useful when a column has skewed data. The CBO (Cost Based Optimizer) may use that information when trying to find the best plan to retrieve the requested data.If no histograms are present, the CBO assumes an even distribution of data. Histograms tell the CBO when data is not evenly distributed, and can help the CBO to estimate the number of rows returned from a table join (called "cardinality"). Having histograms on skewed column may aid the optimizer in making a proper decision.
FND_STATS collects histograms information if a column is listed in FND_HOSTOGRAM_COLS.
To create histogram on columns using FND_STATS you can use the procedure FND_STATS.LOAD_HISTOGRAM_COLS, like in the example:
1.sqlplus apps/
set lines 200;
set pagesize 35;
set trim on;
set trims on;
alter session set nls_date_format = 'MON-DD-YYYY HH24:MI:SS';
alter session set timed_statistics = true;
set feedback on;
select to_char(sysdate) time from dual;
2. After finding which column should have a histogram, use the procedure 'load_histogram_cols' to update the table 'fnd_histograms_cols, like:
execute fnd_stats.load_histogram_cols(action => 'INSERT', appl_id => '
Example:
exec fnd_stats.load_histogram_cols(action => 'INSERT', appl_id => 274, tabname => 'FEM_NAT_ACCTS_HIER', colname => 'LAST_UPDATED_BY', hsize => '100');
4. Check that the data was inserted in fnd_histogram_cols:
Select column_name, hsize from applsys.fnd_histogram_cols where table_name =
'FEM_NAT_ACCTS_HIER'; 5. Check the current data :
select * from dba_tab_histograms where table_name = 'FEM_NAT_ACCTS_HIER' and owner = 'FEM';
6. Gather new statistics
exec fnd_stats.gather_table_stats('FEM','FEM_NAT_ACCTS_HIER');
7. Check the new data collected:
select * from dba_tables where table_name = 'FEM_NAT_ACCTS_HIER' and owner = 'FEM';
select * from dba_tab_histograms where table_name = 'FEM_NAT_ACCTS_HIER' and owner = 'FEM';
select * from dba_tab_columns where table_name = 'FEM_NAT_ACCTS_HIER' and owner = 'FEM';
1) Manually inserting into FND_HOSTOGRAM_COLS is not supported in Oracle applications.
2) Once a column was added to FND_HISTOGRAM_COLS, there is no way to distinguish between seeded histograms and the custom created histograms (make sure to take note of that).
3) Make sure that you really need histogram in a particular column. If you added a histogram and it did not help in the problem that you were investigating, drop it.
References
Note 122371.1 - How To Gather Statistics For Oracle Applications 11iHowever FND_STATS can not be used to gather statistics for SYS schema:
1 select line,text
2 from dba_source
3 WHERE TEXT LIKE '%SYS%'
4* AND NAME='FND_STATS'
SQL> /
LINE
TEXT
--------------------------------------------------------------------------------
16 fnd_statown varchar2(30) := 'APPLSYS'; -- Owner of the backup table
939 if (upper(schemaname) <> 'SYS') then
1224 else -- schema is SYS, print message in log.
1225 dlog('Gathering statistics on the SYS schema using FND_STATS is not allowed.');
1226 dlog('Please use DBMS_STATS package to gather stats on SYS bjects.');
1227 end if; -- end of schema<> SYS
6 rows selected.
So, you should run this command once daily on your instance to be current on SYS statistics as collection of SYS statistics is mandatory in 10g:
execute dbms_stats.gather_dictionary_stats();
I have asked Oracle in an SR about how often this should be run. Will update the post once I learn.
Wednesday, June 25, 2008
The 13th OATM tablespace APPS_TS_TOOLS
Customers who have migrated to the new Oracle Applications Tablespace Model and have applied Oracle Applications Technology Family Pack 11i.ATG_PF.H Rollup 4 may encounter the following error when running the AD Splicer to introduce a new product schema:
alter user xxx quota unlimited on APPS_TS_TOOLS
AD Splicer error:
The following ORACLE error:
ORA-00959: tablespace 'APPS_TS_TOOLS' does not exist
To correct this error, create the APPS_TS_TOOLS tablespace, either manually through SQL*Plus or by invoking the Tablespace Migration Utility menu. For more information, see: Understanding the Tablespace Migration Utility Main Menu, Oracle Applications System Administrator's Guide - Configuration.
The default initial size for the APPS_TS_TOOLS tablespace is 500 MB, with auto segment management enabled. If you create the APPS_TS_TOOLS tablespace through SQL*Plus, outside of the OATM utility, you can use the following statement:
CREATE TABLESPACE APPS_TS_TOOLS DATAFILE
'datafile_name.dbf' SIZE 500M
EXTENT MANAGEMENT LOCAL AUTOALLOCATE;
You can override these storage recommendations with storage parameters to suit the expected size required for objects that will be in the Tools tablespace at your site.
APPS_TS_TOOLS is used to store objects from several tools components like SSO , OID , LDAP, Portal , Discoverer, etc.
This tablespace must exist before using the Release 12 patching tools like adpatch.
Originally there were 12 tablespaces in OATM as per OATM FAQ:
How many tablespaces are introduced in OATM? ?
OATM contains twelve consolidated tablespaces for all products, including temporary tablespace, system tablespace, and undo segments:
| Tablespace Type | Tablespace Name | Contents |
| Transaction Tables | APPS_TS_TX_DATA | Tables that contain transaction data. |
| Transaction Indexes | APPS_TS_TX_IDX | Indexes on transaction tables. |
| Reference | APPS_TS_SEED | Reference and set-up data and indexes. |
| Interface | APPS_TS_INTERFACE | Interface and temporary data and indexes. |
| Summary | APPS_TS_SUMMARY | Summary management objects, such as materialized views, and other objects that record summary information. |
| Nologging | APPS_TS_NOLOGGING | Materialized views not used for summary management and temporary objects. |
| Advanced Queuing/AQ | APPS_TS_QUEUES | Advanced Queuing and dependent tables and indexes. |
| Media | APPS_TS_MEDIA | Multimedia objects, such as text, video, sound, graphics, and spatial data. |
| Archive | APPS_TS_ARCHIVE | Archive-purge-related objects |
| Undo | UNDO | Automatic Undo Management (AUM) tablespace. UNDO segments are identical to ROLLBACK segments when AUM is enabled. |
| Temp | TEMP | Temporary tablespace for global temporary table, sorts, and hash joins. |
| System | SYSTEM | System tablespace. |
How are objects classified in OATM?
OATM relies on specific explicit and implicit classification rules. These rules are deternined based on storage considerations for the object type in question. Quite obviously, Tablespace classifications are not relevant for code objects and other objects without storage implications such as View, Policies, Context, triggers, etc. Objects like tables are explicitly classified based on their I/0 characteristics.
What object typesare implicitly classified in OATM?
OATM classifes the following object types:
| Object type | Tablespace Type |
| Index Organized Tables | Transaction_tables |
| Global Temporary Tables | The database automatically always creates these objects in the TEMP tablespace. |
| Advanced Queuing tables | Advanced Queuing/AQ |
| Materialized View | Summary |
| Materialized View Logs | Transaction_tables |
| Domain Indexes | Transaction_indexes |
| Indexes | With the exception of indexes on Tables classified as 'Transaction_Tables', all indexes will share the same tablespace type as the base object (table/mv). |
Tuesday, June 24, 2008
Verifying existance of the table: ADX_PRE_AUTOCONFIG
ERROR
Verifying existance of the table: ADX_PRE_AUTOCONFIG
Table does not exist. Exiting RestoreProfile...
-------------------ADX Database Utility Finished---------------
Verifying connection to the Database : Established
Restore Profile Feature : Disabled
No Restore Profile file created.
This is due to unpublished Bug 4604710. They are trying to test a new feature for restoring profiles which requires ADX_PRE_AUTOCONFIG table. However the warning message looks like an error. This was fixed in ADX.F (Patch 3453499) which has been superseded by TXK Rollup S (patch 6372396). So if you apply the latest TXK Rollup patch the message changes to :
Restore Profile utility ran successfully
===========================================================================
AutoConfig is exiting with status 0