Extended Statistics

Starting 11g, you can create statistics for two or more related columns or an expression on a column that are part of a join condition are corrected. 

Extended statistics on multi-column statistics
DECLARE
  exst_name VARCHAR2(30);
BEGIN
  exst_name := DBMS_STATS.CREATE_EXTENDED_STATS('HR','emp',
             '(last_name,department_id)');
END;
/


SELECT SYS.DBMS_STATS.SHOW_EXTENDED_STATS_NAME('hr','emp',
       '(last_name,department_id)') col_group_name
FROM DUAL
/

COL_GROUP_NAME
--------------------------------------------------------------------------------
SYS_STUAV0Z346SKNRSGSE2XA1MM6L


SQL> select dbms_stats.create_extended_stats('hr','emp','(last_name,department_id)') from dual;

DBMS_STATS.CREATE_EXTENDED_STATS('HR','EMP','(LAST_NAME,DEPARTMENT_ID)')
--------------------------------------------------------------------------------
SYS_STUAV0Z346SKNRSGSE2XA1MM6L

Extended statistics on Expression:
SQL> execute dbms_stats.gather_table_stats('HR','EMP', method_opt =>'for all columns size skewonly for columns(lower(last_name)) size skewonly');

To drop extended stats:
SQL> exec dbms_stats.drop_extended_stats('hr','emp','(last_name,department_id)');

Gathering statistics on Column Groups:
Method_opt enables you to gather statistics on column group: 
FOR ALL COLUMNS SIZE AUTO:  optimizer gathers statistics on all existing column groups
FOR COLUMNS:  The column group is automatically created as part of statistics gathering

exec dbms_stats.gather_table_stats('HR','EMP',METHOD_OPT=>'FOR ALL COLUMNS SIZE SKEWONLY FOR COLUMNS (LAST_NAME, DEPARTMENT_ID) SIZE SKEWONLY');

To monitor column groups about multi column or expression statstistics
SQL> select * from user_stat_extensions;

