DBA Data[Home] [Help]

APPS.FND_STATS dependencies on DBMS_STATS

Line 142: tmp_str:='BEGIN dbms_stats.ALTER_DATABASE_TAB_MONITORING(monitoring=>'

138: ) THEN
139: -- 8i does not have the ALTER_SCHEMA_TAB_MONITORING function,
140: -- therefore 9i specific function calls have to be dynamic sql.
141: IF schemaname ='ALL' THEN
142: tmp_str:='BEGIN dbms_stats.ALTER_DATABASE_TAB_MONITORING(monitoring=>'
143: ||modbool
144: ||',sysobjs=>FALSE); END;';
145: EXECUTE IMMEDIATE tmp_str;
146: ELSE

Line 147: tmp_str:='BEGIN dbms_stats.ALTER_SCHEMA_TAB_MONITORING(ownname=>:SCHEMANAME,monitoring=>'

143: ||modbool
144: ||',sysobjs=>FALSE); END;';
145: EXECUTE IMMEDIATE tmp_str;
146: ELSE
147: tmp_str:='BEGIN dbms_stats.ALTER_SCHEMA_TAB_MONITORING(ownname=>:SCHEMANAME,monitoring=>'
148: ||modbool
149: ||'); END;';
150: EXECUTE IMMEDIATE tmp_str USING schemaname;
151: END IF;

Line 259: DBMS_STATS.CREATE_STAT_TABLE(fnd_statown,fnd_stattab);

255: IF dummy1 ='Y' THEN
256: stat_tab_exist := true;
257: END IF;
258: IF stat_tab_exist = false THEN
259: DBMS_STATS.CREATE_STAT_TABLE(fnd_statown,fnd_stattab);
260: stat_tab_exist := true;
261: END IF;
262: EXCEPTION
263: WHEN OTHERS THEN

Line 278: DBMS_STATS.CREATE_STAT_TABLE(schemaname,tabname,tblspcname);

274: tblspcname IN VARCHAR2 DEFAULT NULL)
275: IS
276: PRAGMA AUTONOMOUS_TRANSACTION;
277: BEGIN
278: DBMS_STATS.CREATE_STAT_TABLE(schemaname,tabname,tblspcname);
279: EXCEPTION
280: WHEN OTHERS THEN
281: raise;
282: END;

Line 354: DBMS_STATS.EXPORT_SCHEMA_STATS(schemaname, fnd_stattab, statid, fnd_statown);

350: WHEN exist_insufficient THEN
351: NULL;
352: END;
353: IF (upper(schemaname) <> 'ALL') THEN
354: DBMS_STATS.EXPORT_SCHEMA_STATS(schemaname, fnd_stattab, statid, fnd_statown);
355: ELSE
356: FOR c_schema IN schema_cur
357: LOOP
358: DBMS_STATS.EXPORT_SCHEMA_STATS(c_schema.sname, fnd_stattab, statid, fnd_statown);

Line 358: DBMS_STATS.EXPORT_SCHEMA_STATS(c_schema.sname, fnd_stattab, statid, fnd_statown);

354: DBMS_STATS.EXPORT_SCHEMA_STATS(schemaname, fnd_stattab, statid, fnd_statown);
355: ELSE
356: FOR c_schema IN schema_cur
357: LOOP
358: DBMS_STATS.EXPORT_SCHEMA_STATS(c_schema.sname, fnd_stattab, statid, fnd_statown);
359: END LOOP;
360: /* schema_cur */
361: END IF;
362: END;

Line 421: DBMS_STATS.EXPORT_TABLE_STATS(schemaname, tabname, partname, fnd_stattab, statid, CASCADE, fnd_statown) ;

417: EXCEPTION
418: WHEN exist_insufficient THEN
419: NULL;
420: END;
421: DBMS_STATS.EXPORT_TABLE_STATS(schemaname, tabname, partname, fnd_stattab, statid, CASCADE, fnd_statown) ;
422: END;
423: /* BACKUP_TABLE_STATS() */
424: /************************************************************************/
425: /* Procedure: RESTORE_SCHEMA_STATS */

Line 435: DBMS_STATS.IMPORT_SCHEMA_STATS(schemaname, fnd_stattab, statid, fnd_statown);

431: statid IN VARCHAR2 DEFAULT NULL)
432: IS
433: BEGIN
434: IF (upper(schemaname) <> 'ALL') THEN
435: DBMS_STATS.IMPORT_SCHEMA_STATS(schemaname, fnd_stattab, statid, fnd_statown);
436: ELSE
437: FOR c_schema IN schema_cur
438: LOOP
439: DBMS_STATS.IMPORT_SCHEMA_STATS(c_schema.sname, fnd_stattab, statid, fnd_statown);

