How to collect statistics on the table for tables in a different schema
Hi allI have a table in a schema, and I want to collect statistics for the table in a different schema.
I gave GRANT ALL ON SCHEMA1. T1 TO SCHEMA2;
And when I tried to run the command to collect statistics to help
DBMS_STATS. GATHER_TABLE_STATS (OWNNAME = > 'SCHMEA1', TABNAME = > 'T1');
The function will fail.
Is there a way we can collect statistics of the table for tables in a schema into another schema.
Thank you
MK.
You must grant analyze to schema2.
SY.
Tags: Database
Similar Questions
-
Collect statistics of the table in windows
Hello
Could you please help me to collect statistics for the tables below in Windows. I tried collection using dbms_scheduler job for a table, but it is not the collection of statistics for tables.
TABLE_NAME OWNER NUM_ROWS BLOCKS Size MQRDW DWREFERENCETRACE GO 2891985937 26372904, 17.86
TRAY PON_SERIAL 563722072 5135734 GB 8,12
TRAY PON_PSN 23588517 32009064 2.67 GB TRAY PON_BOM_LOG 37199475 212936 601 MB
TRAY UNIQUE_ITEM_LOTS 6633907 79710 160 MB
TRAY PON_BOM 5921377 41717 328 MB SQL > start
(2 dbms_scheduler.create_job)
job_name 3 = > "SCOTT_JOB_SCHEDULE"
job_type 4 = > "EXECUTABLE."
5 job_action = > ' begin dbms_stats.gather_table_stats (ownname = > "TRACE3")
6 tabname = > 'PON_PSN ',.
estimate_percent 7 = > 30,
Cascade 8 = > true,
method_opt 9 = > 'for all THE COLUMNS of SIZE 1.
10 degrees = > 5,
11 options = > "BRINGING OUTDATED"); end;',
12 repeat_interval = > ' freq = daily; byhour = 04; byminute = 0; bysecond = 0; »,
13 active = > TRUE,
14 comments = > ' custom stats collection for engine risk ");
15 end;
17 N
PL/SQL procedure successfully completed .
Total number of CPU available on this server is 8
Oracle - 10.2.0.4.0
OS - windows
Kind regards
Bala
52 million lines?
and how to change every day or be inserted?
It is possible that you can never bring his stats again
and everything will probably continue to work as expected
read the guide to setting performance to understand why you need to collect statistics and when
https://docs.Oracle.com/CD/E11882_01/server.112/e41573/stats.htm#PFGRF94714
After reading this guide, you'll be ready for any question, you get all that against this team
Sometimes you need to say 'no' and why the answer is 'no '.
-
collect statistics of the table
Hi all
DB version: 10.2.0.4
OS: AIX 6.1
I want to collect the stats table for a table as the query that uses that table is slow. Also, I noticed that this table is using full table scan, and it has been analyzed in last 2 months back.
I intend to run the query to collect the statistics below. The table has 50 million records.
COUNT (*)
----------
51364617
I expect that this will take time if I run the query as below.
DBMS_STATS.gather_table_stats EXEC ('schema_name', 'table_name');
My doubts specified below.
1. can I use the also estimate_percent parameter to collect statistics?
2 should. how much we indicate for the estimate_percent parameter?
3. what difference it will make if I use the estimate_percent parameter?
Thanks in advance
Published by: user13364377 on March 27, 2012 13:28If you are worried about the stats of collection process for a long time running, consider collecting statistics in parallel.
1. can you use estimate_percent? Sure! Go ahead.
2. what percentage of use? Why not let the data decide with auto_sample_size? Various "rules of thumb" were thrown around over the years, usually about 10 to 20%.
3. what difference it will make? Very little, no doubt. Occasionally, you can see where a small sample makes a difference, but in general that it's perfectly ok to estimate its stats.Maybe something like this:
BEGIN dbms_stats.gather_table_stats(ownname => user, tabname => 'MY_TABLE', estimate_percent => dbms_stats.auto_sample_size, method_opt=>'for all columns size auto', cascade=>true,degree=>8); END;
-
Collect statistics on the table with indexes of text only?
I gathered statistics for a table that contains a text index
EXEC DBMS_STATS. GATHER_TABLE_STATS (USER, 'CONADDR', estimate_percent = > 10, block_sample = > TRUE, cascade = > TRUE);
There are a lot of tables/indexes not monitored (e.g. DR$ TI_CONADDR$ I). Do I have to analyse the tables there, too? The Guide Tuning Oracle text mentions just to analyze the table of "base".
Oracle DB version is 10.2.0.4.
select table_name, last_analyzed, num_rows from dba_tables where table_name like '%CONADDR%'; CONADDR 11.08.2010 10:29:37 17944660 DR$TI_CONADDR$I DR$TI_CONADDR$R DR$TI_CONADDR$K DR$TI_CONADDR$N select index_name, table_name, last_analyzed, num_rows from dba_indexes where table_name like '%CONADDR%'; SYS_IL0003730268C00004$$ CONADDR IDX_CONADDR CONADDR 11.08.2010 10:29:46 17106050 SYS_IL0003731165C00006$$ DR$TI_CONADDR$I SYS_IOT_TOP_3731168 DR$TI_CONADDR$K SYS_IL0003731170C00002$$ DR$TI_CONADDR$R SYS_IOT_TOP_3731173 DR$TI_CONADDR$N DR$TI_CONADDR$X DR$TI_CONADDR$I 11.08.2010 10:05:05 67585029 TI_CONADDR CONADDR 11.08.2010 10:29:46
DR$ table do NOT need to be analysed - and should not be.
As "secondary objects", they will not be analyzed by orders based on patterns, and it is strongly recommended to not analyze manually. All commands that access these tables are set correctly without the input of the optimizer.
-
How to share data in the tables ' User_ * ' with another schema
I want to share the data in the table WHERE USER_SEGMENTS with another schema. If I create a view and grant select on the view, when the other schema queries the view data are identical to themselves querying the SYS.user_segments table directly.
My guess is that the SYS.user_segments table is a view based on the current user.create view sys_user_segments as select * from sys.user_segments; grant select on sys_user_segments to A;
Is there a way to share such data without creating a copy of the table?
Oracle: 10g
Thank youIf the ADMINISTRATOR is concerned about B access to DBA_SEGMENTS (or by creating DBA_SEGMENTS views that belongs to a user who has access on top and then grant access to this view of B), it seems pretty crazy allow that kind of database connection.
If you create a database link belonged to B that connects to A, B is, in substance, given any privilege that has exercises. But it is done in a very, very dark which will no doubt be neglected in the future when someone gets a check. He'll be sitting here to wait that someone (accidentally or intentionally) Decides to exploit the security hole and do something that is causing a problem (by removing all data from a table, grabbing all the sensitive data in a table, etc.). Risks of this almost certainly far, far* far * outweigh the risks of even leaving B to obtain direct access to DBA_SEGMENTS.
Justin
-
Compare the table structures in different schemas. help please
Hi all
I have a question...
I have pictures on different schemas something like
Diagram A
-------------
Table 1
Table 2
Table 3
Diagram B
------------
Table 1
Table 2
Table 3
Now situation is table 1 and table 2 will have a similar structure or table 1 in Figure B will have additional columns.
like so... on... for all other tables...
example!
Now I need to write some sort of procedure for the thing to compare these tables which are in different in the column names in the schema and get it had exported to an Excel sheet.Schema A: Desc Table 1; Name Type Null ------------- ------- ------- No Number Notnull Name Varchar2(10) Not null Fee Number (10,2) Not null Scheam B; Desc Table1; Name Type Null ------------- ------- ------- DX_No Number Notnull DX_Name Varchar2(10) Not null DX_Fee Number (10,2) Not null comments Varchar(2)
and here it's first three columns SHOULD BE CONSIDERED AS SAME even if the DX_ prefix are from the REST OF the PART OF THE COLUMN NAME IS SAME.
and the same way commit coloumn new schema B only... So it should be noted that excel sheets...
I don't know how the ADO or SQL Developer handle this... Is there any plsql block that I can write to do it...
Thanks in advance...Comparison of columns on all the tables in the two schema
select tc1.owner,tc1.TABLE_NAME,tc1.COLUMN_NAME, tc2.owner,tc2.TABLE_NAME,tc2.COLUMN_NAME from all_tab_columns tc1 full outer join all_tab_columns tc2 on &user1=tc2.owner and tc1.TABLE_NAME=tc2.TABLE_NAME and tc1.COLUMN_NAME like '%'||tc2.COLUMN_NAME where tc1.owner=&user2 and tc1.TABLE_NAME in ( select t1.table_name from all_tables t1 join all_tables t2 on t2.owner=&user2 and t1.table_name=t2.table_name where t1.owner=&user1)
Published by: xtender on 06.11.2010 12:43
-
Move the tables to a different tablespace
Hello
I created 6 tables with my account in the USERS tablespace. If users wish to access (and he has privileges), it can be accessed as - username.nameoftb.
Now, I would like to create new tablespace, move there all the USERS tablespace tables and if someone (who has permissions) to have access, it can, but only with the table name. Without using the username who created them.
Could you please help me, how to proceed?
-move the tables to a different tablespace
-users can access without using the name of the creator
Thank you!1. change the SMSC table. ERSUSERWISESUMMARY move tablespace ERST_01 nologging;
Can also rebuild the indexes as well.
ALTER Index SMSC. INDX_ERSDATA_STRTTIME reconstruction tablespace ERSX_01 nologging;
2 create a synonym for this object
create public synonym mrbt_activation for owner_name.object_name;
Concerning
Asif Kabir -
How to collect statistics for a partition?
Hi all
I create a table partition. I need to collect statistics for this partition only. Before I used to analyze it, but now I need to analyze using DBMS_STATS.
What is the best way to analyze the partition using DBMS_STATS?
How long will it take to complete?
How can I estimate the time of accomplishment for DBMS_STATS before starting?
Thank you
I create a table partition. I need to collect statistics for this partition only. Before I used to analyze it, but now I need to analyze using DBMS_STATS.
What is the best way to analyze the partition using DBMS_STATS?
Follow the documented instructions: INCREMENTIELLE TRUE and GRANULARITY on AUTO.
See the section "Partitioned objects statistics" the doc of performance tuning
http://docs.Oracle.com/CD/B28359_01/server.111/b28274/stats.htm#i42218
With partitioned tables, the new data is usually loaded into a new partition. As new partitions are added and loaded, statistical data must be collected on the new partition and statistics need to be updated. If the
INCREMENTAL
for a partition table is set to the valueTRUE
, and collect you statistics on the table with theGRANULARITY
parameter defined onAUTO
, Oracle will collect statistics on the new partition and update statistics on the overall table by scanning only those partitions which have been modified and not the entire table. If theINCREMENTAL
for the partitioned table is set to the valueFALSE
(the default), then a full table scan is used to maintain the global statistics. It is a highly resource intensive and time-consuming for large party.How long will it take to complete?
No way to know - using an estimate of 10% takes less time than with an estimated of 40%, which takes less time than using 100%.
How can I estimate the time of accomplishment for DBMS_STATS before starting?
By comparing the amount of data and the percentage of estimate for the data that you have in the other partitions and the time required to collect statistics on other partitions.,.
-
How can I import tables from a different schema in the relational model... to add these tables in the existing relational/logic model? PLSS help
Notes; I already have a schema ready relational/logic model... and I need to add more tables to this relational/logic model
can I import the same way like I did before?
But even if I do the same how can I add it in the template? as the logic model has been designed...
Help, please...
Thank you
To view the diagram of logic model in Bachman notation, you right-click on a blank area of the diagram and select the rating > Bachman Notation.
David
-
How can I get all the options for the creation of new titles? I'm stuck on a Board where it does not color or width/size options
If you have not all panels in the Titler then go and reset the current workspace that is located under the window.
-
I have a CC to individuals on the annual plan paid monthly membership. How to pass it to the CC for the teams plan so that I can add my first certificate of employee?
Hi Alexalloy,
This should help. Cancel your subscription or membership. Cloud Creative
See you soon!
~ David
-
How to insert data into the table by using the expression builder in the assign activity
How to insert data into the table by using the expression builder in affect business in BPEl, I use SOA Suite 11.1.1.5
Can someone help me pleaseHello
I don't think that oraext:query-database() can insert data into the table.
What are your needs?
Can not you plan to use the DB adapter with the insert operation?Kind regards
Neeraj Sehgal -
How do I top align the table on the Web page to the top of the browser?
If you look at www.colonialstock.com, you will see that the Web page was made in a tabular format. How do I best align the table, then the gray space above the table is removed?
Add this to your body tag...
LeftMargin = "0" marginheight = "0" marginWidth = "0" topmargin = "0".
-
OSB - How select variable used in the routing for buss request message. serv.
I have "modeling of a stream of messages to a proxy service.
According to the content of the incoming request message, a (conditional) branch is selected. The message must be routed to a business service in this branch.
This service of the company has a different message definition requires that the proxy service. A kind of transformation is probably necessary. (not yet implemented)
Question is how to choose what variable structure (I created a variable of Interface Service for business) that will be used during the call to the sales department.
Only thing that I can choose, the service and operation.
How to continue?The payload for the service of the company must be in the * variable $body. There are also other variables pre-defined as $header and $attachments that could make sense if your need to send SOAP headers or accessories for business service.
-
Join of two tables in two different schemas
Hi all
I have an obligation to join two tables on two different schemas. How to join these two tables in the object view.
Thanks in advance.
Concerning
Kaushik GuillauminYou can do just that using schema name in the +' view object.table name ' + according to the query object and also grant select the another schema to this schema user
ex
you need schem is test and another Act you need to a view object based on the test to join a table on shcema Actyou write semply object sql view code:
Act.table name
and you can also give him select statement on Bill schem table to test
concerning
Maybe you are looking for
-
Pavilion 6510f: add memory to HP 6510f
We wamt to add memory increases from 4 to 8 GB. Is it compatible with my HP 6510f part
-
OEM and Retail Pack Version of Windows OS
What is the difference between the OEM and Retail Pack full of the Windows operating system version? Which one is good to buy and install on PC? How do I install the retail version Pack full on pc/laptop? and any question of service when you use the
-
T420 - AC/DC charging connection possible?
Hello world! Since last week, I got a new T420 and I really like it. At the moment I am trying to configure my energy Manager and I am looking for an option, I know that Dell Latidue laptops. When I work at home I'm still connected to the AC adapter
-
Computer hangs or freezes a few minutes after the beginning
Hi all I hope someone has the knowledge to help me. I have a Dell Vostro 1500, Vista Business x 32 installed. In the last days: * On a normal startup, the computer hangs after a few minutes.I get either 'failure-security options' pop up or the comput
-
Xperia z2 movies playing question
Hi all! I have improved my xperia z2 to version of lollipop. But I realized that there are problems with the playback of movies in mkv format. In the kitkat, it was really good, but now he plays very hard! Everyone else had the problem?