Exclude a table from GATHER SCHEMA STATISTICS
Hello All,
How do you exclude a table from gather schema statistcs?
Thanks.
Gregg
hi,
it is explained here:--
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_stats.htm#i1043993
LOCK_TABLE_STATS Procedure
This procedure locks the statistics on the table.
Syntax
DBMS_STATS.LOCK_TABLE_STATS (
ownname VARCHAR2,
tabname VARCHAR2);
thanks.
Edited by: varun4dba on Dec 10, 2010 7:39 PM
Similar Messages
-
Exclude MV Table from gather schema stats
Hey,
I am running the daily stats gathering procedure below.
But it is running at the same time with an MV that is refreshing,and it's failing due to that.
Is it possible to exclude the Materialized view from the below schema stats procedure?
BEGIN
dbms_stats.gather_schema_stats(ownname=>'SCOTT',estimate_percent=>dbms_stats.auto_sample_size,degree=>2);
END;
This is running on Oracle 10.2.1.0, on Linux env.You could lock the statistics onto the tables you don't want to re-gather stats : dbms_stats.lock_table_stats
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_stats.htm#i1043993
Then run the mentioned command will not compute stats on those objects.
Nicolas. -
How to exclude some tables from schema level replicatio????
Hi,
I am working on oracle10g stream replication.
My replication type is "Schema Based".
So can anyone assist me to undersatnd, how to exclude some tables from schema based replication.
Thanks,
FaziarainYou can use rules and include them in the rule set, lets say you dont want LCR to be queued for table_1 in schema SALES, write two rules one for DDL and another for DML with NOT logical condition.
DBMS_RULE_ADM.CREATE_RULE(
rule_name => 'admin.SALES_not_TALBE_1_dml', condition => ' (:dml.get_object_owner() = ''SALES'' AND NOT ' ||
' :dml.get_object_name() = ''REGIONS'') AND ' ||
' :dml.is_null_tag() = ''Y'' ');
DBMS_RULE_ADM.CREATE_RULE(
rule_name => 'admin.hr_not_regions_dlll',
condition => ' (:dml.get_object_owner() = ''SALES'' AND NOT ' ||
' :ddl.get_object_name() = ''table_!'') AND ' ||
' :dsl.is_null_tag() = ''Y'' ');
just go through this document once, http://download.oracle.com/docs/cd/B28359_01/server.111/b28321/strms_rules.htm#i1017376
Edited by: user8710159 on Sep 16, 2009 5:21 PM -
Hi All,
When I run gather schema statistics, it is completing status normal . But it took only 45 min.
EBS - 12.1.3
DB - 11.2.0.3
OS - RHEL 64
As per my understanding , it will take 2-3 hrs. After DB upgraded to 11.2.0.3, got an completd with error and followd the note: Gather Schema Statistics fails with Ora-20001 errors after 11G database upgrade [ID 781813.1]
After that it completd with normal. But it took time only 45 min max in every run. with percentage 10 and 40. My DB size is 90 GB
Request Log file:
Start of log messages from FND_FILE
+---------------------------------------------------------------------------+
In GATHER_SCHEMA_STATS , schema_name= ALL percent= 40 degree = 8 internal_flag= NOBACKUP
stats on table FND_CP_GSM_IPC_AQTBL is locked
stats on table FND_SOA_JMS_IN is locked
stats on table FND_SOA_JMS_OUT is locked
+---------------------------------------------------------------------------+
End of log messages from FND_FILE
+---------------------------------------------------------------------------+
Start of log messages from FND_FILE
+---------------------------------------------------------------------------+
In GATHER_SCHEMA_STATS , schema_name= ALL percent= 10 degree = 8 internal_flag= NOBACKUP
stats on table FND_CP_GSM_IPC_AQTBL is locked
stats on table FND_SOA_JMS_IN is locked
stats on table FND_SOA_JMS_OUT is locked
+---------------------------------------------------------------------------+
End of log messages from FND_FILE
+---------------------------------------------------------------------------+
Now I querey the below :
SQL> select column_name, nvl(hsize,254) hsize from FND_HISTOGRAM_COLS where table_name = 'JE_BE_LINE_TYPE_MAP' order by column_name;
COLUMN_NAME HSIZE
SOURCE 254
a) Is this an expected behavior ?
b) If not, please suggest, to fix
Thanks
SALDid the concurrent program fail? -- Gather Schema Statistics Fails With Error For APPLSYS Schema (Doc ID 1393184.1)
Please check the LAST_ANALYZED column of DBA_TABLES and DBA_INDEXES views (Note: 166346.1 - How to Determine When a Table Was Last Analyzed By the Gather Schema Statistics Program).
Thanks,
Hussein -
Gather Schema Statistics improve the performance of the R12 application?
Hi All,
If we run “Gather Schema Statistics” program, it will improve the performance of the R12 application?
Platform Linux and DB version 10.2.0.4.
Thanks & Regards,
TharunHi Tharun,
If we ruer n “Gather Schema Statistics” program, it will improve the performance of the R12 application?
Yes, it will speed up as it ensures to have an up to date statistics.
Please refer notes:
Concurrent Processing - How To Gather Statistics On Oracle Applications Release 11i and/or Release 12 - Concurrent Process,Temp Tables, Manually [ID 419728.1]
How Often Should Gather Schema Statistics Program be Run? [ID 168136.1]
Why Stats Gather?
Stats gathering must be set as a routine job and is recommended to be scheduled. Even though this program is available from the fronted in the form of submitting a concurrent program basically it performs a DB level enhancement and ensures that you have an up to date optimizer statistics.Because the objects in a database can be constantly changing, statistics must be regularly updated so that they accurately describe these database objects.
For indepth understand as to why it should be run, please refer doc:
Managing Optimizer Statistics
Thanks &
Best Regards, -
Gather Schema Statistics Report taking more than 13 hours to complete is it normal?
I have run Gather Schema Statistics Report at 9 pm and it completed on 11am next morning. It almost took more than 13 hours, is this behavior normal.
I have used the following parameter.
Schema name: ALL
Estimate percent:50
Backup Flag :NOBACKUP
History Mode :LASTRUN
Gather Option:GATHER
Invalidate Dependent Cursor : Y
My database size is about 250 GB.
Please replyGather schema stastics is erroring out when i'm using the GATHER_AUTO option with 10%.
Here is the log file
+---------------------------------------------------------------------------+
Application Object Library: Version : 12.0.0
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
FNDGSCST module: Gather Schema Statistics
+---------------------------------------------------------------------------+
Current system time is 13-AUG-2013 10:42:12
+---------------------------------------------------------------------------+
**Starts**13-AUG-2013 10:42:12
ORACLE error 20001 in FDPSTP
Cause: FDPSTP failed due to ORA-20001: SYS_NTGNSVL1S+OCZGRAAHKD9MYG== is an invalid identifier
ORA-06512: at "APPS.FND_STATS", line 774
ORA-06512: at line 1
The SQL statement being executed at the time of the error was: SE
+---------------------------------------------------------------------------+
Start of log messages from FND_FILE
+---------------------------------------------------------------------------+
In GATHER_SCHEMA_STATS , schema_name= ALL percent= 10 degree = 8 internal_flag= NOBACKUP
ORA-20001: SYS_NTGNSVL1S+OCZGRAAHKD9MYG== is an invalid identifier
+---------------------------------------------------------------------------+
End of log messages from FND_FILE
+---------------------------------------------------------------------------+
+---------------------------------------------------------------------------+
Executing request completion options...
Finished executing request completion options.
+---------------------------------------------------------------------------+
Concurrent request completed
Current system time is 13-AUG-2013 10:43:29
+---------------------------------------------------------------------------+
I have used the following parameters
Schema name: ALL
Estimate percent:10
Backup Flag :NOBACKUP
History Mode :LASTRUN
Gather Option:GATHER_AUTO
Invalidate Dependent Cursor : Y -
How often we need to run gather schema statistics etc.. ??
HI,
Am on 11.5.10.2
RDBMS 9.2.0.6
How often we need to run the following requests in Production...
1.Gather schema statistics
2.Gather Column statistics
3.Gather Table statistics
4.Gather All Column statisitics
ThanksHi;
We discussed here before about same issue. Please check below thread which could be helpful about your issue:
How often we need to run gather schema statistics
Re: Gather schema stats run
How we can collect custom schema information wiht gather statistics
gather schema stats for EBS 11.5.10
gather schema stats conc. program taking too long time
Re: gather schema stats conc. program taking too long time
How it runs
Gather Schema Statistics
http://oracle-apps-dba.blogspot.com/2007/07/gather-statistics-for-oracle.html
gather statistict collect which informations
Gather Schema Statistics...
Regard
Helios -
Hi
I ran gather schema Statistics
In GATHER_SCHEMA_STATS , schema_name= ALL percent= 10 degree = 4 internal_flag= NOBACKUP
the error are:
stats on table AQ$_WF_CONTROL_P is locked
stats on table FND_CP_GSM_IPC_AQTBL is locked
Error #1: ERROR: While GATHER_TABLE_STATS:
object_name=AP.JE_FR_DAS_010***ORA-20001: invalid column name or duplicate columns/column groups/expressions in method_opt***
Error #2: ERROR: While GATHER_TABLE_STATS:
object_name=AP.JE_FR_DAS_010_NEW***ORA-20001: invalid column name or duplicate columns/column groups/expressions in method_opt***
Error #3: ERROR: While GATHER_TABLE_STATS:
object_name=AP.JG_ZZ_SYS_FORMATS_ALL_B***ORA-20001: invalid column name or duplicate columns/column groups/expressions in method_opt***
I ran this while ago.
anyone can help me to fix it
ThanksPlease see old threads which discuss the same issue -- http://forums.oracle.com/forums/search.jspa?threadID=&q=Gather+AND+Schema+AND+Statistics+AND+ORA-20001&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
Thanks,
Hussein -
Gather Schema Statistics issue?
Hi
Actually, we have a custom schema in our EBS R12.0.6 instance database. But i have observed that, 'Gather Schema Statistics' program is not picking-up this schema. why? May be something wrong with database schema registration but since 1 & half year the interface associated with this schema is running fine. I do not know,how to resolve this issue?
I can manually run 'Gather Table Statistics' program against all tables.
RegardsHi;
Actually, we have a custom schema in our EBS R12.0.6 instance database. But i have observed that, 'Gather Schema Statistics' program is not picking-up this schema. why? May be something wrong with database schema registration but since 1 & half year the interface associated with this schema is running fine. I do not know,how to resolve this issue?For can run hather stat for custom schema please check
gather schema stats for EBS 11.5.10
gather schema stats for EBS 11.5.10
I can manually run 'Gather Table Statistics' program against all tables. Please see:
How To Gather Statistics On Oracle Applications 11.5.10(and above) - Concurrent Process,Temp Tables, Manually [ID 419728.1]
Also see:
How to work Gather stat
Gather Schema Statistics
http://oracle-apps-dba.blogspot.com/2007/07/gather-statistics-for-oracle.html
Regard
Helios -
Gather Schema Statistics - GATHER AUTO option failing to gather stats
Hi ,
We recently upgraded to 10g DB and 11.5.10 version of Oracle EBS. I want to employ GATHER AUTO option while running Gather Schema Statistics.
To test the working, I created a test table with 1 million rows. Then, stats were gathered for this table alone by using Gather Table Stats. Now, I deleted ~12% of rows & issued commit. The table all_tab_statistics shows that the table has stale statistics (stale stats column = YES). After that I ran Gather Schema Stats for that particular schema. But the request did not pick the test table to be gathered.
What is the criterion on which Oracle chooses which all tables to be gather statistics for under Gather Auto option? I am aware of the 10% change in data, but how is this 10% calculated? Is it only based on (insert + update + delete)?
Also, what is the difference between Gather Auto and Gather Stale ?
Any help is appreciated.
Thanks,
JithinRandalf,
FYI.. this is what happens inside the concurrent progarm call.. there are a few additional parameters for output/ error msgs:
procedure GATHER_SCHEMA_STATS(errbuf out varchar2,
retcode out varchar2,
schemaname in varchar2,
estimate_percent in number,
degree in number ,
internal_flag in varchar2,
request_id in number,
hmode in varchar2 default 'LASTRUN',
options in varchar2 default 'GATHER',
modpercent in number default 10,
invalidate in varchar2 default 'Y'
is
exist_insufficient exception;
bad_input exception;
pragma exception_init(exist_insufficient,-20000);
pragma exception_init(bad_input,-20001);
l_message varchar2(1000);
Error_counter number := 0;
Errors Error_Out;
-- num_request_id number(15);
conc_request_id number(15);
degree_parallel number(2);
begin
-- Set the package body variable.
stathist := hmode;
-- check first if degree is null
if degree is null then
degree_parallel:=def_degree;
else
degree_parallel := degree;
end if;
l_message := 'In GATHER_SCHEMA_STATS , schema_name= '|| schemaname
|| ' percent= '|| to_char(estimate_percent) || ' degree = '
|| to_char(degree_parallel) || ' internal_flag= '|| internal_flag ;
FND_FILE.put_line(FND_FILE.log,l_message);
BEGIN
FND_STATS.GATHER_SCHEMA_STATS(schemaname, estimate_percent,
degree_parallel, internal_flag, Errors, request_id,stathist,
options,modpercent,invalidate);
exception
when exist_insufficient then
errbuf := sqlerrm ;
retcode := '2';
l_message := errbuf;
FND_FILE.put_line(FND_FILE.log,l_message);
raise;
when bad_input then
errbuf := sqlerrm ;
retcode := '2';
l_message := errbuf;
FND_FILE.put_line(FND_FILE.log,l_message);
raise;
when others then
errbuf := sqlerrm ;
retcode := '2';
l_message := errbuf;
FND_FILE.put_line(FND_FILE.log,l_message);
raise;
END;
FOR i in 0..MAX_ERRORS_PRINTED LOOP
exit when Errors(i) is null;
Error_counter:=i+1;
FND_FILE.put_line(FND_FILE.log,'Error #'||Error_counter||
': '||Errors(i));
-- added to send back status to concurrent program manager bug 2625022
errbuf := sqlerrm ;
retcode := '2';
END LOOP;
end; -
Is it possible to export tables from diffrent schema using expdp?
Hi,
We can export tables from different schema using exp. Ex: exp user/pass file=sample.dmp log=sample.log tables=scott.dept,system.sales ...But
Is it possible in expdp?
Thanks in advance ..
Thanks,Hi,
you have to use "schemas=user1,user2 include=table:"in('table1,table2')" use parfileexpdp scott/tiger@db10g schemas=SCOTT include=TABLE:"IN ('EMP', 'DEPT')" directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log{quote}
I am not able to perform it using parfile also.Using parfile it shows "UDE-00010: multiple job modes requested, schema and tables."
When trying the below, i get error
{code}
bash-3.00$ expdp directory=EXP_DUMP dumpfile=test.dmp logfile=test.log SCHEMAS=(\'MM\',\'MMM\') include=TABLE:\"IN\(\'EA_EET_TMP\',\'WS_DT\'\)\"
Export: Release 10.2.0.4.0 - 64bit Production on Friday, 15 October, 2010 18:34:32
Copyright (c) 2003, 2007, Oracle. All rights reserved.
Username: / as sysdba
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYS"."SYS_EXPORT_SCHEMA_01": /******** AS SYSDBA directory=EXP_DUMP dumpfile=test.dmp logfile=test.log SCHEMAS=('MM','MMM') include=TABLE:"IN('EA_EET_TMP','WS_DT')"
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 0 KB
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "MM"."EA_EET_TMP" 0 KB 0 rows
ORA-39165: Schema MMM was not found.
Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
/export/home/nucleus/dump/test.dmp
Job "SYS"."SYS_EXPORT_SCHEMA_01" completed with 1 error(s) at 18:35:19
{code}
When checking expdp help=y shows :-
{code}TABLES Identifies a list of tables to export - one schema only.{code}
As per few testing,tables from different schemas are not possible to export using expdp in a single command.
Anand -
Export dump only 1000 tables from the schema which contains 3000 tables.
Hi,
I have an requirement to export the dump only with particular 1000 tables from the schema which contains 3000 tables.
As I want to take the dump, I need to mention the List of tables in "TABLES" Parameter. But syntax won't allow for 1000 tables.
Kindly guide me on this to proceed further to take the dump of only particular 1000 tables.
Thanks in advance.
Thanks,
Orahar.I have an requirement to export the dump only with particular 1000 tables from the schema which contains 3000 tables.
As I want to take the dump, I need to mention the List of tables in "TABLES" Parameter. But syntax won't allow for 1000 tables.
Kindly guide me on this to proceed further to take the dump of only particular 1000 tables.You haven't mentioned the oracle release version.
if you're using 10g, you could use datapump export/import to achieve this. Not a straight way.
Check Metalink Export/Import DataPump Parameters INCLUDE and EXCLUDE - How to Load and Unload Specific Objects - 341733.1
Under section 9. Exporting or Importing a large number of objects.
HTH
-Anantha -
Hi,
In short: How to suppress compiler errors without excluding the object from the "Schema Compare" tool ??
A bit longer:
We have a SQL Server 2008 project in Visual Studio 2013 running SQL Server Data Tool.
An old database, with a lot of history in, has been imported into SSDT and there are many syntax errors preventing the project from compiling/running. An typical error is: "SQL70001: This statement is not recognized in this context".
Running the "faulty" scripts on the server, executes just fine. I understand that there are syntax errors and they should be rewritten, but it's not gonna happen just like that - it is a slow process over a long period of time.
I know it is possible to change Build Action to None, but that also exclude the object from appearing in the Schema Compare function/window.
So - how to ignore some compiler errors and still having the objects to appear when doing "Schema Compare" ??
Thank you in advance.Hi Steven,
Thanks for your comments.
Well, it sure does help in the future, but right now i would prefer the other way - to suppress some errors and still allow the scripts to build.
The thing is that if we "rewrite" the objects into create scripts, then we have a huge test job ahead of us + the database environments (PROD vs DEV and UAT) does not share the same AD or DB users and therefore grants is lost if dropping/creating
objects, right!
If you drop a object before creating it, the drop will also drop the roles and grants and since they don't share user table, the create will not be able to add the permissions again. There might be a solution to that, but it is going to be very complicated
for some newbies like us. We need something we can trust.
BR
Peter -
Accessing tables from different schema in CDS and AMDP
Hi All,
We are working on a HANA system which has several schema replicated from SAP R/3/Non SAP systems. We have BW 7.4 SP9 deployed on the same system and accessing the HANA views using latest BW virtual objects such as Open ODS , Composite providers etc.
We are also using the BW system for few ABAP based data processing developments. We are currently accessing HANA views in ABAP programs by creating dictionary views based on external HANA views.
We would like to however use recent possibilities of CDS and AMDP for better life cycle management of ABAP based solutions. The open SAP course on this subject was of very good help. Thanks a lot "open SAP team" for that. I would however have few open questions,
As I understand AMDP gives us full flexibility of writing sql procedures within ABAP development environment, but can we access tables from different schema into AMDP code. If yes, then sample code would help.
If the answer of first question is yes, then how do we manage transports between development and production systems where the schema names would be different. Currently in open HANA developments, such transport is manged using Schema mapping.
Can I also use different schema tables in CDS views.
We are updating few tables in ABAP dictionary after applying processing logic in ABAP program as detailed in step 1. With the new approach using AMDP, can we directly update database schema tables which will give us an optimization advantage.
New ABAP HANA program interfaces are quite promising and we would like to use them to optimize many data intensive applications.
Thanks & Regards,
AnilHi Anil,
I can only answer 1. and 2. (and would be interested into 3. as well):
1.
Yes you can access tables from a different schema and also HANA views. In this case no 'using' is needed.
Examples:
RESULT = SELECT
FROM
"SAP_ECC"."T441V" AS t,
"_SYS_BIC"."tmp.package/AFPO" AS a.
WHERE ...
2. In this case, if you need schema mapping: You could use HANA (projection) views which just forward to a different schema, also see example.
Best regards,
Christoph -
How can we copy table from one schema to other schema
Hi,
I have create one table in one schema and i want to copy it to other schema.How we can copy table from one schema to other schemaHi,
You can try something like this :-
SQL> CONNECT SYS/SYS123@SERVER AS SYSDBA
Connected.
SQL> CREATE USER TEST_1 IDENTIFIED BY TEST_1;
User created.
SQL> CREATE USER TEST_2 IDENTIFIED BY TEST_2;
User created.
SQL> GRANT CONNECT,RESOURCE,DBA TO TEST_1;
Grant succeeded.
SQL> GRANT CONNECT,RESOURCE,DBA TO TEST_2;
Grant succeeded.
SQL> CONNECT TEST_1/TEST_1@SERVER
Connected.
SQL> CREATE TABLE TEST_COPY ( TEST_COL NUMBER );
Table created.
SQL> INSERT INTO TEST_COPY VALUES ( 1 );
1 row created.
SQL> INSERT INTO TEST_COPY VALUES ( 2 );
1 row created.
SQL> COMMIT;
Commit complete.
SQL> GRANT ALL ON TEST_COPY TO TEST_2;
Grant succeeded.
SQL> CONNECT TEST_2/TEST_2@SERVER
Connected.
SQL> CREATE TABLE TEST_COPY AS SELECT * FROM TEST_1.TEST_COPY;
Table created.
SQL> SELECT * FROM TEST_COPY;
TEST_COL
1
2Regards,
Sandeep
Maybe you are looking for
-
TS4337 Is there a search field in iCal on iCloud?
Seems like a very basic function that i have needed repeatedly yet it doesn't seem to be there. Help?
-
Complete Novice "can it be done"
I have a swf file running in a cell of a table, my idea is to have a movie with individual sections coresponding to individual pages on a site. what i wnat to do, if possible is have some form of command line a page, so when a page is loaded it autom
-
I have literally no storage space left after installing iOS 8. I can't reinstall any of my previous apps because iOS 8 took up all of my storage space. I heard that this is temporary, and if so, when will my storage space be freed up again? Please no
-
What's the Oracle Standard for generating Output & logfile for Conc Prog?
Is there any Oracle Standard for generating output and log files for standard concurrent programs and reports. for example: if Error, only Log no output if Warning, Log & output Complete Normal, Log & output Any help is appreciated... Thanks, Subhade
-
So I updated to OS X Maverick(s) and backuped my harddrive and got a new one installed, everything seems okay but some things are missing in my settings like the software update icon. Does anyone know how I can get it back?