facebook twitter youtube facebook facebook facebook

E-Mail : info@askmlabs.com

Phone : +1.215.353.8306

Latest Post

How to add SCAN LISTENER in 11gR2

Written By askMLabs on Friday, September 3, 2010 | 1:36 PM

My 11gR2 grid infrastructure completed with only one scan listener. The following log shows that ....
[grid@rac01 grid]$ srvctl config scan
SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2
SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.192
[grid@rac01 grid]$ srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
[grid@rac01 grid]$

[grid@rac01 grid]$ ping rac-scan.example.com
PING rac-scan.example.com (133.22.67.193) 56(84) bytes of data.
From rac01.seo.int (133.22.38.50) icmp_seq=2 Destination Host Unreachable
From rac01.seo.int (133.22.38.50) icmp_seq=3 Destination Host Unreachable
From rac01.seo.int (133.22.38.50) icmp_seq=4 Destination Host Unreachable

--- rac-scan.example.com ping statistics ---
6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5000ms
, pipe 3
[grid@rac01 grid]$ ping rac-scan
PING rac-scan.example.com (133.22.67.194) 56(84) bytes of data.
From rac01.seo.int (133.22.38.50) icmp_seq=2 Destination Host Unreachable
From rac01.seo.int (133.22.38.50) icmp_seq=3 Destination Host Unreachable
From rac01.seo.int (133.22.38.50) icmp_seq=4 Destination Host Unreachable
From rac01.seo.int (133.22.38.50) icmp_seq=6 Destination Host Unreachable
From rac01.seo.int (133.22.38.50) icmp_seq=7 Destination Host Unreachable
From rac01.seo.int (133.22.38.50) icmp_seq=8 Destination Host Unreachable

--- rac-scan.example.com ping statistics ---
11 packets transmitted, 0 received, +6 errors, 100% packet loss, time 10000ms
, pipe 3
[grid@rac01 grid]$ ping rac-scan
PING rac-scan.example.com (133.22.67.192) 56(84) bytes of data.
64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=1 ttl=64 time=0.039 ms
64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=2 ttl=64 time=0.054 ms
64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=3 ttl=64 time=0.049 ms
64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=4 ttl=64 time=0.063 ms

--- rac-scan.example.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 0.039/0.051/0.063/0.010 ms
[grid@rac01 grid]$

[grid@rac01 grid]$ host rac-scan
rac-scan.example.com has address 133.22.67.194
rac-scan.example.com has address 133.22.67.193
rac-scan.example.com has address 133.22.67.192
[grid@rac01 grid]$ nslookup rac-scan
Server:         133.22.5.53
Address:        133.22.5.53#53

Name:   rac-scan.example.com
Address: 133.22.67.194
Name:   rac-scan.example.com
Address: 133.22.67.192
Name:   rac-scan.example.com
Address: 133.22.67.193

[grid@rac01 grid]$

[root@rac01 network-scripts]# host rac-scan
rac-scan.example.com has address 133.22.67.194
rac-scan.example.com has address 133.22.67.193
rac-scan.example.com has address 133.22.67.192
[root@rac01 network-scripts]#


rac-scan.example.com IN A 133.22.67.194
IN A 133.22.67.193
IN A 133.22.67.192


[grid@rac02 grid]$ Check_CRS.txt
HA Resource                                        Target     State
-----------                                        ------     -----
ora.CRS.dg                                         ONLINE     ONLINE on rac01
ora.FRA.dg                                         ONLINE     ONLINE on rac01
ora.LISTENER.lsnr                                  ONLINE     ONLINE on rac01
ora.LISTENER_SCAN1.lsnr                            ONLINE     ONLINE on rac01
ora.RACDB_DATA.dg                                  ONLINE     ONLINE on rac01
ora.asm                                            ONLINE     ONLINE on rac01
ora.eons                                           ONLINE     ONLINE on rac01
ora.gsd                                            OFFLINE    OFFLINE
ora.net1.network                                   ONLINE     ONLINE on rac01
ora.oc4j                                           OFFLINE    OFFLINE
ora.ons                                            ONLINE     ONLINE on rac01
...
...
ora.rac02.vip                                      ONLINE     ONLINE on rac02
ora.rac10g.db                                      ONLINE     ONLINE on rac02
ora.rac10g.rac10g1.inst                            ONLINE     ONLINE on rac01
ora.rac10g.rac10g2.inst                            ONLINE     OFFLINE
ora.racpoc.askm1.svc                               ONLINE     ONLINE on rac01
ora.racpoc.db                                      ONLINE     ONLINE on rac01
ora.registry.acfs                                  ONLINE     ONLINE on rac01
ora.scan1.vip                                      ONLINE     ONLINE on rac01
ora.testdb.db                                      ONLINE     ONLINE on rac01

tnsnames.ora file :

TESTDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.example.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = testdb.example.com)
)
)

The above session data clearly shows there is only one scan listener configured. When we use scan name in tnsnames.ora, the client connections will be established to database only when the scan name resolves to valid IP address.
But with the above configurations, the client connections some times may fail when the SCAN is resolving to 133.22.67.193 or 133.22.67.194. It establishes connection only when the SCAN resolves to 133.22.67.192.
SQL> conn test/test@testdb ==> Connection failed. rac-scan resolves either to 133.22.67.193 or 133.22.67.194
ERROR:
ORA-12543: TNS:destination host unreachable

SQL>conn test/test@testdb ==> Connection established.rac-scan resolves to 133.22.67.192.
connected
SQL>


Now to avoid this , we need to create two more scan listeners.
[grid@rac01 grid]$ srvctl stop scan_listener
[grid@rac01 grid]$ srvctl stop scan
[grid@rac01 grid]$ srvctl config scan
SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2
SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.192
[grid@rac01 grid]$ srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
[grid@rac01 grid]$ which srvctl
/u01/home/11.2.0/grid/bin/srvctl
[grid@rac01 grid]$

