Oracle Statistics Global vs Partition
Oracle 9.2.0.8
Solaris 9
I have a partitioned table. I have statistics on each of the partitions, but no global stats on the table. If i want to generate GLOBAL stats with dbms_stats and with GRANULARITY=GLOBAL... will I lose the statistics on the partitions?? I would guess no, since dbms_stats has a explicit delete option.
Thanks in advance.
Can you post sample to show that DBMS_STATS not collecting global stats by default?
By default DBMS_STATS will collect both global and partition stats.
Sample,
SYS@etest> select TABLE_NAME, NUM_ROWS from DBA_TABLES where table_name='TEST' and owner='SYS'
SYS@etest> /
TABLE_NAME NUM_ROWS
TEST
SYS@etest> select TABLE_NAME,PARTITION_NAME,NUM_ROWS from DBA_TAB_PARTITIONS where table_name='TEST' and table_owner='SYS';
TABLE_NAME PARTITION_NAME NUM_ROWS
TEST P1
TEST P2
TEST P3
SYS@etest> exec dbms_stats.gather_table_stats('SYS','TEST')
PL/SQL procedure successfully completed.
SYS@etest> select TABLE_NAME,PARTITION_NAME,NUM_ROWS from DBA_TAB_PARTITIONS where table_name='TEST' and table_owner='SYS'
2 /
TABLE_NAME PARTITION_NAME NUM_ROWS
TEST P1 1942
TEST P2 943
TEST P3 8789
SYS@etest> select TABLE_NAME, NUM_ROWS from DBA_TABLES where table_name='TEST' and owner='SYS'
SYS@etest> /
TABLE_NAME NUM_ROWS
TEST 11674
Similar Messages
-
Windows domain authentication on Oracle Secure Global Desktop
Hello,
I made an upgrade of my oracle secure global desktop 4.62 version to 5.1 version.
The problem is, I was using Windows Domain Authentication in 4.62 and this kind of authentication is not available in the 5.1 version.
So now, my users cannot log in the application.
Do you have a solution ?
ThanksWhat are you authenticating to specifically? An AD server? Are you using any of the supported authentication mechanisms now supported?
http://docs.oracle.com/cd/E41492_01/E41495/html/sgd-authentication.html#system-authentication-mechanisms-table -
In Oracle 10g global support system,I have set parameter of NLS_DATE_FORMAT.I am wondering about that whether it could affect the default value of NLS_TIMESTAMP_FORMAT?
Message was edited by:
frank.qiantest@ORCL> select sysdate from dual;
SYSDATE
24-NOV-06
Elapsed: 00:00:00.00
test@ORCL> DECLARE
2 checkout TIMESTAMP(3);
3 BEGIN
4 checkout := '22-JUN-2004 07:48:53.275';
5 DBMS_OUTPUT.PUT_LINE( TO_CHAR(checkout));
6 END;
7 /
22-JUN-04 07.48.53.275 AM
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
test@ORCL> alter session set nls_date_format="MM/DD/YYYY";
Session altered.
Elapsed: 00:00:00.00
test@ORCL> select sysdate from dual;
SYSDATE
11/24/2006
Elapsed: 00:00:00.00
test@ORCL> DECLARE
2 checkout TIMESTAMP(3);
3 BEGIN
4 checkout := '22-JUN-2004 07:48:53.275';
5 DBMS_OUTPUT.PUT_LINE( TO_CHAR(checkout));
6 END;
7 /
22-JUN-04 07.48.53.275 AM
PL/SQL procedure successfully completed.
test@ORCL> alter session set NLS_TIMESTAMP_FORMAT = 'DD/MM/YYYY HH:MI:SS.FF';
Session altered.
Elapsed: 00:00:00.00
test@ORCL> DECLARE
2 checkout TIMESTAMP(3);
3 BEGIN
4 checkout := '22-JUN-2004 07:48:53.275';
5 DBMS_OUTPUT.PUT_LINE( TO_CHAR(checkout));
6 END;
7 /
22/06/2004 07:48:53.275
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
test@ORCL>
test@ORCL> -
Moving Oracle Home from Disk Partition to SAN Partition
Hi,
We have one task that, we have currently running 10.2.0.1 instance on Disk Partition. We are going to move that Oracle Engine to SAN Partition.
Can I copy all the files from disk partition to san partition? or any other procedure to do so? if any document or link, can you please point me to thatthanks friend....now i understood.. we have Oracle Home and Database Files in single disk partition (/oradata)
(a) we will create new partition wihch is pointed to san -- /new_oradata
(b) Copy the files from /oradata to /new_oradata
(c) umount /oradata
(d) mount the SAN Partition (/new_oradata) to /oradata
Now we are having /oradata partition mountpoint in SAN
thanks buddy.... I think this procedure will work fine..... -
RSRV: Oracle statistics info table for table /BIC/FCube1 may be obsolete
Hi,
I run RSRV on cube1 and got several yellow lines such as:
Oracle statistics info table for table /BIC/FCube1 may be OBSOLETE
Oracle statistics info table for table /BIC/SSalesOrg may be OBSOLETE
Oracle statistics info table for table /BIC/DCube1P may be OBSOLETE
DB statistics for Infocube Cube1 must be recreated.
I read here on SDN that running Correct Error in RSRV is only a temporay fix and that the best solution is to fix it from the database level with BRCONNECT.
But the DBA says she has already run BRCONNECT yet there was no change in these several of the lines which came out as Yellow. ... still same OBSOLETE messages.
1. Any additional sugestions to fix these problems at the database level?
2. In case I decide to fix with Correct Error in RSRV, what issues can I encounter with the cube?
Can this lead to a failure of the cube?
Will users encounter any issues with report?
Does fixing the OBSOLETE in the error message in RSRV have any hazzards?
ThanksHi,
it is years of data but how do you decide that the data is huge to warrant creating a new cube?
You noted that
"verify if it makes sense to copy the data into a new cube "
How do I verify that?
Is creating a new cube the only solution to this OBSOLETE problem?
Why is it referring to only particular tables as OBSOLETE and doesn't that indicate that this is not a problem with the overall cube?
Thanks -
Understand Oracle statistics gathering
Hi experts,
I am new in Oracle performance tuning. can anyone tell me what the mean of "Oracle statistics gathering" in simple words/way. i has read it from Oracle site http://docs.oracle.com/cd/A87860_01/doc/server.817/a76992/stats.htm.
But i am not understand it properly. It Any role in oracle performance tuning? Does it make good performance of Oracle DB???
Reg
HarshitHi,
You can check this in some Easy way :ORACLE-BASE - Oracle Cost-Based Optimizer (CBO) And Statistics (DBMS_STATS)
>> It Any role in oracle performance tuning? Does it make good performance of Oracle DB??? :Yes
HTH -
How to copy statistics of a partition to another??
Hi,
I have a partitioned table (Oracle 9.2).
We will be creating new partitions for increasing data and I would like to copy the statistics of the existing partition for the newly created partition.
Whats the best way to do this?
RegardsHi,
<br>
1. Create a table to hold statistics with <a href=CREATE_STAT_TABLE Procedure. <br>
2. Use EXPORT_TABLE_STATS Procedure to export a partition level stats.<br>
3. Update your own stattab (created in step 1) to change the partition name.<br>
4 Use IMPORT_TABLE_STATS Procedure to import stats into a partition.<br>
<br>
Here a simple example with a table stats level (but for partition, it's the same thing, verify which the column you need to update, where partition name is) :<br>
SQL> create table teststat (col number);
Table created.
--rows insert
SQL> select * from teststat;
COL
1
SQL> select num_rows from dba_tables where table_name = 'TESTSTAT'
SQL> /
NUM_ROWS
SQL> exec DBMS_STATS.GATHER_TABLE_STATS('SYSTEM','TESTSTAT')
PL/SQL procedure successfully completed.
SQL> select num_rows from dba_tables where table_name = 'TESTSTAT'
2 /
NUM_ROWS
1
SQL> exec DBMS_STATS.CREATE_STAT_TABLE ('SYSTEM','MYSTATS')
PL/SQL procedure successfully completed.
SQL> desc mystats
Name Null? Type
STATID VARCHAR2(30)
TYPE CHAR(1)
VERSION NUMBER
FLAGS NUMBER
C1 VARCHAR2(30)
C2 VARCHAR2(30)
C3 VARCHAR2(30)
C4 VARCHAR2(30)
C5 VARCHAR2(30)
N1 NUMBER
N2 NUMBER
N3 NUMBER
N4 NUMBER
N5 NUMBER
N6 NUMBER
N7 NUMBER
N8 NUMBER
N9 NUMBER
N10 NUMBER
N11 NUMBER
N12 NUMBER
D1 DATE
R1 RAW(32)
R2 RAW(32)
CH1 VARCHAR2(1000)
SQL> exec DBMS_STATS.EXPORT_TABLE_STATS ('SYSTEM','TESTSTAT',null,'MYSTATS')
PL/SQL procedure successfully completed.
SQL>
SQL> select c1 from mystats; --c1 for table name, verify where is partition name
C1
TESTSTAT
TESTSTAT
SQL> update mystats set c1 = 'TESTSTAT2' where c1 = 'TESTSTAT';
2 rows updated.
SQL> commit;
Commit complete.
SQL> create table TESTSTAT2 (col number);
Table created.
SQL> select * from teststat2;
no rows selected
SQL> select num_rows from dba_tables where table_name = 'TESTSTAT2'
SQL> /
NUM_ROWS
SQL> exec DBMS_STATS.IMPORT_TABLE_STATS ('SYSTEM','TESTSTAT2',null,'MYSTATS')
PL/SQL procedure successfully completed.
SQL> select table_name,num_rows
from dba_tables
where table_name in ('TESTSTAT','TESTSTAT2');
TABLE_NAME NUM_ROWS
TESTSTAT 1
TESTSTAT2 1
SQL>
SQL> <br>
HTH,<br>
<br>
Nicolas.
Message was edited by: <br>
N. Gasparotto<br>
I change a little bit my example -
How to install Oracle 10g on another partition
Hi,
On my desktop on Disk C:\ (O.S. Windows) I've got Oracle Client for accessing to Oracle Database 8i that is the version used in the company where I work and that is installed on Unix server. As I'd like to install the Oracle Database 10g Release 2 (for practice) on my PC and the Oracle Database 10g Client Release 2 as well, I've got two questions:
1 - Will the installation procedure allow me to install Oracle Database 10g Release 2 on another partition of my PC (I've got Disc D:\ on it)?
2 - Above all will it be possible to install Oracle Database 10g Client Release 2 on Disc D:\ or the installation procedure will make me to install on C:\ where I've already the "orant" directory for accessing to Database Oracle 8i I have to work on?
Sorry for the questions but I'm afraid of committing errors in installing 10g having already a client for 8i which I must still have for working
Thanks!Mark1970 wrote:
Thanks!
I've got two more questions:
1 - for a PC stand alone where I'd like to install Oracle Database 10g anb Oracle Database 10g Client, which version should I use? Do I have to use the Express Edition or what else? I've looked at http://www.oracle.com/technology/software/products/database/index.html
You can use express if you want. I've succesfully run Enterprise Edition on an XP-Pro laptop.
2 - Are you sure I will have no problem about the ORACLE_HOME or about PC's register having on the same PC, even if on different partitions (Disk C:\ and D:\), Not if you install it correctly. Oracle is designed to support multiple version installations on the same box.
two versions of Oracle 8i (only client) and 10g (db plus client)?You don't need to install the 10g client. All Oracle database installs include the client software. -
Oracle Statistics - Best Practice?
We run stats with brconnect weekly:
brconnect -u / -c -f stats -t all
I'm trying to understand how some of our stats are old or stale. Where's my gap? We are running Oracle 11g and have Table Monitoring set on every table. My user_tab_modifications is tracking changes in just over 3,000 tables. I believe that when those entries surpass 50% changed, then they will be flagged for the above brconnect to update their stats. Correct?
Plus, we have our DBSTATC entries. A lot of those entries were last analyzed some 10 years ago. Does the above brconnect consider DBSTATC at all? Or do we need to regularly run the following, as well?
brconnect -u / -c -f stats -t dbstatc_tab
I've got tables that are flagged as stale, so something doesn't seem to be quite right in our best practice.
SQL> select count(*) from dba_tab_statistics
2 where owner = 'SAPR3' and stale_stats = 'YES';
COUNT(*)
1681
I realize that stats last analyzed some ten years ago does not necessarily mean they are no longer good but I am curious if the weekly stats collection we are doing is sufficient. Any best practices for me to consider? Is there some kind of onetime scan I should do to check the health of all stats?Hi Richard,
> We are running Oracle 11g and have Table Monitoring set on every table.
Table monitoring attribute is not necessary anymore or better said it is deprecated due to the fact that these metrics are controlled by STATISTICS_LEVEL nowadays. Table monitoring attribute is valid for Oracle versions lower than 10g.
> I believe that when those entries surpass 50% changed, then they will be flagged for the above brconnect to update their stats. Correct?
Correct, if BR*Tools parameter stats_change_threshold is set to its default. Brconnect reads the modifications (number of inserts, deletes and updates) from DBA_TAB_MODIFICATIONS and compares the sum of these changes to the total number of rows. It gathers statistics, if the amount of changes is larger than stats_change_threshold.
> Does the above brconnect consider DBSTATC at all?
Yes, it does.
> I've got tables that are flagged as stale, so something doesn't seem to be quite right in our best practice.
The column STALE_STATS in view DBA_TAB_STATISTICS is calculated differently. This flag is used by the Oracle standard DBMS_STATS implementation which is not considered by SAP - for more details check the Oracle documentation "13.3.1.5 Determining Stale Statistics".
The GATHER_DATABASE_STATS or GATHER_SCHEMA_STATS procedures gather new statistics for tables with stale statistics when the OPTIONS parameter is set to GATHER STALE or GATHER AUTO. If a monitored table has been modified more than 10%, then these statistics are considered stale and gathered again.
STALE_PERCENT - Determines the percentage of rows in a table that have to change before the statistics on that table are deemed stale and should be regathered. The valid domain for stale_percent is non-negative numbers.The default value is 10%. Note that if you set stale_percent to zero the AUTO STATS gathering job will gather statistics for this table every time a row in the table is modified.
SAP has its own automatism (like described with brconnect and stats_change_threshold) to identify stale statistics and how to collect statistics (percentage, histograms, etc.) and does not use / rely on the corresponding Oracle default mechanism.
> Any best practices for me to consider? Is there some kind of onetime scan I should do to check the health of all stats?
No performance issue? No additional and unnecessary load on the system (e.g. dynamic sampling)? No brconnect runtime issue? Then you don't need to think about the brconnect implementation or special settings. Sometimes you need to tweak it (e.g. histograms, sample sizes, etc.), but then you have some specific issue that needs to be solved.
Regards
Stefan -
Oracle 11g List - Range Partition - Help Needed
Hi All,
I want to create a composite partition (LIST-RANGE) but RANGE partition should using interval partition
This is my query .
CREATE TABLE "DMSDB"."DEVICE_UTILS"
( "ULID" VARCHAR2(100 CHAR),
"IP_ADDRESS" VARCHAR2(24 CHAR),
"PORT" VARCHAR2(8 CHAR),
"SHUTDOWN" NUMBER(10,0),
"LINE_TYPE" NUMBER(10,0) DEFAULT '0',
"OCCUPIED" NUMBER(10,0),
"UTILIZATION" NUMBER(10,0),
"IDLE_TIME" VARCHAR2(32 CHAR),
"ACTIVATION_TIME" VARCHAR2(32 CHAR),
"PULLED_DATE" TIMESTAMP (6) DEFAULT SYSDATE,
"ACCESS_TIME" TIMESTAMP (6) DEFAULT SYSDATE
PARTITION BY LIST(ULID)
PARTITION PART_DEVUTILS_ULID VALUES (DEFAULT)
SUBPARTITION BY RANGE( PULLED_DATE)
PARTITION PART_DEVUTILS_WEEK INTERVAL (NUMTOYMINTERVAL(1,'WEEK'))
Somehow its not working. can you please suggest where i am making mistake?Interval partitioning is not supported at the subpartition level.
http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_7002.htm#BABCDDIA
Regards
Girish Sharma -
Oracle Froms, Global Variables and Oracle Reports
Hi all,
We are developing a form that will call an Oracle report and we would like to test the value of a global variable that was set in the Oracle Forms in the "Before Parameter Form" in the Oracle report trigger. Can this be done?
Thanks, LarryThe "global" var. is global to either a report or a form, not both. You may pass them from one to the other but that's not the session-global thing.
DC -
Gathering Statistics on NON-PARTITIONED objects
Hi,
Is it possible to manually gather stats only for Non-Partitioned objects without touching any of the Partitioned objects?
Oracle Version: 11.1.0.7
Thanks,
Ishan@Hoek and Kuljeet:
I am sorry on missing out on this info.
What I mean is that, I don't want to hard-code the NON-PARTITIONED table names or take names from USER_TABLES. Oracle should pick it up automatically like the way it does it for PARTITIONED tables.
Thanks,
Ishan
Edited by: Ishan on Jun 7, 2012 6:01 PM -
Oracle Linux Installation - Custom Partitioning - GPT Partitioning
we have successfully installed Oracle Linux 5.5 on IBM - System X3650 M3 machine and later scrapped this Linux OS and Installed Windows 2008 OS for other demo purpose.
Now again we are trying to install the Oracle Linux on this machine we are encountering the below issue...
Oracle Linux 5.5 installation on IBM - System X3650 M3
Encountering below error message while creating the custom partitioning creation
Partitioning Error
The following critical errors exit with your requested partitoning scheme.
Your boot partition is a disk using the GPT paritioning scheme but this machine cannot boot using GPT.
These errors must be corrected prior to continuing with your install of enterprise linux.
Please help.
Edited by: user13681259 on Jun 18, 2012 1:07 AMThanks, we managed to clear GPT partition and continued the installation processs...
we have successfully installed Oracle Linux 5.5 on IBM - System X3650 M3 machine and later scrapped the Linux OS and Installed Windows 2008 OS for other demo purpose.
Now again we are trying to install the Oracle Linux on this machine and the machine is NOT detecting the network devices and the network configuration screen does not appear during the installations to assign the staticIP and the hostname to the machine.
Now, the Network Devices screen is NOT displaying during the installtion (where we have to enter the IP Address and hostname details)- the Network Devices Screen should come after the partition layout and GRUB boot loader screen.
The network cable is attached with this machine already.
# lspci | grep -i net
0b : 00.0 Ethernet controller : Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
0b : 00.1 Ethernet controller : Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
#ifconfig
lo
Link encap:local Loopback
inet addr 127.0.0.1 mask 255.0.0.0
usb0
Link encap:Ethernet HWaddr E6.lF:l3:A8:AF:3F
inet addr:169.254.95.120 Bcast:169.254.95.255 Mask: 255.255.255.0
#ifconfig -a
lo
sit0
usb0
Any help would be appreciated.
Edited by: user13681259 on Jun 19, 2012 1:02 AM
Edited by: user13681259 on Jun 19, 2012 1:16 AM -
Oracle Secure Backup with partitioned SL3000
A Client has a partitioned SL3000 tape library with two Access Expansion Modules, T10000D drives, LTO6 drives and dual robotics.
Three Partitions - one for SAMFS including one AEM - this partition works fine.
Two partitions created for OSB - one for LTO6 and media and the other for T10000D and media due to mixed media not supported in OSB.
OSB 12.1 has been implemented, device configuration has been completed and verified. Library inventory completes successfully, when a test backup is started no media mounts to the tape drives. MTX utility for Linux has been implemented for test purposes - successful mounts using MTX was performed - a library inventory was then done using OSB and completed successfully identifying the media mounted in the drive that was initiated by MTX, a successful unload was then done using OSB.
We are unable to mount media using OSB.
Here is a output of devdump from OSB:
ob> dumpdev prd-mgmt2_tape_4
Oracle Secure Backup hardware error log for "prd-mgmt2_tape_4", version 1
STK T10000D, prom/firmware id 4.07, serial number 579004000975
Tue Mar 31, 2015 at 12:05:31.057 (SAST) devtype: 26
obexec: prd-mgmt2:/dev/sg4, args to wst__exec: handle=0x0
accessed via host prd-mgmt2: Linux 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 09:13:42 PST 2014
op=0 (nop), buf=0x00, count=1 (0x1), parm=0x00
cdb: 00 00 00 00 00 00 tur
sense data:
70 00 02 00 00 00 00 12 00 00 00 00 00 00 00 00
00 00 00 00 00 00 40 01 00 00
ec=0, sk=not ready, asc=0, ascq=0
error is: unknown check condition
flags: (none)
returned status: code=unknown check condition,
resid=0 (0x0), checks=0x0 []
Tue Mar 31, 2015 at 12:05:38.142 (SAST) devtype: 26
obrobotd: /dev/sg4, args to wst__exec: handle=0x1
accessed via host prd-mgmt2
op=8 (rewind), buf=0x00, count=0 (0x0), parm=0x00
cdb: 01 00 00 00 00 00 rewind
sense data:
70 00 02 00 00 00 00 12 00 00 00 00 00 00 00 00
00 01 00 00 00 00 40 01 00 00
ec=0, sk=not ready, asc=0, ascq=0
error is: unknown check condition
flags: (none)
returned status: code=unknown check condition,
resid=0 (0x0), checks=0x0 []
Tue Mar 31, 2015 at 12:29:31.060 (SAST) devtype: 26
obexec: /dev/sg4, args to wst__exec: handle=0x0
accessed via host prd-mgmt2
op=0 (nop), buf=0x00, count=1 (0x1), parm=0x00
cdb: 00 00 00 00 00 00 tur
sense data:
70 00 02 00 00 00 00 12 00 00 00 00 00 00 00 00
00 00 00 00 00 00 40 01 00 00
ec=0, sk=not ready, asc=0, ascq=0
error is: unknown check condition
flags: (none)
returned status: code=unknown check condition,
resid=0 (0x0), checks=0x0 []I have resolved the issue. Ill close this thread. :))
-
Zones could not connect Oracle in global zone
Today I tried to install Zones for our customers.
I configed Zone1 and Zone2. Applications running in Zone1 and Zone2 used JDBC to connect to Oracle.
1. Both Zone1 and Zone2 can connect to other Oracle DB servers except the one in global zone.
2. All other clients or machines can connect to the Oracle DB server in the global zone.
So, the Oracle server in the global zone is running and zones network connection is good.
Is this a bug? This is very weird.
Please help me! Thanks.Issue is : Application in Zone1 and Zone2 could not connect Oracle dB in global zone. JDBC error is network adapter error. could not setup connection.
Under zone1 or zone2, i can ping global zone. And I can telnet Oracle listening port.
please help.
Maybe you are looking for
-
*tl;dr- Easy way to take the frames of a GIF and change them to a BMP (there are about 40 frames per Action) So- My friend was learning Java to build a game on Android while I would create the graphical resources. It will be a fighting game- so I wen
-
Hi I am getting delay in opening a socket in my application. I have a listener service listening on a particular port. There are 2 entities that try to connect to this service - One is a standalone C batch program and other is Java Web application. B
-
Well, basically, my PC has crashed and I have been refunded with the money, enough to buy a mac mini, I have decided to opt for this decision, but I have one small problem, if I were to be sent back all of my crashed memory on a CD (ie. my iTunes mus
-
This is similar to a previous post, but no one has posted a solution. "This may be strange, but when I type a period "." strange things happen in Mail and Safari! It is as if when typing a period it is like hitting the return key! Forinstance, if I'm
-
I'm trying to build a second order low pass filter using OPA4228 and when I run the AC Analysis of the filter I keep getting the results that I should get if I had built an high pass. In fact, if I exchange the OPA4228 with another opamp (NE5532 for