Line 439: DBMS_STATS.IMPORT_SCHEMA_STATS(c_schema.sname, fnd_stattab, statid, fnd_statown);

435: DBMS_STATS.IMPORT_SCHEMA_STATS(schemaname, fnd_stattab, statid, fnd_statown);
436: ELSE
437: FOR c_schema IN schema_cur
438: LOOP
439: DBMS_STATS.IMPORT_SCHEMA_STATS(c_schema.sname, fnd_stattab, statid, fnd_statown);
440: END LOOP;
441: /* schema_cur */
442: END IF;
443: END;

Line 504: DBMS_STATS.IMPORT_TABLE_STATS(ownname,tabname,partname, fnd_stattab,statid,CASCADE,fnd_statown);

500: partname IN VARCHAR2 DEFAULT NULL,
501: CASCADE IN BOOLEAN DEFAULT true )
502: IS
503: BEGIN
504: DBMS_STATS.IMPORT_TABLE_STATS(ownname,tabname,partname, fnd_stattab,statid,CASCADE,fnd_statown);
505: END;
506: /* RESTORE_TABLE_STATS */
507: /************************************************************************/
508: /* Procedure: RESTORE_INDEX_STATS */

Line 518: DBMS_STATS.IMPORT_INDEX_STATS(ownname,indname,partname,fnd_stattab, statid,fnd_statown) ;

514: statid IN VARCHAR2 DEFAULT NULL,
515: partname IN VARCHAR2 DEFAULT NULL)
516: IS
517: BEGIN
518: DBMS_STATS.IMPORT_INDEX_STATS(ownname,indname,partname,fnd_stattab, statid,fnd_statown) ;
519: END;
520: /* RESTORE_INDEX_STATS */
521: /************************************************************************/
522: /* Procedure: RESTORE_COLUMN_STATS */

Line 533: DBMS_STATS.IMPORT_COLUMN_STATS(ownname, tabname, colname, partname, fnd_stattab, statid, fnd_statown) ;

529: partname IN VARCHAR2 DEFAULT NULL,
530: statid IN VARCHAR2 DEFAULT NULL)
531: IS
532: BEGIN
533: DBMS_STATS.IMPORT_COLUMN_STATS(ownname, tabname, colname, partname, fnd_stattab, statid, fnd_statown) ;
534: END;
535: /* RESTORE_COLUMN_STATS() */
536: /************************************************************************/
537: /* Procedure: RESTORE_COLUMN_STATS */

Line 573: DBMS_STATS.IMPORT_COLUMN_STATS(c_rec.ownname,c_rec.tabname, c_rec.colname,c_rec.partname, fnd_stattab,statid,fnd_statown);

569:
570: BEGIN
571: FOR c_rec IN col_cursor
572: LOOP
573: DBMS_STATS.IMPORT_COLUMN_STATS(c_rec.ownname,c_rec.tabname, c_rec.colname,c_rec.partname, fnd_stattab,statid,fnd_statown);
574: END LOOP;
575: END;
576: /* RESTORE_COLUMN_STATS */
577: /************************************************************************/

Line 589: /* Desciption: Private package that now calls dbms_stats dynamically */

585: FND_FILE.put_line(FND_FILE.log,p_str);
586: END dlog;
587: /************************************************************************/
588: /* Procedure: GATHER_TABLE_STATS_PVT */
589: /* Desciption: Private package that now calls dbms_stats dynamically */
590: /* depending upon the version of the database. For 8i, */
591: /* dbms_stats is called as before, for higher versions, it */
592: /* is called with the no_invalidate flag. */
593: /************************************************************************/

Line 591: /* dbms_stats is called as before, for higher versions, it */