[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl modify scan -h

Modifies the SCAN name.

Usage: srvctl modify scan -n <scan_name>
-n <scan_name>           Domain name qualified SCAN name
-h                       Print usage
[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl modify scan -n rac-scan
[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl config scan
SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2
SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.193
SCAN VIP name: scan2, IP: /rac-scan.example.com/133.22.67.194
SCAN VIP name: scan3, IP: /rac-scan.example.com/133.22.67.192
[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl modify scan_listener -u

[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521
[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl start scan_listener
[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl config scan
SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2
SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.193
SCAN VIP name: scan2, IP: /rac-scan.example.com/133.22.67.194
SCAN VIP name: scan3, IP: /rac-scan.example.com/133.22.67.192
[root@rac01 network-scripts]#


[grid@rac02 grid]$ Check_CRS.txt
HA Resource                                        Target     State
-----------                                        ------     -----
ora.CRS.dg                                         ONLINE     ONLINE on rac01
ora.FRA.dg                                         ONLINE     ONLINE on rac01
ora.LISTENER.lsnr                                  ONLINE     ONLINE on rac01
ora.LISTENER_SCAN1.lsnr                            ONLINE     ONLINE on rac01
ora.LISTENER_SCAN2.lsnr                            ONLINE     ONLINE on rac02
ora.LISTENER_SCAN3.lsnr                            ONLINE     ONLINE on rac02

ora.RACDB_DATA.dg                                  ONLINE     ONLINE on rac01
ora.asm                                            ONLINE     ONLINE on rac01
ora.eons                                           ONLINE     ONLINE on rac01
ora.gsd                                            OFFLINE    OFFLINE
ora.net1.network                                   ONLINE     ONLINE on rac01
ora.oc4j                                           OFFLINE    OFFLINE
ora.ons                                            ONLINE     ONLINE on rac01
...
...
ora.rac02.vip                                      ONLINE     ONLINE on rac02
ora.rac10g.db                                      ONLINE     ONLINE on rac02
ora.rac10g.rac10g1.inst                            ONLINE     ONLINE on rac01
ora.rac10g.rac10g2.inst                            ONLINE     OFFLINE
ora.racpoc.askm1.svc                               ONLINE     ONLINE on rac01
ora.racpoc.db                                      ONLINE     ONLINE on rac01
ora.registry.acfs                                  ONLINE     ONLINE on rac01
ora.scan1.vip                                      ONLINE     ONLINE on rac01
ora.scan2.vip                                      ONLINE     ONLINE on rac02
ora.scan3.vip                                      ONLINE     ONLINE on rac02

ora.testdb.db                                      ONLINE     ONLINE on rac01
[grid@rac02 grid]$

Status :

[grid@rac01 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac01
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node rac02
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node rac02
[grid@rac01 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rac01
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node rac02
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node rac02
[grid@rac01 ~]$

Hope it helps
SRI



My 11gR2 grid infrastructure completed with only one scan listener. The following log shows that ....


[grid@rac01 grid]$ srvctl config scan

SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2

SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.192

[grid@rac01 grid]$ srvctl config scan_listener

SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521

[grid@rac01 grid]$



[grid@rac01 grid]$ ping rac-scan.example.com

PING rac-scan.example.com (133.22.67.193) 56(84) bytes of data.

From rac01.seo.int (133.22.38.50) icmp_seq=2 Destination Host Unreachable

From rac01.seo.int (133.22.38.50) icmp_seq=3 Destination Host Unreachable

From rac01.seo.int (133.22.38.50) icmp_seq=4 Destination Host Unreachable


--- rac-scan.example.com ping statistics ---

6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5000ms

, pipe 3

[grid@rac01 grid]$ ping rac-scan

PING rac-scan.example.com (133.22.67.194) 56(84) bytes of data.

From rac01.seo.int (133.22.38.50) icmp_seq=2 Destination Host Unreachable

From rac01.seo.int (133.22.38.50) icmp_seq=3 Destination Host Unreachable

From rac01.seo.int (133.22.38.50) icmp_seq=4 Destination Host Unreachable

From rac01.seo.int (133.22.38.50) icmp_seq=6 Destination Host Unreachable

From rac01.seo.int (133.22.38.50) icmp_seq=7 Destination Host Unreachable

From rac01.seo.int (133.22.38.50) icmp_seq=8 Destination Host Unreachable


--- rac-scan.example.com ping statistics ---

11 packets transmitted, 0 received, +6 errors, 100% packet loss, time 10000ms

, pipe 3

[grid@rac01 grid]$ ping rac-scan

PING rac-scan.example.com (133.22.67.192) 56(84) bytes of data.

64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=1 ttl=64 time=0.039 ms

64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=2 ttl=64 time=0.054 ms

64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=3 ttl=64 time=0.049 ms

64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=4 ttl=64 time=0.063 ms


--- rac-scan.example.com ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3001ms

rtt min/avg/max/mdev = 0.039/0.051/0.063/0.010 ms

[grid@rac01 grid]$


[grid@rac01 grid]$ host rac-scan

rac-scan.example.com has address 133.22.67.194

rac-scan.example.com has address 133.22.67.193

rac-scan.example.com has address 133.22.67.192

[grid@rac01 grid]$ nslookup rac-scan

Server:         133.22.5.53

Address:        133.22.5.53#53


Name:   rac-scan.example.com

Address: 133.22.67.194

Name:   rac-scan.example.com

Address: 133.22.67.192

Name:   rac-scan.example.com

Address: 133.22.67.193


[grid@rac01 grid]$


[root@rac01 network-scripts]# host rac-scan

rac-scan.example.com has address 133.22.67.194

rac-scan.example.com has address 133.22.67.193

rac-scan.example.com has address 133.22.67.192

[root@rac01 network-scripts]#



rac-scan.example.com IN A 133.22.67.194

IN A 133.22.67.193

IN A 133.22.67.192



[grid@rac02 grid]$ Check_CRS.txt

HA Resource                                        Target     State

-----------                                        ------     -----

ora.CRS.dg                                         ONLINE     ONLINE on rac01

ora.FRA.dg                                         ONLINE     ONLINE on rac01

ora.LISTENER.lsnr                            ONLINE     ONLINE on rac01

ora.LISTENER_SCAN1.lsnr          ONLINE     ONLINE on rac01

ora.RACDB_DATA.dg                      ONLINE     ONLINE on rac01

ora.asm                                                ONLINE     ONLINE on rac01

ora.eons                                               ONLINE     ONLINE on rac01

ora.gsd                                                 OFFLINE    OFFLINE

ora.net1.network                                  ONLINE     ONLINE on rac01

ora.oc4j                                                OFFLINE    OFFLINE

ora.ons                                                 ONLINE     ONLINE on rac01

...

...

ora.rac02.vip                                       ONLINE     ONLINE on rac02

ora.rac10g.db                                      ONLINE     ONLINE on rac02

ora.rac10g.rac10g1.inst                      ONLINE     ONLINE on rac01

ora.rac10g.rac10g2.inst                            ONLINE     OFFLINE

ora.racpoc.askm1.svc                               ONLINE     ONLINE on rac01

ora.racpoc.db                                      ONLINE     ONLINE on rac01

ora.registry.acfs                                  ONLINE     ONLINE on rac01

ora.scan1.vip                                      ONLINE     ONLINE on rac01

ora.testdb.db                                      ONLINE     ONLINE on rac01



TESTDB =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.example.com)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = testdb.example.com)

)

)



The above session data clearly shows there is only one scan listener configured. When we use scan name in tnsnames.ora, the client connections will be established to database only when the scan name resolves to valid IP address.

But with the above configurations, the client connections some times may fail when the SCAN is resolving to 133.22.67.193 or 133.22.67.194. It establishes connection only when the SCAN resolves to 133.22.67.192.


SQL> conn test/test@testdb ==> Connection failed. rac-scan resolves either to 133.22.67.193 or 133.22.67.194

ERROR:

ORA-12543: TNS:destination host unreachable



SQL>conn test/test@testdb ==> Connection established.rac-scan resolves to 133.22.67.192.

connected

SQL>



Now to avoid this , we need to create two more scan listeners.


[grid@rac01 grid]$ srvctl stop scan_listener

[grid@rac01 grid]$ srvctl stop scan

[grid@rac01 grid]$ srvctl config scan

SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2

SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.192

[grid@rac01 grid]$ srvctl config scan_listener

SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521

[grid@rac01 grid]$ which srvctl

/u01/home/11.2.0/grid/bin/srvctl

[grid@rac01 grid]$



[grid@rac01 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac01
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node rac02
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node rac02
[grid@rac01 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rac01
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node rac02
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node rac02
[grid@rac01 ~]$

[grid@rac01 ~]$ ps -ef | grep -i tns
grid      9052     1  0 Aug09 ?        00:00:01 /o001/home/11.2.0/grid/bin/tnslsnr LISTENER -inherit
grid      9098     1  0 Aug09 ?        00:00:01 /o001/home/11.2.0/grid/bin/tnslsnr LISTENER_SCAN1 -inherit
grid     21388 20424  0 05:06 pts/1    00:00:00 grep -i tns
[grid@rac01 ~]$

[grid@rac02 ~]$ ps -ef | grep -i tns
grid      1323  1292  0 05:07 pts/0    00:00:00 grep -i tns
grid      9110     1  0 Aug09 ?        00:00:02 /o001/home/11.2.0/grid/bin/tnslsnr LISTENER -inherit
grid     17278     1  0 Aug09 ?        00:00:01 /o001/home/11.2.0/grid/bin/tnslsnr LISTENER_SCAN2 -inherit
grid     17285     1  0 Aug09 ?        00:00:01 /o001/home/11.2.0/grid/bin/tnslsnr LISTENER_SCAN3 -inherit
[grid@rac02 ~]$


[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl modify scan -h


Modifies the SCAN name.


Usage: srvctl modify scan -n <scan_name>

-n <scan_name>           Domain name qualified SCAN name

-h                       Print usage

[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl modify scan -n rac-scan

[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl config scan

SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2

SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.193

SCAN VIP name: scan2, IP: /rac-scan.example.com/133.22.67.194

SCAN VIP name: scan3, IP: /rac-scan.example.com/133.22.67.192

[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl modify scan_listener -u

[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl config scan_listener

SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521

SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521

SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521

[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl start scan_listener

[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl config scan

SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2

SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.193

SCAN VIP name: scan2, IP: /rac-scan.example.com/133.22.67.194

SCAN VIP name: scan3, IP: /rac-scan.example.com/133.22.67.192

[root@rac01 network-scripts]#




[grid@rac02 grid]$ Check_CRS.txt

HA Resource                                        Target     State

-----------                                        ------     -----

ora.CRS.dg                                         ONLINE     ONLINE on rac01

ora.FRA.dg                                         ONLINE     ONLINE on rac01

ora.LISTENER.lsnr                                  ONLINE     ONLINE on rac01

ora.LISTENER_SCAN1.lsnr                            ONLINE     ONLINE on rac01

ora.LISTENER_SCAN2.lsnr                            ONLINE     ONLINE on rac02

ora.LISTENER_SCAN3.lsnr                            ONLINE     ONLINE on rac02

ora.RACDB_DATA.dg                                  ONLINE     ONLINE on rac01

ora.asm                                            ONLINE     ONLINE on rac01

ora.eons                                           ONLINE     ONLINE on rac01

ora.gsd                                            OFFLINE    OFFLINE

ora.net1.network                                   ONLINE     ONLINE on rac01

ora.oc4j                                           OFFLINE    OFFLINE

ora.ons                                            ONLINE     ONLINE on rac01

...

...

ora.rac02.vip                                      ONLINE     ONLINE on rac02

ora.rac10g.db                                      ONLINE     ONLINE on rac02

ora.rac10g.rac10g1.inst                            ONLINE     ONLINE on rac01

ora.rac10g.rac10g2.inst                            ONLINE     OFFLINE

ora.racpoc.askm1.svc                               ONLINE     ONLINE on rac01

ora.racpoc.db                                      ONLINE     ONLINE on rac01

ora.registry.acfs                                  ONLINE     ONLINE on rac01

ora.scan1.vip                                      ONLINE     ONLINE on rac01

ora.scan2.vip                                      ONLINE     ONLINE on rac02

ora.scan3.vip                                      ONLINE     ONLINE on rac02

ora.testdb.db                                      ONLINE     ONLINE on rac01

[grid@rac02 grid]$



Hope it helps

SRI



SCAN in 11gR2 Grid InfraStructure

Written By askMLabs on Thursday, September 2, 2010 | 10:39 AM

11gR2 grid infrastructure uses SCAN, which is a new concept we use for all client connections. SCAN is single client access name and it is a new feature in 11g Release 2 that provides a single name for clients to access an Oracle Database running in a cluster. The benefit is clients using SCAN do not need to change if you add or remove nodes in the cluster.


Prior to 11gR2 , the tnsnames.ora entries are

TESTDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac02-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = testdb.example.com)
)
)

In 11gR2 , the tnsnames.ora entries look like ....

TESTDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.example.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = testdb.example.com)
)
)


The only difference is that , we specify the scan name instead of all VIPs in the tnsnames.ora file.

So what is the benifit with it?

Suppose if you are adding any node to the cluster, you need to specify corresponding VIP entry for that node in the tnsnames.ora prior to 11gR2. But with SCAN name, we dont need to do any modifications to the tnsnames.ora file. SCAN name will resolve and load balance the client connections to all the nodes in the RAC.

SCAN configuration in the cluster :

The SCAN is configured during the installation of the grid infrastructure that is distributed with Oracle Database 11g Release2. So in order to configure SCAN, you need to create a single name that resolves to 3 IP addresses using a round robin algorithm. The IP addresses must be on the same subnet as your public network in the cluster.
rac-scan.example.com IN A 133.22.67.194
IN A 133.22.67.193
IN A 133.22.67.192




SCAN Details

[grid@rac01 ~]$ host rac-scan
rac-scan.example.com has address 133.22.67.192
rac-scan.example.com has address 133.22.67.193
rac-scan.example.com has address 133.22.67.194
[grid@rac01 ~]$ nslookup rac-scan
Server:         133.22.5.53
Address:        133.22.5.53#53

Name:   rac-scan.example.com
Address: 133.22.67.194
Name:   rac-scan.example.com
Address: 133.22.67.193
Name:   rac-scan.example.com
Address: 133.22.67.192

[grid@rac01 ~]$ ping rac-scan
PING rac-scan.example.com (133.22.67.193) 56(84) bytes of data.
64 bytes from rac-scan.example.com (133.22.67.193): icmp_seq=1 ttl=64 time=0.187 ms
64 bytes from rac-scan.example.com (133.22.67.193): icmp_seq=2 ttl=64 time=0.144 ms
64 bytes from rac-scan.example.com (133.22.67.193): icmp_seq=3 ttl=64 time=0.152 ms

--- rac-scan.example.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.144/0.161/0.187/0.018 ms
[grid@rac01 ~]$ ping rac-scan
PING rac-scan.example.com (133.22.67.192) 56(84) bytes of data.
64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=1 ttl=64 time=0.042 ms
64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=2 ttl=64 time=0.046 ms
64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=3 ttl=64 time=0.051 ms

--- rac-scan.example.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.042/0.046/0.051/0.006 ms
[grid@rac01 ~]$ ping rac-scan
PING rac-scan.example.com (133.22.67.194) 56(84) bytes of data.
64 bytes from rac-scan.example.com (133.22.67.194): icmp_seq=2 ttl=64 time=0.144 ms
64 bytes from rac-scan.example.com (133.22.67.194): icmp_seq=3 ttl=64 time=0.164 ms

--- rac-scan.example.com ping statistics ---
3 packets transmitted, 2 received, 33% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.144/0.154/0.164/0.010 ms
[grid@rac01 ~]$

[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521
[root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl config scan
SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2
SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.192
SCAN VIP name: scan2, IP: /rac-scan.example.com/133.22.67.194
SCAN VIP name: scan3, IP: /rac-scan.example.com/133.22.67.193
[root@rac01 network-scripts]#

[grid@rac01 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac01
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node rac02
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node rac02
[grid@rac01 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rac01
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node rac02
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node rac02
[grid@rac01 ~]$

[grid@rac01 ~]$ ps -ef | grep -i tns
grid      9052     1  0 Aug09 ?        00:00:01 /u01/home/11.2.0/grid/bin/tnslsnr LISTENER -inherit
grid      9098     1  0 Aug09 ?        00:00:01 /u01/home/11.2.0/grid/bin/tnslsnr LISTENER_SCAN1 -inherit
grid     21388 20424  0 05:06 pts/1    00:00:00 grep -i tns
[grid@rac01 ~]$

[grid@rac02 ~]$ ps -ef | grep -i tns
grid      1323  1292  0 05:07 pts/0    00:00:00 grep -i tns
grid      9110     1  0 Aug09 ?        00:00:02 /u01/home/11.2.0/grid/bin/tnslsnr LISTENER -inherit
grid     17278     1  0 Aug09 ?        00:00:01 /u01/home/11.2.0/grid/bin/tnslsnr LISTENER_SCAN2 -inherit
grid     17285     1  0 Aug09 ?        00:00:01 /u01/home/11.2.0/grid/bin/tnslsnr LISTENER_SCAN3 -inherit
[grid@rac02 ~]$

[grid@rac02 grid]$ Check_CRS.txt
HA Resource                                        Target     State
-----------                                        ------     -----
ora.CRS.dg                                         ONLINE     ONLINE on rac01
ora.FRA.dg                                         ONLINE     ONLINE on rac01
ora.LISTENER.lsnr                                  ONLINE     ONLINE on rac01
ora.LISTENER_SCAN1.lsnr                            ONLINE     ONLINE on rac01
ora.LISTENER_SCAN2.lsnr                            ONLINE     ONLINE on rac02
ora.LISTENER_SCAN3.lsnr                            ONLINE     ONLINE on rac02

ora.RACDB_DATA.dg                                  ONLINE     ONLINE on rac01
ora.asm                                            ONLINE     ONLINE on rac01
ora.eons                                           ONLINE     ONLINE on rac01
ora.gsd                                            OFFLINE    OFFLINE
ora.net1.network                                   ONLINE     ONLINE on rac01
ora.oc4j                                           OFFLINE    OFFLINE
ora.ons                                            ONLINE     ONLINE on rac01
ora.rac01.ASM1.asm                                  ONLINE     ONLINE on rac01
ora.rac01.LISTENER_ORRCDBTSL01.lsnr                 ONLINE     ONLINE on rac01
ora.rac01.gsd                                      OFFLINE    OFFLINE
ora.rac01.ons                                       ONLINE     ONLINE on rac01
ora.rac01.vip                                      ONLINE     ONLINE on rac01
ora.rac02.ASM2.asm                                 ONLINE     ONLINE on rac02
ora.rac02.LISTENER_ORRCDBTSL02.lsnr                ONLINE     ONLINE on rac02
ora.rac02.gsd                                       OFFLINE    OFFLINE
ora.rac02.ons                                       ONLINE     ONLINE on rac02
ora.rac02.vip                                       ONLINE     ONLINE on rac02
ora.registry.acfs                                  ONLINE     ONLINE on rac01
ora.scan1.vip                                      ONLINE     ONLINE on rac01
ora.scan2.vip                                      ONLINE     ONLINE on rac02
ora.scan3.vip                                      ONLINE     ONLINE on rac02

ora.testdb.db                                      ONLINE     ONLINE on rac01
[grid@rac02 grid]$


Hope it helps
SRI

Not able to start 10gR2 RAC Database Running on 11gR2 Grid infra

Written By askMLabs on Wednesday, September 1, 2010 | 6:50 AM

We have 2 node 10gRAC database running on 11gR2 grid infra structure.
When the database was created, both the instances were running good.
Recently one instance was down due to some reason and we are not able to start the instance successfully.

When we are trying to start the instance , it says , it cant identify the control file. But the other instance is able to start and stop successfully.

When we start the database , we get the following error ...

ORA-00205: error in identifying control file, check alert log for more info
SQL> startup
ORACLE instance started.Total System Global Area 1610612736 bytes
Fixed Size 2084296 bytes
Variable Size 369099320 bytes
Database Buffers 1224736768 bytes
Redo Buffers 14692352 bytes
ORA-00205: error in identifying control file, check alert log for more info

Alert Log content :
ORA-00204: error in reading (block 1, # blocks 1) of control file
ORA-00202: control file: '+RACDB_DATA/rac10g/control01.ctl'
ORA-15081: failed to submit an I/O operation to a disk
Mon Aug 30 07:40:52 2010
ORA-205 signalled during: ALTER DATABASE MOUNT...
Mon Aug 30 07:40:55 2010
Errors in file /u01/apps/oracle/admin/rac10g/bdump/rac10g2_mmon_32634.trc:
ORA-00600: internal error code, arguments: [kmgs_parameter_update_timeout_1], [15081], [], [], [], [], [], []
ORA-15081: failed to submit an I/O operation to a disk
Mon Aug 30 07:40:56 2010
Trace dumping is performing id=[cdmp_20100830074056]
Mon Aug 30 07:41:59 2010
Restarting dead background process MMON
MMON started with pid=16, OS id=329

Other Details :
SQL> select GROUP_NUMBER,name,state from v$asm_diskgroup;

GROUP_NUMBER NAME STATE
------------ ------------------------------ -----------
1 CRS MOUNTED
2 FRA MOUNTED
3 RACDB_DATA MOUNTED

SQL> select group_number,instance_name ,db_name , status from v$asm_client;

GROUP_NUMBER INSTANCE_NAME DB_NAME STATUS
------------ -------------------- -------------------- ----------
1 +ASM2 +ASM CONNECTED
3 +ASM2 +ASM CONNECTED

===> After starting the rac10g2 ( instance on rac02) with nomount.(the problematic instance) :
SQL> select group_number,instance_name ,db_name , status from v$asm_client;

GROUP_NUMBER INSTANCE_NAME DB_NAME STATUS
------------ -------------------- -------------------- ----------
1 +ASM2 +ASM CONNECTED
3 +ASM2 +ASM CONNECTED
3 rac10g2 rac10g CONNECTED

SQL>

SQL> sho parameter control

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string +RACDB_DATA/rac10g/control01.c
tl, +RACDB_DATA/rac10g/control
02.ctl, +RACDB_DATA/rac10g/con
trol03.ctl


Troubleshooting
From the database owner ( oracle ) on all the nodes

[oracle@rac01 ~]$ hostname
rac01.example.com
[oracle@rac01 ~]$ whoami
oracle
[oracle@rac01 ~]$ ls -l $ORACLE_HOME/bin/oracle
-rwsr-s--x 1 oracle dba 112468374 Aug 17 10:47 /u01/apps/oracle/product/10.2.0/db_1/bin/oracle
[oracle@rac01 ~]$ echo $ORACLE_HOME
/u01/apps/oracle/product/10.2.0/db_1
[oracle@rac01 ~]$
[oracle@rac01 ~]$ whoami
oracle
[oracle@rac01 ~]$ id
uid=1659(oracle) gid=501(dba) groups=501(dba),503(oper),552(admin2),1000(oinstall),1201(asmdba)
[oracle@rac01 ~]$

[oracle@rac02 ~]$ hostname
rac02.example.com
[oracle@rac02 ~]$ whoami
oracle
[oracle@rac02 ~]$ ls -l $ORACLE_HOME/bin/oracle
-rwsr-s--x 1 oracle dba 112468374 Aug 17 10:47 /u01/apps/oracle/product/10.2.0/db_1/bin/oracle
[oracle@rac02 ~]$ echo $ORACLE_HOME
/u01/apps/oracle/product/10.2.0/db_1
[oracle@rac02 ~]$
[oracle@rac02 ~]$ whoami
oracle
[oracle@rac02 ~]$ id
uid=1659(oracle) gid=501(dba) groups=501(dba),552(admin2),1000(oinstall),1201(asmdba),1301(oper)
[oracle@rac02 ~]$

From the Grid owner ( grid ) on all the nodes

[grid@rac01 grid]$ hostname
rac01.example.com
[grid@rac01 grid]$
[grid@rac01 grid]$ whoami
grid
[grid@rac01 grid]$ echo $ORACLE_HOME;echo $ORACLE_SID
/o001/home/11.2.0/grid
+ASM1
[grid@rac01 grid]$ ls -l $ORACLE_HOME/bin/oracle
-rwsrws--x 1 grid dba 184286251 Apr 5 15:51 /o001/home/11.2.0/grid/bin/oracle*
[grid@rac01 grid]$ whoami
grid
[grid@rac01 grid]$ id
uid=1100(grid) gid=501(dba) groups=501(dba),1200(asmadmin),1201(asmdba),1202(asmoper)
[grid@rac01 grid]$

[grid@rac02 grid]$ hostname
rac02.example.com
[grid@rac02 grid]$ whoami
grid
[grid@rac02 grid]$ echo $ORACLE_HOME;echo $ORACLE_SID
/o001/home/11.2.0/grid
+ASM2
[grid@rac02 grid]$ ls -l $ORACLE_HOME/bin/oracle
-rwsrws--x 1 grid dba 184286251 Apr 5 15:54 /o001/home/11.2.0/grid/bin/oracle*
[grid@rac02 grid]$ whoami
grid
[grid@rac02 grid]$ id
uid=1100(grid) gid=501(dba) groups=501(dba),1200(asmadmin),1201(asmdba),1202(asmoper)
[grid@rac02 grid]$


Then we changed the group ownership of Oracle executable to OS ASM group using below command after logging as ROOT user :
cd /u01/apps/oracle/product/10.2.0/db_1/bin
chgrp asmadmin oracle
chmod 6751 oracle
ls -l oracle

"This allows the database instance to access the ASM disks without having to make the database software owner a member of the OS ASM group."

Then re-login newly as ORACLE user and then started ORACLE Database instance.
[oracle@rac01 bin]$ srvctl status database -d rac10g
Instance rac10g1 is running on node rac01
Instance rac10g2 is running on node rac02
[oracle@rac01 bin]$

Hope it helps
SRI
<div style="border: 1px solid; background: #cccccc none repeat scroll 10px 50%; overflow: auto; margin: 20px; padding: .5em;">

RMAN COLD BACKUP FOR RAC , HOW ?

Written By askMLabs on Thursday, August 26, 2010 | 6:05 AM

What is meant by COLD BACKUP? Is it possible to take COLD BACKUP with RMAN?

In the normal backup and recovery terms , COLD BACKUP is the backup taken when the database is completely down. Then how do we connect to database with RMAN when the database is down?
The RMAN differentiates between "inconsistent" and "consistent" backups on the basis of whether the database is OPEN or not during the Backup. It will not use the terms "COLD BACKUP" and "HOT BACKUP".

For consistance RMAN RAC backup :


  1. Shutdown all the instances in a cluster

  2. connect to any one node and execute the following script

$rman target / nocatalog
RMAN>
run{
startup mount;
allocate channel backup_disk1 type disk format '+FRA';
backup full database;
shutdown immediate;
release channel backup_disk1;
}



Now we have the RMAN cold backup. Does it include online redo logs. How do we restore the RMAN backup taken earlier. Can we directly restore and open the database.

No.

RMAN will not backup online redologs. So when you restore the database from the backup taken above , you cant directly open the database as you dont have the online redologs. You have to open the database with reset logs.

This article is an example to backup RAC database with ASM. When the RAC with ASM Storage provides the high availability , why should we think of cold backup !!!!!!. This articles is only for concepts purpose and the real time RAC backups with RMAN  are completely different.

Hope it helps ....

--SRI

Tracing DBCA

Written By askMLabs on Wednesday, August 25, 2010 | 9:05 AM

The present article discusses the tracing of DBCA. Sometimes you may be landing into issues when using the DBCA and you may not have any clue for the  error. Enabling the tracing for DBCA will give more detailed output showing some clue for the issue.

Till release 10g , we have to manually enable tracing ...

Modify the jre command at the end of the  file : $ORACLE_HOME/bin/dbca  as ...

$JRE_DIR/bin/jre -DORACLE_HOME=$OH -DJDBC_PROTOCOL=thin -mx64m -DTRACING.ENABLED=true -DTRACING.LEVEL=2 -classpath $CLASSPATH oracle.sysman.assistants.dbca.Dbca $ARGUMENTS

But from Release 10g onwards , this tracing is automatically enabled.

We can find the tracing file at

$ORACLE_HOME/cfgtoollogs/dbca/trace.log   ==> in 10g

$ORACLE_BASE/cfgtoollogs/dbca//trace.log  ==> in 11g

Hope it helps

--SRI

$ORACLE_HOME/bin/db

oracle exp/imp and expdp/impdp

Written By askMLabs on Tuesday, August 24, 2010 | 9:14 AM

If you dont know how to use the exact options of the exp/imp and expdp/impdp utilities for your requirement, here is a front end tool to use

http://www.alderprogs.com/

It is a licenced software but you can install the trial version to test.

Hope it helps

--SRI

How to add quick launch toolbar in windows 7

Written By askMLabs on Monday, August 23, 2010 | 11:45 AM

By default Quick Launch is disabled in Windows 7. This will show you how to enable or disable Quick Launch on the taskbar in Windows 7 as a toolbar with small or large icons.

Pls follow the below link to have the step by step procedure to enable quick launch tool bar in windows 7.

http://www.howtogeek.com/howto/windows-7/add-the-quick-launch-bar-to-the-taskbar-in-windows-7/

Hope it helps

SRI

exporting objects to different schema with different tablespace

Written By askMLabs on Sunday, August 22, 2010 | 8:58 AM

Assume that we have some objects in a schema TEST1 with default tablespace TS1. Suppose if there is an application running on this database which requires these objects to be in two different schemas.
Say the second schema is TEST2 with default tablespace TS2.
Now we have to move some objects from TEST1 schema to TEST2 schema.

Consider the following syntax ..
SQL>alter table TEST1.TABLE1 rename to TEST2.TABLE1; ==> Syntax error.
sql>alter table TEST1.TABLE1 move tablespace TS2; ==> This moves the object to tablespace TS2, but still in schema TEST1.

Does export and import work ?   Lets try ....
$exp system/manager file=TABLE1.dmp tables=TEST1.TABLE1 log=exp_TABLE1.log
$imp system/manager file=TABLE1.dmp fromuser=TEST1 touser=TEST2 tables=TABLE1 log=imp_TABLE1.log

This should actually move the table TABLE1 from TEST1 to TEST2.
But if you observe the table TABLE1 after the import it is in schema TEST2 which is ok but tablespace is still TS1. WHY ?
The user TEST2 has default tablespace TS2, so when we import the table it should be created in TS2 tablespace. Why is it created in TS1?

Then what is the solution to move an object to TEST2 with tablespace TS2. !!!!!!!

Follow the following steps to move the objects to different schema with different tablespace.
SQL>alter user TEST2 quota 0 on TS1 quota unlimited on TS2;
SQL>revoke unlimited tablespace from TEST2;

$imp system/manager file=TABLE1.dmp fromuser=TEST1 touser=TEST2 tables=TABLE1 log=imp_TABLE1.log

Then verify the object schema and tablespace. It should be TEST2 with TS2.

Hope it helps ....

-- SRI


Exporting/Importing table partitions

Written By askMLabs on Friday, August 20, 2010 | 5:03 PM

This article shows the table partition management and also how to export and import the table partitions.
SQL> CREATE TABLE "SH"."PART_TABLE"
2     (       "PARAMETER" VARCHAR2(32) NOT NULL ENABLE,
3     "TIMESTAMP" NUMBER NOT NULL ENABLE,
4     "VALUESUM" NUMBER NOT NULL ENABLE,
5     "VALUECOUNT" NUMBER DEFAULT 1 NOT NULL ENABLE,
6      CONSTRAINT "PK_INDEX01" PRIMARY KEY ("PARAMETER", "TIMESTAMP") ENABLE,
7      CONSTRAINT "VALUECOUNT_POS" CHECK ( valuecount > 0 ) ENABLE
8     ) ORGANIZATION INDEX COMPRESS 1 PCTFREE 10 INITRANS 2 MAXTRANS 255  LOGGING
9    TABLESPACE "TS1"
10    STORAGE(
11    BUFFER_POOL DEFAULT)
12   PCTTHRESHOLD 50
13    PARTITION BY RANGE ("TIMESTAMP")
14   (PARTITION "PART_1"  VALUES LESS THAN (1277596800001)
15    PCTFREE 10 INITRANS 2 MAXTRANS 255
16    STORAGE(INITIAL 50331648 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
17    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
18    TABLESPACE "TS1" );

Table created.

SQL> select segment_name,tablespace_name from dba_segments where segment_name='PART_TABLE';

no rows selected

SQL> select partition_name,tablespace_name from dba_segments where segment_name='PART_TABLE';

no rows selected

SQL> select table_name,tablespace_name from dba_tables where table_name='PART_TABLE';

TABLE_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
PART_TABLE

SQL> select partition_name,tablespace_name from dba_tab_partitions where partition_name='PART_1';

PARTITION_NAME                 TABLESPACE_NAME
------------------------------ ------------------------------
PART_1

SQL> select index_name,partition_name,subpartition_count,status from dba_ind_partitions where tablespace_name='TS1';

INDEX_NAME                     PARTITION_NAME                 SUBPARTITION_COUNT STATUS
------------------------------ ------------------------------ ------------------ --------
PK_INDEX01                     PART_1                               0 USABLE

SQL> select owner,table_name,index_name,status from dba_indexes where index_name='PK_INDEX01';

OWNER      TABLE_NAME                     INDEX_NAME              STATUS
---------- ------------------------------ ------------------------------
SH         PART_TABLE                     PK_INDEX01              N/A

SQL> SELECT PARTITION_NAME FROM DBA_TAB_PARTITIONS WHERE TABLE_NAME='PART_TABLE' and PARTITION_NAME like 'PART_%' ORDER BY PARTITION_NAME;

PARTITION_NAME
------------------------------
PART_1

SQL> select segment_type,count(1) from dba_segments where tablespace_name='TS1' group by segment_type;

SEGMENT_TYSH         COUNT(1)
------------------ ----------
INDEX PARTITION             1

SQL> ALTER TABLE SH.PART_TABLE ADD
2    PARTITION "PART_2"  VALUES LESS THAN (1282910400001)
3     PCTFREE 10 INITRANS 2 MAXTRANS 255
4     STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
5     PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
6    TABLESPACE "TS1" ;

Table altered.

SQL> SELECT PARTITION_NAME FROM DBA_TAB_PARTITIONS WHERE TABLE_NAME='PART_TABLE' and PARTITION_NAME like 'PART_%' ORDER BY PARTITION_NAME;

PARTITION_NAME
------------------------------
PART_1
PART_2

SQL> select segment_type,count(1) from dba_segments where tablespace_name='TS1' group by segment_type;

SEGMENT_TYSH         COUNT(1)
------------------ ----------
INDEX PARTITION             2

Insert some  data

SQL> select count(1) from SH.PART_TABLE;

COUNT(1)
----------
700257971

$exp SH/SH@RACDB file=part3.dmp log=part3_exp.log tables=SH.PART_TABLE:PART_2 feedback=10000 statistics=none constraints=n

Export: Release 10.2.0.4.0 - Production on Thu Aug 26 07:27:56 2010

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Produc
tion
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in WE8MSWIN1252 character set and UTF8 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)
Note: constraints on tables will not be exported


About to export sSHcified tables via Conventional Path ...
. . exporting table PART_TABLE
. . exporting partition              PART_2
...........................................................................
.....
809310 rows exported
Export terminated successfully without warnings.


SQL> alter table SH.PART_TABLE drop partition PART_2;

Table altered.

SQL> SELECT PARTITION_NAME FROM DBA_TAB_PARTITIONS WHERE TABLE_NAME='PART_TABLE' and PARTITION_NAME like 'PART_%' ORDER BY PARTITION_NAME;

PARTITION_NAME
------------------------------
PART_1

SQL> select count(1) from SH.PART_TABLE;

COUNT(1)
----------
699448661

SQL>    alter table SH.PART_TABLE add
2    PARTITION "PART_2"  VALUES LESS THAN (1282910400001)
3     PCTFREE 10 INITRANS 2 MAXTRANS 255
4     STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
5     PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
6    TABLESPACE "TS1" ;

Table altered.

SQL> SELECT PARTITION_NAME FROM DBA_TAB_PARTITIONS WHERE TABLE_NAME='PART_TABLE' and PARTITION_NAME like 'PART_%' ORDER BY PARTITION_NAME;

PARTITION_NAME
------------------------------
PART_1
PART_2

SQL> select count(1) from SH.PART_TABLE;

COUNT(1)
----------
699448661

$ imp SH/SH@RACDB file=part3.dmp log=part3_imp.log fromuser=SH buffer=200000 recordlength=6400 tables=PART_TABLE:PART_2 feedback=10000 ignore=y constraints=n statistics=none

Export: Release 10.2.0.4.0 - Production on Thu Aug 26 07:27:56 2010

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


Export file created by EXPORT:V10.02.01 via conventional path

Warning: the objects were exported by SH, not by you

import done in WE8MSWIN1252 character set and UTF8 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
. importing SH's objects into SH
. . importing partition "PART_TABLE":"PART_2"
...........................................................................
.....
809310 rows imported
Import terminated successfully without warnings.


SQL> select count(1) from SH.PART_TABLE;

COUNT(1)
----------
700257971


Hope it helps ...
--SRI

Issues and solutions for 10g RAC Database creation on 11gR2 grid infra

Written By askMLabs on Thursday, August 19, 2010 | 5:58 PM

Issues and solutions for

10g RAC Database creation on 11gR2 grid infra:



Issue 1 :

Oracle Single instance creation screen appears instead of RAC database creation screen.



Solution : Note ID 1073926.1

Issue 2 :

From the above note 1073926.1, it is also required to apply the patch 8288940 to fix 11g ASM Incompatibility for 10g


Issue 3 :

While creating the database using dbca , getting the following error.
"Encountered file error when copying listeners from home=/o001/home/11.2.0/grid/"





Solution : Note ID : 762304.1

Issue 4 :

Invalid specification for system parameter "REMOTE_LISTENER" …..



Solution :

Modified the remote_listener init parameter to point to "<scan-name>:1521"

Issue 5:



Found the following messages in alert log file
ORA-15025: could not open disk '/dev/oracleasm/disks/DATAVOL1'

ORA-27041: unable to open file

Linux-x86_64 Error: 13: Permission denied

Additional information: 2

Fri Aug 20 09:41:54 2010

SUCCESS: diskgroup RACDB_DATA was mounted

SUCCESS: diskgroup RACDB_DATA was dismounted

Fri Aug 20 09:41:54 2010

Errors in file /o001/home/oracle/admin/rac10g/udump/rac10g1_ora_14539.trc:

ORA-00200: control file could not be created

ORA-00202: control file: '+RACDB_DATA/rac10g/control01.ctl'

ORA-15012: ASM file 'rac10g/control01.ctl' does not exist

ORA-17502: ksfdcre:5 Failed to create file +RACDB_DATA/rac10g/control01.ctl

ORA-15081: failed to submit an I/O operation to a disk

Work Around :

SQL> select name,state from v$asm_diskgroup;

NAME             STATE

------------------------------ -----------

CRS             MOUNTED

FRA             MOUNTED

RACDB_DATA MOUNTED

SQL> select name,path from v$asm_disk;

NAME PATH

--------------------------------------------------------------------------------

CRS_0000 /dev/oracleasm/disks/CRSVOL1

FRA_0000 /dev/oracleasm/disks/FRAVOL1

RACDB_DATA_0000 /dev/oracleasm/disks/DATAVOL1

SQL> !

[grid@rac1 disks]$ ls -lrt /dev/oracleasm/disks/DATAVOL1

brw-rw---- 1 grid asmadmin 8, 32 Aug 20 11:53 /dev/oracleasm/disks/DATAVOL1

[grid@rac1 disks]$ id oracle

uid=1659(oracle) gid=501(dba) groups=501(dba),552(admin2),503(oper),1000(oinstall),1201(asmdba)

[grid@rac1 disks]$ ls -lrt /dev/oracleasm/disks/*

brw-rw---- 1 grid asmadmin 8, 48 Aug 20 11:54 /dev/oracleasm/disks/FRAVOL1

brw-rw---- 1 grid asmadmin 8, 32 Aug 20 11:54 /dev/oracleasm/disks/DATAVOL1

brw-rw---- 1 grid asmadmin 8, 64 Aug 20 11:54 /dev/oracleasm/disks/CRSVOL1

[grid@rac1 disks]$ chmod 777 /dev/oracleasm/disks/*

[grid@rac1 disks]$ ls -lrt /dev/oracleasm/disks/*

brwxrwxrwx 1 grid asmadmin 8, 48 Aug 20 11:55 /dev/oracleasm/disks/FRAVOL1

brwxrwxrwx 1 grid asmadmin 8, 32 Aug 20 11:55 /dev/oracleasm/disks/DATAVOL1

brwxrwxrwx 1 grid asmadmin 8, 64 Aug 20 11:55 /dev/oracleasm/disks/CRSVOL1

[grid@rac1 disks]$

Issue 6 :

PRKP-1001 : Error starting the instance rac10g2 on node rac2

CRS-0215 Could not start resource 'ora.rac10g.rac10g2.inst'

This error can be ignored. The instance is started automatically.

RAC SSH setup / User equivalence

Written By askMLabs on Saturday, August 14, 2010 | 5:20 PM

During the installation of Oracle RAC , OUI needs to copy files to and execute programs on the other nodes in the cluster. In order to allow OUI to do that, you must configure SSH to allow user equivalence. Establishing user equivalence with SSH provides a secure means of copying files and executing programs on other nodes in the cluster without requiring password prompts.

The first step is to generate public and private keys for SSH. There are two versions of the SSH protocol; version 1 uses RSA and version 2 uses DSA, so we will create both types of keys to ensure that SSH can use either version. The ssh-keygen program will generate public and private keys of either type depending upon the parameters passed to it.

From ORACLE DATABASE 11gR2, this process is automated in OUI itself. You can find the script "sshUserSetup.sh" in the 11gR2 grid media.

You can use this script for ssh setup in releases prior to 11gR2 RAC.
[oracle@rac1 ~]$ cd /tmp/askm/grid/sshsetup/
[oracle@rac1 sshsetup]$ ./sshUserSetup.sh -user oracle -hosts "rac1 rac2"

The output of this script is also logged into /tmp/sshUserSetup_2010-08-22-09-36-53.log
Hosts are rac1 rac2
user is oracle
Platform:- Linux
Checking if the remote hosts are reachable
PING rac1.localdomain (192.168.1.109) 56(84) bytes of data.
64 bytes from rac1.localdomain (192.168.1.109): icmp_seq=1 ttl=64 time=0.164 ms
64 bytes from rac1.localdomain (192.168.1.109): icmp_seq=2 ttl=64 time=0.051 ms
64 bytes from rac1.localdomain (192.168.1.109): icmp_seq=3 ttl=64 time=0.047 ms
64 bytes from rac1.localdomain (192.168.1.109): icmp_seq=4 ttl=64 time=0.045 ms
64 bytes from rac1.localdomain (192.168.1.109): icmp_seq=5 ttl=64 time=0.049 ms

--- rac1.localdomain ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4002ms
rtt min/avg/max/mdev = 0.045/0.071/0.164/0.046 ms
PING rac2.localdomain (192.168.1.110) 56(84) bytes of data.
64 bytes from rac2.localdomain (192.168.1.110): icmp_seq=1 ttl=64 time=0.442 ms
64 bytes from rac2.localdomain (192.168.1.110): icmp_seq=2 ttl=64 time=0.475 ms
64 bytes from rac2.localdomain (192.168.1.110): icmp_seq=3 ttl=64 time=0.339 ms
64 bytes from rac2.localdomain (192.168.1.110): icmp_seq=4 ttl=64 time=0.380 ms
64 bytes from rac2.localdomain (192.168.1.110): icmp_seq=5 ttl=64 time=0.283 ms

--- rac2.localdomain ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4004ms
rtt min/avg/max/mdev = 0.283/0.383/0.475/0.073 ms
Remote host reachability check succeeded.
The following hosts are reachable: rac1 rac2.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
The script will setup SSH connectivity from the host rac1.localdomain to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host rac1.localdomain
and the remote hosts without being prompted for passwords or confirmations.

NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.

NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEDGES TO THESE
directories.

Do you want to continue and let the script make the above mentioned changes (yes/no)?
yes

The user chose yes
Please specify if you want to specify a passphrase for the private key this script will create for the local host. Passphrase is used to encrypt the private key and makes SSH much more secure. Type 'yes' or 'no' and then press enter. In case you press 'yes', you would need to enter the passphrase whenever the script executes ssh or scp.
The estimated number of times the user would be prompted for a passphrase is 4. In addition, if the private-public files are also newly created, the user would have to specify the passphrase on one additional occasion.
Enter 'yes' or 'no'.
yes

The user chose yes
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /home/oracle/.ssh/config, it would be backed up to /home/oracle/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host
Enter passphrase (empty for no passphrase):  <ENTER>
Enter same passphrase again:  <ENTER>
Generating public/private rsa key pair.
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
06:74:f9:b0:91:8a:a3:19:76:aa:b0:e3:2c:ff:e4:8b oracle@rac1.localdomain
Creating .ssh directory and setting permissions on remote host rac1
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host rac1. If a config file exists already at ~oracle/.ssh/config, it would be backed up to ~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host rac1.
Warning: Permanently added 'rac1,192.168.1.109' (RSA) to the list of known hosts.
oracle@rac1's password:      <ENTER RAC1 ORACLE USER PASSWORD>
Done with creating .ssh directory and setting permissions on remote host rac1.
Creating .ssh directory and setting permissions on remote host rac2
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host rac2. If a config file exists already at ~oracle/.ssh/config, it would be backed up to ~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host rac2.
Warning: Permanently added 'rac2,192.168.1.110' (RSA) to the list of known hosts.
oracle@rac2's password:      <ENTER RAC2 ORACLE USER PASSWORD>
Done with creating .ssh directory and setting permissions on remote host rac2.
Copying local host public key to the remote host rac1
The user may be prompted for a password or passphrase here since the script would be using SCP for host rac1.
oracle@rac1's password:      <ENTER RAC1 ORACLE USER PASSWORD>
Done copying local host public key to the remote host rac1
Copying local host public key to the remote host rac2
The user may be prompted for a password or passphrase here since the script would be using SCP for host rac2.
oracle@rac2's password:      <ENTER RAC2 ORACLE USER PASSWORD>
Done copying local host public key to the remote host rac2
The script will run SSH on the remote machine rac1. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
The script will run SSH on the remote machine rac2. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
cat: /home/oracle/.ssh/known_hosts.tmp: No such file or directory
cat: /home/oracle/.ssh/authorized_keys.tmp: No such file or directory
SSH setup is complete.

------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user oracle.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~oracle or ~oracle/.ssh on the remote host may not be owned by oracle.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the <OMS HOME>/sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--rac1:--
Running /usr/bin/ssh -x -l oracle rac1 date to verify SSH connectivity has been setup from local host to rac1.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
The script will run SSH on the remote machine rac1. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
Sun Aug 22 09:39:35 IST 2010
------------------------------------------------------------------------
--rac2:--
Running /usr/bin/ssh -x -l oracle rac2 date to verify SSH connectivity has been setup from local host to rac2.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
The script will run SSH on the remote machine rac2. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
Sun Aug 22 09:39:36 IST 2010
------------------------------------------------------------------------
SSH verification complete.
[oracle@rac1 sshsetup]$


Note : Password only 4 times
Note : Enter password carefully

Verification :
[oracle@rac1 sshsetup]$ ssh rac1 date;hostname
Sun Aug 14 09:41:33 IST 2010
rac1.localdomain
[oracle@rac1 sshsetup]$ ssh rac2 date;hostname
Sun Aug 14 09:41:39 IST 2010
rac1.localdomain
[oracle@rac1 sshsetup]$

1. ssh both public hostname
2. ssh both private hostname
3. ssh both public ip address
4. ssh both Private ip address

Screen shots showing how this is implemented in 11gR2 RAC ....





Hope it helps ...

--SRI

11g New Background Processes

Written By askMLabs on Monday, March 15, 2010 | 7:31 PM

11g New Background Processes:



Modifying AWR snapshot settings

Written By askMLabs on Monday, March 1, 2010 | 5:53 PM

SQL> select
2        extract( day from snap_interval) *24*60+
3        extract( hour from snap_interval) *60+
4        extract( minute from snap_interval ) "Snapshot Interval",
5        extract( day from retention) *24*60+
6        extract( hour from retention) *60+
7        extract( minute from retention ) "Retention Interval"
8  from dba_hist_wr_control;

Snapshot Interval Retention Interval
----------------- ------------------
60              10080

SQL> set linesize 100
col snap_interval format a20
col retention format a20
col topnsql format a20
select * from dba_hist_wr_control;SQL> SQL> SQL> SQL>

DBID SNAP_INTERVAL        RETENTION            TOPNSQL
---------- -------------------- -------------------- --------------------
3438851159 +00000 01:00:00.0    +00007 00:00:00.0    DEFAULT

SQL> execute dbms_workload_repository.modify_snapshot_settings( interval => 30,retention => 43200);

PL/SQL procedure successfully completed.

NOTE : all the values are specified in minutes

SQL> select
2        extract( day from snap_interval) *24*60+
3        extract( hour from snap_interval) *60+
4        extract( minute from snap_interval ) "Snapshot Interval",
5        extract( day from retention) *24*60+
6        extract( hour from retention) *60+
7        extract( minute from retention ) "Retention Interval"
8  from dba_hist_wr_control;

Snapshot Interval Retention Interval
----------------- ------------------
30              43200

SQL> set linesize 100
col snap_interval format a20
col retention format a20
col topnsql format a20
select * from dba_hist_wr_control;SQL> SQL> SQL> SQL>

DBID SNAP_INTERVAL        RETENTION            TOPNSQL
---------- -------------------- -------------------- --------------------
3438851159 +00000 00:30:00.0    +00030 00:00:00.0    DEFAULT

SQL>

==> SYSAUX tablespace size can be estimated using the script utlsyxsz.sql

SQL> @$ORACLE_HOME/rdbms/admin/utlsyxsz.sql

This script estimates the space required for the SYSAUX tablespace.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Specify the Report File Name
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is utlsyxsz.txt.  To use this name,
press <return> to continue, otherwise enter an alternative.

Enter value for report_name: askm

Using the report name askm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SYSAUX Size Estimation Report
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Estimated at
12:10:21 on Mar 01, 2011 ( Tuesday ) in Timezone -05:00

DB_NAME     HOST_PLATFORM                             INST STARTUP_TIME      PAR
----------- ---------------------------------------- ----- ----------------- ---
* EPPERF    atlsdbrfl01.seo.int - Linux x86 64-bit       1 09:58:44 (02/28)  NO

~~~~~~~~~~~~~~~~~~~~
Current SYSAUX usage
~~~~~~~~~~~~~~~~~~~~
| Total SYSAUX size:                         119.3 MB
|
| Total size of SM/AWR                        71.1 MB (  59.6% of SYSAUX )
| Total size of SM/OPTSTAT                    18.8 MB (  15.7% of SYSAUX )
| Total size of SM/ADVISOR                     6.4 MB (   5.3% of SYSAUX )
| Total size of LOGMNR                         6.0 MB (   5.0% of SYSAUX )
| Total size of SM/OTHER                       4.8 MB (   4.0% of SYSAUX )
| Total size of EM_MONITORING_USER             1.6 MB (   1.3% of SYSAUX )
| Total size of LOGSTDBY                       0.9 MB (   0.7% of SYSAUX )
| Total size of XSOQHIST                       0.8 MB (   0.6% of SYSAUX )
| Total size of AO                             0.8 MB (   0.6% of SYSAUX )
| Total size of STREAMS                        0.5 MB (   0.4% of SYSAUX )
| Total size of JOB_SCHEDULER                  0.4 MB (   0.3% of SYSAUX )
| Total size of TSM                            0.3 MB (   0.2% of SYSAUX )
| Total size of Others                         7.1 MB (   6.0% of SYSAUX )
|

~~~~~~~~~~~~~~~~~~~~
AWR Space Estimation
~~~~~~~~~~~~~~~~~~~~

| To estimate the size of the Automatic Workload Repository (AWR)
| in SYSAUX, we need the following values:
|
|     - Interval Setting (minutes)
|     - Retention Setting (days)
|     - Number of Instances
|     - Average Number of Active Sessions
|     - Number of Datafiles

|
| For 'Interval Setting',
|   Press <return> to use the current value:     30.0 minutes
|   otherwise enter an alternative
|
Enter value for interval:

**   Value for 'Interval Setting': 30

|
| For 'Retention Setting',
|   Press <return> to use the current value:     30.0 days
|   otherwise enter an alternative
|
Enter value for retention:

**   Value for 'Retention Setting': 30

|
| For 'Number of Instances',
|   Press <return> to use the current value:   1.00
|   otherwise enter an alternative
|
Enter value for num_instances: 1

**   Value for 'Number of Instances': 1

|
| For 'Average Number of Active Sessions',
|   Press <return> to use the current value:   0.06
|   otherwise enter an alternative
|
Enter value for active_sessions: 50

**   Value for 'Average Number of Active Sessions': 50

| ***************************************************
| Estimated size of AWR:                   3,921.8 MB
|
|   The AWR estimate was computed using
|   the following values:
|
|            Interval -        30 minutes
|           Retention -     30.00 days
|       Num Instances -         1
|     Active Sessions -     50.00
|           Datafiles -        79
| ***************************************************

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Optimizer Stat History Space Estimation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

| To estimate the size of the Optimizer Statistics History
| we need the following values:
|
|     - Number of Tables in the Database
|     - Number of Partitions in the Database
|     - Statistics Retention Period (days)
|     - DML Activity in the Database (level)

|
| For 'Number of Tables',
|   Press <return> to use the current value:  4,488.0
|   otherwise enter an alternative <a positive integer>
|
Enter value for number_of_tables:

**   Value for 'Number of Tables': 4488

|
| For 'Number of Partitions',
|   Press <return> to use the current value:   0.00
|   otherwise enter an alternative <a positive integer>
|
Enter value for number_of_partitions:

**   Value for 'Number of Partitions': 0

|
| For 'Statistics Retention',
|   Press <return> to use the current value:     31.0 days
|   otherwise enter an alternative <a positive integer>
|
Enter value for stats_retention:

**   Value for 'Statistics Retention': 31

|
| For 'DML Activity',
|   Press <return> to use the current value:        2 <medium>
|   otherwise enter an alternative <1=low, 2=medium, 3=high>
|
Enter value for dml_activity:

**   Value for 'DML Activity': 2

| ***************************************************
| Estimated size of Stats history            102.2 MB
|
|   The space for Optimizer Statistics history was
|   estimated using the following values:
|
|                         Tables -   4,488
|                        Indexes -   6,282
|                        Columns -  37,471
|                     Partitions -       0
|          Indexes on Partitions -       0
|          Columns in Partitions -       0
|        Stats Retention in Days -      31
|          Level of DML Activity -  Medium
| ***************************************************

~~~~~~~~~~~~~~~~~~~~~~
Estimated SYSAUX usage
~~~~~~~~~~~~~~~~~~~~~~

| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Estimated size of AWR:                   3,921.8 MB
|
|   The AWR estimate was computed using
|   the following values:
|
|            Interval -        30 minutes
|           Retention -     30.00 days
|       Num Instances -         1
|     Active Sessions -     50.00
|           Datafiles -        79
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Estimated size of Stats history            102.2 MB
|
|   The space for Optimizer Statistics history was
|   estimated using the following values:
|
|                         Tables -   4,488
|                        Indexes -   6,282
|                        Columns -  37,471
|                     Partitions -       0
|          Indexes on Partitions -       0
|          Columns in Partitions -       0
|        Stats Retention in Days -      31
|          Level of DML Activity -  Medium
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|   For all the other components, the estimate
|   is equal to the current space usage of
|   the component.
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
| ***************************************************
| Summary of SYSAUX Space Estimation
| ***************************************************

| Est size of SM/ADVISOR                       6.4 MB
| Est size of LOGMNR                           6.0 MB
| Est size of SM/OTHER                         4.8 MB
| Est size of EM_MONITORING_USER               1.6 MB
| Est size of LOGSTDBY                         0.9 MB
| Est size of XSOQHIST                         0.8 MB
| Est size of AO                               0.8 MB
| Est size of STREAMS                          0.5 MB
| Est size of JOB_SCHEDULER                    0.4 MB
| Est size of TSM                              0.3 MB
| Est size of Others                           7.1 MB

| Est size of SM/AWR                       3,921.8 MB
| Est size of SM/OPTSTAT                     102.2 MB
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Total Estimated SYSAUX size:             4,053.4 MB
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ***************************************************

End of Report
SQL>

NOTE :

STATSPACK has many more settings that can be configured.  These are kept in the stats$statspack_parameter table. This table stores a single row for the database parameters with the corresponding STATSPACK settings.  These settings influence the amount of information STATSPACK gathers from the v$ views.

Hope It helps

SRI


How do you check the User failed login attempts without auditing theuser?

Written By askMLabs on Tuesday, December 29, 2009 | 7:36 PM

How do you check the User failed login attempts without auditing the user?


A user created with default profile and the profile is modified to have the resource name FAILED_LOGIN_ATTEMPTS set to 10. Now the user account will lock when the attempts to connect to the user is more than 10.

How do we verify that there are so many number of failed login attempts earlier.
Is auditing the user the only solution ?
No

You can find the FAILED_LOGIN_ATTEMPTS value from the lcount column of user$ table.
SQL> select * from dba_profiles where resource_name = 'FAILED_LOGIN_ATTEMPTS' and limit=10;

PROFILE                        RESOURCE_NAME                    RESOURCE
------------------------------ -------------------------------- --------
LIMIT
----------------------------------------
DEFAULT                        FAILED_LOGIN_ATTEMPTS            PASSWORD
10

First i queried the failed login attemps and it shows the value "0".

SQL> select USER#,NAME,LCOUNT from user$ where NAME='RAC_ACCNT';

USER# NAME                               LCOUNT
---------- ------------------------------ ----------
303 RAC_ACCNT                               0

Then i tried with one failed login attempt from another session and the value increased to 1.

SQL> select USER#,NAME,LCOUNT from user$ where NAME='RAC_ACCNT';

USER# NAME                               LCOUNT
---------- ------------------------------ ----------
303 RAC_ACCNT                               1

Again tried with  failed login attempt from another session and the value increased to 2.

SQL> select USER#,NAME,LCOUNT from user$ where NAME='RAC_ACCNT';

USER# NAME                               LCOUNT
---------- ------------------------------ ----------
303 RAC_ACCNT                               2

Now i tried to connect to the user successfully without fail and the failed login attempt parameter is set to "0" agian.

SQL> select USER#,NAME,LCOUNT from user$ where NAME='RAC_ACCNT';

USER# NAME                               LCOUNT
---------- ------------------------------ ----------
303 RAC_ACCNT                               0


Conclusions :
============
In order to check if the FAILED_LOGIN_ATTEMPTS is working or not , we need to try giving wrong passwords 10 times continuously without any successful attempts. Then 11th attempt will lock the user account. But if there is atleast one single successful attempt to connect to the user , the value resets to "0" again.

Purging LOBs

Written By askMLabs on Friday, November 27, 2009 | 9:54 PM

Purging LOBs:


If we purge a table which contains LOBs , we may not reclaim space. BLOBs are stored out of line once they exceed 4,000 bytes (you can also specify that they are always stored out of line as well).

If the BLOBs were all inline, each taking 4000 or less bytes, then you did free space in your table.  The table will not shrink in size (tables NEVER shrink) but it will have more blocks on its free list for subsequent inserts.


SQL> desc applsys.fnd_lobs
Name                                      Null?    Type
----------------------------------------- -------- ----------------------------
FILE_ID                                   NOT NULL NUMBER
FILE_NAME                                          VARCHAR2(256)
FILE_CONTENT_TYPE                         NOT NULL VARCHAR2(256)
FILE_DATA                                          BLOB
UPLOAD_DATE                                        DATE
EXPIRATION_DATE                                    DATE
PROGRAM_NAME                                       VARCHAR2(32)
PROGRAM_TAG                                        VARCHAR2(32)
LANGUAGE                                           VARCHAR2(4)
ORACLE_CHARSET                                     VARCHAR2(30)
FILE_FORMAT                               NOT NULL VARCHAR2(10)



SQL> select round(sum(bytes)/1024/1024) Mb from dba_segments where segment_name='FND_LOBS';

MB
----------
179

SQL> select round(sum(bytes)/1024/1024) Mb from dba_segments where segment_name='SYS_LOB0000034032C00004$$';

MB
----------
20699

SQL> select OBJECT_NAME,OBJECT_ID,OWNER,OBJECT_TYPE,STATUS from dba_objects where object_name='SYS_LOB0000034032C00004$$' and object_type='LOB';

OBJECT_NAME
--------------------------------------------------------------------------------
OBJECT_ID OWNER                          OBJECT_TYPE         STATUS
---------- ------------------------------ ------------------- -------
SYS_LOB0000034032C00004$$
34033 APPLSYS                        LOB                 VALID

SQL> select OWNER,TABLE_NAME,COLUMN_NAME,SEGMENT_NAME,TABLESPACE_NAME from dba_lobs where SEGMENT_NAME='SYS_LOB0000034032C00004$$';

OWNER                          TABLE_NAME
------------------------------ ------------------------------
COLUMN_NAME
--------------------------------------------------------------------------------
SEGMENT_NAME                   TABLESPACE_NAME
------------------------------ ------------------------------
APPLSYS                        FND_LOBS
FILE_DATA
SYS_LOB0000034032C00004$$      APPS_TS_MEDIA


Action Plan
===========

1) Take hotbackup for the instance
2) Execute the following commands as sysdba



SQL> delete from APPLSYS.FND_LOBS
SQL> alter table applsys.FND_LOBS modify lob (FILE_DATA) (shrink space);

3) Then Execute the following commands to confirm the space gained.

SQL> select round(sum(bytes)/1024/1024) Mb from dba_segments where segment_name='FND_LOBS';
SQL> select round(sum(bytes)/1024/1024) Mb from dba_segments where segment_name='SYS_LOB0000034032C00004$$';

NOTE: It should return "0" for both the commands.

Or

Update the LOB column value with NULL and then execute the following command.

SQL> alter table applsys.FND_LOBS modify lob (FILE_DATA) (shrink space);

OR

Use the DBMS_LOB.ERASE   package and erase the LOBs. Then execute the following command ..

SQL> alter table applsys.FND_LOBS modify lob (FILE_DATA) (shrink space);

In all the case it is compulsory to use the " alter table .." command  claim the space.

 
Support :
Copyright © 2013. askMLabs - All Rights Reserved
Proudly powered by Blogger