TABLE_NAME EXTENSION_NAME                 EXTENSION    CREATO DRO
---------- ------------------------------ ------------ ------ ---
EMP        SYS_STUAV0Z346SKNRSGSE2XA1MM6L ("LAST_NAME" USER   YES
                                          ,"DEPARTMENT
                                          _ID")

EMP        SYS_STU$OGQI#ACVJROJQ#33ZBENKN (LOWER("LAST USER   YES
                                          _NAME")

SELECT e.EXTENSION col_group, t.NUM_DISTINCT, t.HISTOGRAM
FROM   USER_STAT_EXTENSIONS e, USER_TAB_COL_STATISTICS t
WHERE  e.EXTENSION_NAME=t.COLUMN_NAME
AND    e.TABLE_NAME=t.TABLE_NAME
AND    t.TABLE_NAME='EMP';

Cloud Control Components


Cloud Control core components:
·         OMR:  Oracle Management Repository
·         OMS:  Oracle Management Services
·         OMA/Agent:  Oracle Management Agent with Plug-ins
·         GUI interface / Cloud Control and EMCLI command line interface

Definition:

Target:  is any software or system for which there is a plug-in.  Each agent plug-in is specific to a particular target type and offers special management capabilities to suite that target type

Target Type:  managed by cloud control includes Exadata, Exadata Logic, Oracle database, listener, fusion middle ware, Oracle application server web logic, PeopleSoft, E-Business Suite, SOA, and third party products.

Communication between the core components:
Agent -->uploads data àthe OMS via http/4889 or https/4900.
OMSàcommunicates with the Agent via http or https on port 3872
OMS àcommunicate with OMR via JDBC on port 1521.  OMS and OMR should have good bandwidth and low-latency connection

OMAs or Agents: Java applications are installed on their own ORACLE_HOME.  They run on hosts and gather metrics data about the monitored hosts.  They communicate via HTTP or secured HTTPS traffic with OMS to upload metric data. As Administrator, you can use Plug-in or initiate a discovery or configure Auto Discovery to promote the discovered target and managed targets.

Plug-in:  Have both the agent-side and OMS-side components.  It’s installed by default and gathers configuration, monitor availablity and performance

OMS:  Is J2EE application deployed on Oracle Web Logic Server.    You can push the agent to any host that can access across the network using a secure SSH connection. 

OMR:  Is in Oracle database.  It includes about 4000 schemas objects belonging to the sysman user.  It can be installed in an existing database or in RAC database for HA requirements.

Auto Discovery of Targets:  Agent-based (needs host name(s) and Agent-less (IP scan over the network

dig, nslookup to determine scan name is mapped to the correct IP addresses


With 11gR2 Grid Infrastructure  we need 3 SCAN IPs on the same subnet with the Virtual IPs  resolving the same name with DNS round-robin resolution.  The SCAN name and IP addresses are not listed in the /etc/hosts file and not ping-able unit the Grid Infrastructural is configured.

How to determine that our SCAN name is mapped to the right IP addresses?  2 methods

Method 1:

srvctl config scan

SCAN name: lapqa-scan, Network: 1/10.112.14.0/255.255.255.0/bond0
SCAN VIP name: scan1, IP: /lapqa-scan/10.112.14.101
SCAN VIP name: scan2, IP: /lapqa-scan/10.112.14.102
SCAN VIP name: scan3, IP: /lapqa-scan/10.112.14.103

nslookup lapqa-scan
Server:         10.210.121.15
Address:        10.210.121.15#53

Name:   lapqa-scan.ctt.com
Address: 10.112.14.103
Name:   lapqa-scan.ctt.com
Address: 10.112.14.101
Name:   lapqa-scan.ctt.com
Address: 10.112.14.102


Method 2:

crsctl query dns –servers

CRS-10018: the following configuration was found on the system:
CRS-10019: There are 1 domains in search order. They are:
ctt.com
CRS-10022: There are 2 name servers. They are:
10.210.121.15
10.101.11.109
CRS-10020: number of retry attempts for name lookup is: 4
CRS-10021: timeout for each name lookup is: 5

Alternatively,

cat /etc/resolv.conf
domain ctt.com
nameserver 10.210.121.15
nameserver 10.101.11.109

nslookup 10.210.121.15
Server:         10.210.121.15
Address:        10.210.121.15#53

79.129.250.10.in-addr.arpa      name = xy1.cttxyx.local.


+ASM1 - oracle: dig @xy1.cttxyx.local lapqa-scan.ctt.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> @xy1.cttxyx.local lapqa-scan.ctt.com
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50505
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;lapqa-scan.ctt.com.           IN      A

;; ANSWER SECTION:
lapqa-scan.ctt.com.    30      IN      A       10.112.14.102
lapqa-scan.ctt.com.    3600    IN      A       10.112.14.103
lapqa-scan.ctt.com.    30      IN      A       10.112.14.101

;; AUTHORITY SECTION:
ctt.com.                3600    IN      NS      xy1.cttxyx.local.
ctt.com.                3600    IN      NS      xy2.cttxyx.local.

;; ADDITIONAL SECTION:
xy1.cttxyx.local.      86400   IN      A       10.210.121.15
xy2.cttxyx.local.      86400   IN      A       10.101.11.109

;; Query time: 20 msec
;; SERVER: 10.210.121.15#53(10.210.121.15)
;; WHEN: Tue Mar  5 11:46:24 2013
;; MSG SIZE  rcvd: 166

shmmax, shmall, swaping/paging related parameters


In general, if a current parameter settings in /etc/sysctl.conf is higher than the value in the below table, you just leave it alone.  However, the parameters like SHMMAX should be adjust to ½ or more physical memory on the server and the SHMALL is based on physical memory size / page size.

Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the maximum size of a message, in bytes
kernel.msgmnb = 65536

# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 48719476736 (For example:  the DB server has 90GB)

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 23592960 (For example:  sum of all the SGAs on the system=90GBs, devided by the pagesize 4Kb)

SQL> select 90*1024*1024*1024/4096 from dual;

90*1024*1024*1024/4096
----------------------
              23592960

To tune swaping / paging of the server, you need to work with Sys Admin to adjust these parameters appropriately

#Reduce swapping:
vm.swappiness = 10
#Maximum percentage of active memory that can have dirty pages:
vm.dirty_background_ratio=3
#Maximum percentage of total memory that can have dirty pages:
vm.dirty_ratio=15
#How long data can be in page cache before being expired:
vm.dirty_expire_centisecs=500
#How often pdflush is activated to clean dirty pages:
vm.dirty_writeback_centisecs=100