587: /************************************************************************/
588: /* Procedure: GATHER_TABLE_STATS_PVT */
589: /* Desciption: Private package that now calls dbms_stats dynamically */
590: /* depending upon the version of the database. For 8i, */
591: /* dbms_stats is called as before, for higher versions, it */
592: /* is called with the no_invalidate flag. */
593: /************************************************************************/
594: PROCEDURE GATHER_TABLE_STATS_PVT(ownname IN VARCHAR2,
595: tabname IN VARCHAR2,

Line 619: -- and no_inv is true, calls dbms_stats statically, else ...

615: ELSE
616: no_invalidate:='Y';
617: END IF;
618: -- If db version is < 9iR2, OR it is 92 and no_inv is false OR it is > 92
619: -- and no_inv is true, calls dbms_stats statically, else ...
620: IF ( (db_versn <= 92) OR
621: (
622: db_versn=92 AND no_invalidate='N'
623: )

Line 629: DBMS_STATS.GATHER_TABLE_STATS( ownname => ownname ,

625: (
626: db_versn>=100 AND no_invalidate='Y'
627: )
628: ) THEN
629: DBMS_STATS.GATHER_TABLE_STATS( ownname => ownname ,
630: tabname => tabname , estimate_percent => estimate_percent , degree => degree ,
631: method_opt => method_opt , block_sample => FALSE , partname => partname ,
632: CASCADE => CASCADE , granularity => granularity , stattab => stattab , statown => statown );
633: ELSE

Line 634: l_tmp_str:= 'BEGIN DBMS_STATS.GATHER_TABLE_STATS( ownname => :ownname ,'

630: tabname => tabname , estimate_percent => estimate_percent , degree => degree ,
631: method_opt => method_opt , block_sample => FALSE , partname => partname ,
632: CASCADE => CASCADE , granularity => granularity , stattab => stattab , statown => statown );
633: ELSE
634: l_tmp_str:= 'BEGIN DBMS_STATS.GATHER_TABLE_STATS( ownname => :ownname ,'
635: || ' tabname => :tabname ,'
636: || ' estimate_percent => :estimate_percent ,'
637: || ' degree => :degree ,'
638: || ' method_opt => :method_opt ,'

Line 669: /* Desciption: Private package that now calls dbms_stats dynamically */

665: END;
666: /* GATHER_TABLE_STATS_PVT */
667: /************************************************************************/
668: /* Procedure: GATHER_INDEX_STATS_PVT */
669: /* Desciption: Private package that now calls dbms_stats dynamically */
670: /* depending upon the version of the database. For 8i, */
671: /* dbms_stats is called as before, for higher versions, it */
672: /* is called with the invalidate flag. */
673: /************************************************************************/

Line 671: /* dbms_stats is called as before, for higher versions, it */

667: /************************************************************************/
668: /* Procedure: GATHER_INDEX_STATS_PVT */
669: /* Desciption: Private package that now calls dbms_stats dynamically */
670: /* depending upon the version of the database. For 8i, */
671: /* dbms_stats is called as before, for higher versions, it */
672: /* is called with the invalidate flag. */
673: /************************************************************************/
674: PROCEDURE GATHER_INDEX_STATS_PVT(ownname IN VARCHAR2,
675: indname IN VARCHAR2,

Line 693: -- If db version is < 9iR2, calls dbms_stats statically, else ...

689: no_invalidate:='N';
690: ELSE
691: no_invalidate:='Y';
692: END IF;
693: -- If db version is < 9iR2, calls dbms_stats statically, else ...
694: IF (db_versn <= 92) THEN
695: DBMS_STATS.GATHER_INDEX_STATS( ownname => ownname , indname => indname , estimate_percent => estimate_percent , partname => partname );
696: ELSE
697: l_tmp_str:= 'BEGIN DBMS_STATS.GATHER_INDEX_STATS( ownname => :ownname ,'

Line 695: DBMS_STATS.GATHER_INDEX_STATS( ownname => ownname , indname => indname , estimate_percent => estimate_percent , partname => partname );

691: no_invalidate:='Y';
692: END IF;
693: -- If db version is < 9iR2, calls dbms_stats statically, else ...
694: IF (db_versn <= 92) THEN
695: DBMS_STATS.GATHER_INDEX_STATS( ownname => ownname , indname => indname , estimate_percent => estimate_percent , partname => partname );
696: ELSE
697: l_tmp_str:= 'BEGIN DBMS_STATS.GATHER_INDEX_STATS( ownname => :ownname ,'
698: || ' indname => :indname ,'
699: || ' estimate_percent => :estimate_percent ,'

Line 697: l_tmp_str:= 'BEGIN DBMS_STATS.GATHER_INDEX_STATS( ownname => :ownname ,'

693: -- If db version is < 9iR2, calls dbms_stats statically, else ...
694: IF (db_versn <= 92) THEN
695: DBMS_STATS.GATHER_INDEX_STATS( ownname => ownname , indname => indname , estimate_percent => estimate_percent , partname => partname );
696: ELSE
697: l_tmp_str:= 'BEGIN DBMS_STATS.GATHER_INDEX_STATS( ownname => :ownname ,'
698: || ' indname => :indname ,'
699: || ' estimate_percent => :estimate_percent ,'
700: || ' degree => :degree ,'
701: || ' partname => :partname ,';

Line 823: /* insead of dbms_stats.gather_schema_stats */

819: /* Procedure: GATHER_SCHEMA_STATS_SQLPLUS */
820: /* Desciption: Gather schema statistics. This is called by concurrent */
821: /* manager version of GATHER_SCHEMA_STATS. */
822: /* Notes: internal_flag='INTERNAL' will call dbms_utility.analyze_schema*/
823: /* insead of dbms_stats.gather_schema_stats */
824: /* internal_flag='NOBACKUP' will bypass dbms_stats.export_schema_stats */
825: /************************************************************************/
826: PROCEDURE GATHER_SCHEMA_STATS_SQLPLUS(schemaname IN VARCHAR2,
827: estimate_percent IN NUMBER ,

Line 824: /* internal_flag='NOBACKUP' will bypass dbms_stats.export_schema_stats */

820: /* Desciption: Gather schema statistics. This is called by concurrent */
821: /* manager version of GATHER_SCHEMA_STATS. */
822: /* Notes: internal_flag='INTERNAL' will call dbms_utility.analyze_schema*/
823: /* insead of dbms_stats.gather_schema_stats */
824: /* internal_flag='NOBACKUP' will bypass dbms_stats.export_schema_stats */
825: /************************************************************************/
826: PROCEDURE GATHER_SCHEMA_STATS_SQLPLUS(schemaname IN VARCHAR2,
827: estimate_percent IN NUMBER ,
828: degree IN NUMBER ,

Line 1053: EXECUTE IMMEDIATE 'BEGIN DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO; END;' ;

1049: -- if db_versn > 81 then call flush, else use whatever
1050: -- data is available in dtm
1051: IF db_versn > 81 THEN
1052: IF(fm_first_flag) THEN
1053: EXECUTE IMMEDIATE 'BEGIN DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO; END;' ;
1054: fm_first_flag := false;
1055: END IF;
1056: END IF;
1057: -- gather stats for stale tables/partitions. Potentially, there

Line 1281: dlog('Please use DBMS_STATS package to gather stats on SYS objects.');

1277: /* schema_cur */
1278: END IF;
1279: ELSE -- schema is SYS, print message in log.
1280: dlog('Gathering statistics on the SYS schema using FND_STATS is not allowed.');
1281: dlog('Please use DBMS_STATS package to gather stats on SYS objects.');
1282: END IF; -- end of schema<> SYS
1283: END;
1284: /* GATHER_SCHEMA_STATS_SQLPLUS */
1285: /************************************************************************/

Line 1290: /* insead of dbms_stats.gather_schema_stats */

1286: /* Procedure: GATHER_SCHEMA_STATS */
1287: /* Desciption: Gather schema statistics. This is called by concurrent */
1288: /* manager version of GATHER_SCHEMA_STATS. */
1289: /* Notes: internal_flag='INTERNAL' will call dbms_utility.analyze_schema*/
1290: /* insead of dbms_stats.gather_schema_stats */
1291: /* internal_flag='NOBACKUP' will bypass dbms_stats.export_schema_stats */
1292: /************************************************************************/
1293: PROCEDURE GATHER_SCHEMA_STATS(schemaname IN VARCHAR2,
1294: estimate_percent IN NUMBER ,

Line 1291: /* internal_flag='NOBACKUP' will bypass dbms_stats.export_schema_stats */

1287: /* Desciption: Gather schema statistics. This is called by concurrent */
1288: /* manager version of GATHER_SCHEMA_STATS. */
1289: /* Notes: internal_flag='INTERNAL' will call dbms_utility.analyze_schema*/
1290: /* insead of dbms_stats.gather_schema_stats */
1291: /* internal_flag='NOBACKUP' will bypass dbms_stats.export_schema_stats */
1292: /************************************************************************/
1293: PROCEDURE GATHER_SCHEMA_STATS(schemaname IN VARCHAR2,
1294: estimate_percent IN NUMBER ,
1295: degree IN NUMBER ,

Line 1542: EXECUTE IMMEDIATE 'BEGIN DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO; END;' ;

1538: -- if db_versn > 81 then call flush, else use whatever
1539: -- data is available in dtm
1540: IF db_versn > 81 THEN
1541: IF(fm_first_flag) THEN
1542: EXECUTE IMMEDIATE 'BEGIN DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO; END;' ;
1543: fm_first_flag := false;
1544: END IF;
1545: END IF;
1546: -- gather stats for stale tables/partitions. Potentially, there

Line 1743: dlog('Please use DBMS_STATS package to gather stats on SYS objects.');

1739: /* schema_cur */
1740: END IF;
1741: ELSE -- schema is SYS, print message in log.
1742: dlog('Gathering statistics on the SYS schema using FND_STATS is not allowed.');
1743: dlog('Please use DBMS_STATS package to gather stats on SYS objects.');
1744: END IF; -- end of schema<> SYS
1745: END;
1746: /* GATHER_SCHEMA_STATS */
1747: /************************************************************************/

Line 1809: DBMS_STATS.EXPORT_INDEX_STATS( ownname, indname, NULL, fnd_stattab, NULL, fnd_statown );

1805: EXCEPTION
1806: WHEN exist_insufficient THEN
1807: NULL;
1808: END;
1809: DBMS_STATS.EXPORT_INDEX_STATS( ownname, indname, NULL, fnd_stattab, NULL, fnd_statown );
1810: END IF;
1811: FND_STATS.GATHER_INDEX_STATS_PVT(ownname => ownname, indname => indname, partname => partname, estimate_percent => NVL(adj_percent,10), degree=>degree_parallel, invalidate => invalidate ) ;
1812: -- End timestamp
1813: IF(upper(stathist) <> 'NONE') THEN

Line 1964: DBMS_STATS.EXPORT_TABLE_STATS(ownname, tabname, partname, fnd_stattab,NULL,CASCADE,fnd_statown );

1960: EXCEPTION
1961: WHEN exist_insufficient THEN
1962: NULL;
1963: END;
1964: DBMS_STATS.EXPORT_TABLE_STATS(ownname, tabname, partname, fnd_stattab,NULL,CASCADE,fnd_statown );
1965: EXCEPTION
1966: WHEN OTHERS THEN
1967: raise;
1968: END;

Line 2032: -- Due to the limitations of in DBMS_STATS in 8i we need to call

2028: -- If no histogram cols then nullify method ;
2029: IF method = ' FOR COLUMNS ' THEN
2030: method := 'FOR ALL COLUMNS SIZE 1' ;
2031: END IF;
2032: -- Due to the limitations of in DBMS_STATS in 8i we need to call
2033: -- FND_STATS.GATHER_TABLE_STATS twice, once for histogram
2034: -- and once for just the table stats.
2035: IF (method = 'FOR ALL COLUMNS SIZE 1') THEN
2036: BEGIN

Line 2180: DBMS_STATS.EXPORT_COLUMN_STATS(list_ownname(i), t_rec.table_name, list_column_name(i), t_rec.partition, fnd_stattab, NULL, fnd_statown);

2176: EXCEPTION
2177: WHEN exist_insufficient THEN
2178: NULL;
2179: END;
2180: DBMS_STATS.EXPORT_COLUMN_STATS(list_ownname(i), t_rec.table_name, list_column_name(i), t_rec.partition, fnd_stattab, NULL, fnd_statown);
2181: END;
2182: END IF;
2183: -- Build up the method_opt variable
2184: IF (method <> ' FOR COLUMNS ') THEN

Line 2489: DBMS_STATS.EXPORT_COLUMN_STATS ( ownname, tabname, colname, partname, fnd_stattab, NULL, fnd_statown );

2485: EXCEPTION
2486: WHEN exist_insufficient THEN
2487: NULL;
2488: END;
2489: DBMS_STATS.EXPORT_COLUMN_STATS ( ownname, tabname, colname, partname, fnd_stattab, NULL, fnd_statown );
2490: END;
2491: END IF;
2492: -- Now gather statistics
2493: method := 'FOR COLUMNS SIZE '

Line 2521: DBMS_STATS.SET_TABLE_STATS(ownname, tabname, partname, NULL, NULL, numrows, numblks, avgrlen, NULL, NULL);

2517: partname IN VARCHAR2 DEFAULT NULL )
2518: IS
2519: -- PRAGMA AUTONOMOUS_TRANSACTION ;
2520: BEGIN
2521: DBMS_STATS.SET_TABLE_STATS(ownname, tabname, partname, NULL, NULL, numrows, numblks, avgrlen, NULL, NULL);
2522: END;
2523: /* SET_TABLE_STATS */
2524: /************************************************************************/
2525: /* Procedure: SET_INDEX_STATS */

Line 2555: DBMS_STATS.SET_INDEX_STATS(ownname, indname, partname, NULL, NULL, numrows, numlblks, numdist, avglblk, avgdblk, l_clstfct, indlevel, NULL, NULL);

2551:
2552: IF (l_iot = 'TRUE') THEN
2553: l_clstfct := 0;
2554: END IF;
2555: DBMS_STATS.SET_INDEX_STATS(ownname, indname, partname, NULL, NULL, numrows, numlblks, numdist, avglblk, avgdblk, l_clstfct, indlevel, NULL, NULL);
2556: EXCEPTION
2557: WHEN OTHERS THEN
2558: NULL;
2559: END;