giovedì 7 maggio 2009

Major difference between Linux and Solaris

Introduction


Most readers coming here are more familiar with Linux than Solaris. This little page is designed to give those users some tips for running a Solaris box.
It is in no way intended as a definitive guide, and there may be lot better ways of doing things. Feel free to contribute.

ps

ps -ef on Linux will give the full command line, but with Solaris you don't get it all.
This is particularly critical when looking at java processes.
Fortunately Solaris retains the BSD style binaries in /usr/ucb, so execute:


 /usr/ucb/ps wwaux|grep java


instead


bash

/bin/sh on Solaris is a POSIX complaint bourne shell. If you have written bash-centric scripts, replace #!/bin/sh with #!/bin/bash

NFS

Starting of NFS daemon

Instead of

# service nfsserver start


one does:

# svcadm enable network/nfs/server

Exports

Instead of the file /etc/exports, under Solaris the file /etc/dfs/dfstab needs to be edited.

Sharing with zfs

Nowadays, you would probably use zfs sharenfs eg:



# zfs set sharenfs=on zpool/sharedfolder
# zfs sharenfs=rw=server.fqdn.ch,rw=otherserver.fqdn.ch zpool/sharedfolder


An attempt at a matrix





























































Linux command Solaris similar command Comments
top prstat You can compile top on Solaris, but you can't rely on it's accuracy
free vmstat  
cat /proc/meminfo prtconf | grep Memory  
cat /proc/cpuinfo psrinfo -v you can also use prtconf
netstat -p lsof -i lsof is not a default command. You need the package
uname -a isainfo -b to determine how many bits your os is
java -d64 java -d64 Start java with a default of 64 bit. Linux seems to do this by default though.
cat /etc/redhat-release cat /etc/release
  sysdef sysdef holds a lot of system info including kernel tunables
lsmod modinfo  
strace truss  

Another matrix




RHEL
Solaris


Shutdown


shutdown -h now (or) poweroff
shutdown -y -g0 -i5 (or) init 5


reboot
reboot (or) shutdown -y -g0 -i6 (or) init 6


halt
halt


Kernel


/sbin/lsmod
modinfo


/sbin/insmod
modload


/sbin/rmmod
modunload


scanpci
/usr/X11/bin/scanpci (or) prtconf -v


Printing


lp (or) lpr
lp (or /usr/ucb/lpr)


lpstat (or) lpq
lpstat (or /usr/ucb/lpq)


Services


/sbin/service --status-all
svcs -a



/sbin/service sendmail stop
svcadm disable sendmail


/sbin/service sendmail start
svcadm enable sendmail



/sbin/service sendmail status
svcs sendmail


/sbin/chkconfig --list
svcs -a


/sbin/chkconfig --add /etc/rc3.d/f00

svccfg import f00.xml


/sbin/chkconfig sendmail on
svcadm enable sendmail


Monitoring



top
prstat


cat /proc/cpuinfo
psrinfo -v



cat /proc/meminfo
prtconf


NFS


exportfs
exportfs (or) share



(edit /etc/exports)
share /home (or) zfs sharenfs=on


(edit /etc/exports) unshare /home (or) zfs sharenfs=off


Networking



/sbin/mii-tool
ndd (or) /sbin/dladm show-dev


ifconfig
ifconfig -a



/sbin/ethtool
ndd


/sbin/dhclient
dhcpagent



iptables
ipfilter


Storage


fdisk
fdisk (and) format



parted
format


mkfs -t ext3 /dev/hda1
mkfs -F ufs /dev/rdsk/c0t0d0s0 (or) newfs /dev/rdsk/c0t0d0s0



cdrecord dev=2,0 f00.iso cdrw -i f00.iso


tar xfvj f00.tar.bz2
gtar xfvj f00.tar.bz2


lvm/pv*/lv*/vg*

meta*


Dev


(edit /etc/ld.so.conf)
crle



gcc
/opt/csw/bin/gcc


ld
/usr/ccs/bin/ld

mercoledì 6 maggio 2009

Configurando Sun Cluster 3.2 con Oracle 10g RAC y ASM

Diego E. Aguirre, octubre 2008



Esta instalación fue realizada en el siguiente escenario:


2 Dominios físicos de two servidores Sun Fire 25K, cada uno con:

  • 64 Gbyte de RAM
  • 8 UltraSPARC IV+ CPU dual-core de 1.8 MHz
  • 4 discos internos
  • Conectado a Storage EMC mediante una SAN (SAN EMC Symmetrix DMX3)
  • Solaris 10 08/07 release plus OEM
  • Base de Datos Oracle versión 10.2.0.3
  • Veritas Storage Foundation 5.0 MP1 by Symantec

Importante: Verificar que no este el Patch 126106-13 instalado ya que existe un bug con recursos escalables a la hora de la registración de los mismos.



Requerimientos de Solaris:

Tener instalados los paquetes de la Distribución Full Plus OEM.

Crear una partición de 512 Mbyte en el slice 6 del disco de S.O. y
montarla como /globaldevices.

Asegurarse de tener instalados todos los paquetes y patches de la SAN Foundation Suite.

Asegurarse que la property local_only del rpcbind este seteada en false.



nodo1
# svcprop network/rpc/bind:default|grep local_
config/local_only boolean false

Si no esta seteado en false, ejecutar:




svccfg
svc:>select network/rpc/bind
svc:/network/rpc/bind> setprop config/local_only=false
svc:/network/rpc/bind> quit

svcadm refresh network/rpc/bind:default

En el NODO1, comenzar la instalación del Sun Cluster 3.2.




nodo1 # scinstall

*** Main Menu ***

Please select from one of the following (*) options:

* 1) Create a new cluster or add a cluster node
2) Configure a cluster to be JumpStarted from this install server
3) Manage a dual-partition upgrade
4) Upgrade this cluster node
5) Print release information for this cluster node
* ?) Help with menu options
* q) Quit

Option: 1

*** New Cluster and Cluster Node Menu ***

Please select from any one of the following options:

1) Create a new cluster
2) Create just the first node of a new cluster on this machine
3) Add this machine as a node in an existing cluster
?) Help with menu options
q) Return to the Main Menu

Option: 1

*** Create a New Cluster ***

This option creates and configures a new cluster.
You must use the Java Enterprise System (JES) installer to install the
Sun Cluster framework software on each machine in the new cluster
before you select this option.
If the "remote configuration" option is unselected from the JES
installer when you install the Sun Cluster framework on any of the new
nodes, then you must configure either the remote shell (see rsh(1)) or
the secure shell (see ssh(1)) before you select this option. If rsh or
ssh is used, you must enable root access to all of the new member
nodes from this node.

Press Control-d at any time to return to the Main Menu.

Do you want to continue (yes/no) [yes]? yes

>>> Typical or Custom Mode <<<

This tool supports two modes of operation, Typical mode and Custom.
For most clusters, you can use Typical mode. However, you might need
to select the Custom mode option if not all of the Typical defaults
can be applied to your cluster.
For more information about the differences between Typical and Custom
modes, select the Help option from the menu.

Please select from one of the following options:

1) Typical
2) Custom
?) Help
q) Return to the Main Menu

Option [1]: 2

>>> Cluster Name <<<

Each cluster has a name assigned to it. The name can be made up of any
characters other than whitespace. Each cluster name should be unique
within the namespace of your enterprise.

What is the name of the cluster you want to establish [CLUSTER2]?

>>> Cluster Nodes <<<

This Sun Cluster release supports a total of up to 16 nodes.
Please list the names of the other nodes planned for the initial
cluster configuration. List one node name per line. When finished,

type Control-D:

Node name: nodo1
Node name: nodo2

Node name (Control-D to finish): ^D

This is the complete list of nodes:

nodo1
nodo2

Is it correct (yes/no) [yes]? yes

Attempting to contact "nodo2" ... done
Searching for a remote configuration method ... done

The Sun Cluster framework is able to complete the configuration
process without remote shell access.

Press Enter to continue:

>>> Authenticating Requests to Add Nodes <<<

Once the first node establishes itself as a single node cluster, other
nodes attempting to add themselves to the cluster configuration must
be found on the list of nodes you just provided. You can modify this
list by using claccess(1CL) or other tools once the cluster has been
established.
By default, nodes are not securely authenticated as they attempt to
add themselves to the cluster configuration. This is generally
considered adequate, since nodes which are not physically connected to
the private cluster interconnect will never be able to actually join
the cluster. However, DES authentication is available. If DES
authentication is selected, you must configure all necessary
encryption keys before any node will be allowed to join the cluster

(see keyserv(1M), publickey(4)).

Do you need to use DES authentication (yes/no) [no]? no

>>> Network Address for the Cluster Transport <<<

The cluster transport uses a default network address of 172.16.0.0. If
this IP address is already in use elsewhere within your enterprise,
specify another address from the range of recommended private
addresses (see RFC 1918 for details).

The default netmask is 255.255.248.0. You can select another netmask,
as long as it minimally masks all bits that are given in the network
address.

The default private netmask and network address result in an IP
address range that supports a cluster with a maximum of 64 nodes and
10 private networks.

Is it okay to accept the default network address (yes/no) [no]?
What network address do you want to use [33.33.33.128]?
The combination of private netmask and network address will dictate
the maximum number of both nodes and private networks that can be
supported by a cluster. Given your private network address, this
program will generate a range of recommended private netmasks that are
based on the maximum number of nodes and private networks that you
anticipate for this cluster.

In specifying the anticipated maximum number of nodes and private
networks for this cluster, it is important that you give serious
consideration to future growth potential. While both the private
netmask and network address can be changed later, the tools for making
such changes require that all nodes in the cluster be booted in
noncluster mode.

Maximum number of nodes anticipated for future growth [2]?

Maximum number of private networks anticipated for future growth [2]?

Specify a netmask of 255.255.255.224 to meet anticipated future
requirements of 2 cluster nodes and 2 private networks.
To accommodate more growth, specify a netmask of 255.255.255.192 to
support up to 4 cluster nodes and 4 private networks.
What netmask do you want to use [255.255.255.224]? 255.255.255.128

>>> Minimum Number of Private Networks <<<

Each cluster is typically configured with at least two private
networks. Configuring a cluster with just one private interconnect
provides less availability and will require the cluster to spend more
time in automatic recovery if that private interconnect fails.

Should this cluster use at least two private networks (yes/no) [yes]? yes

>>> Point-to-Point Cables <<<

The two nodes of a two-node cluster may use a directly-connected
interconnect. That is, no cluster switches are configured. However,
when there are greater than two nodes, this interactive form of
scinstall assumes that there will be exactly one switch for each
private network.

Does this two-node cluster use switches (yes/no) [yes]? yes

>>> Cluster Switches <<<

All cluster transport adapters in this cluster must be cabled to a
"switch". And, each adapter on a given node must be cabled to a
different switch. Interactive scinstall requires that you identify one
switch for each private network in the cluster.

What is the name of the first switch in the cluster [switch1]?

What is the name of the second switch in the cluster [switch2]?

>>> Cluster Transport Adapters and Cables <<<

You must configure the cluster transport adapters for each node in the
cluster. These are the adapters which attach to the private cluster
interconnect.

Select the first cluster transport adapter for "nodo1":

1) ce1
2) ce3
3) ce4
4) ce5
5) eri0
6) eri1
7) Other

Option: 1

Will this be a dedicated cluster transport adapter (yes/no) [yes]? yes

Adapter "ce1" is an Ethernet adapter.

Searching for any unexpected network traffic on "ce1" ... done
Unexpected network traffic was seen on "ce1".
"ce1" may be cabled to a public network.

Do you want to use "ce1" anyway (yes/no) [no]? yes

The "dlpi" transport type will be set for this cluster.

For node "nodo1",

Name of the switch to which "ce1" is connected [switch1]?
Each adapter is cabled to a particular port on a switch. And, each
port is assigned a name. You can explicitly assign a name to each
port. Or, for Ethernet and Infiniband switches, you can choose to
allow scinstall to assign a default name for you. The default port
name assignment sets the name to the node number of the node hosting
the transport adapter at the other end of the cable.

For node "nodo1",

Use the default port name for the "ce1" connection (yes/no) [yes]? yes

Select the second cluster transport adapter for "nodo1":

1) ce1
2) ce3
3) ce4
4) ce5
5) eri0
6) eri1
7) Other

Option: 2

Will this be a dedicated cluster transport adapter (yes/no) [yes]? yes

Adapter "ce3" is an Ethernet adapter.

Searching for any unexpected network traffic on "ce3" ... done
Unexpected network traffic was seen on "ce3".
"ce3" may be cabled to a public network.

Do you want to use "ce3" anyway (yes/no) [no]? yes

For node "nodo1",

Name of the switch to which "ce3" is connected [switch2]?

For node "nodo1",

Use the default port name for the "ce3" connection (yes/no) [yes]? yes
For all other nodes, Autodiscovery is the best method for configuring the cluster
transport. However, you can choose to manually configure the remaining
adapters and cables.

Is it okay to use autodiscovery for the other nodes (yes/no) [yes]? no

For node "nodo2",

What is the name of the first cluster transport adapter? ce1

Will this be a dedicated cluster transport adapter (yes/no) [yes]? yes

Adapter "ce1" is an Ethernet adapter.

For node "nodo2",

Name of the switch to which "ce1" is connected [switch1]?

For node "nodo2",

Use the default port name for the "ce1" connection (yes/no) [yes]? yes

For node "nodo2",

What is the name of the second cluster transport adapter? ce3

Will this be a dedicated cluster transport adapter (yes/no) [yes]? yes

Adapter "ce3" is an Ethernet adapter.

For node "nodo2",

Name of the switch to which "ce3" is connected [switch2]?

For node "nodo2",

Use the default port name for the "ce3" connection (yes/no) [yes]? yes

>>> Quorum Configuration <<<

Every two-node cluster requires at least one quorum device. By
default, scinstall will select and configure a shared SCSI quorum disk
device for you.
This screen allows you to disable the automatic selection and
configuration of a quorum device.

The only time that you must disable this feature is when ANY of the
shared storage in your cluster is not qualified for use as a Sun
Cluster quorum device. If your storage was purchased with your
cluster, it is qualified. Otherwise, check with your storage vendor to
determine whether your storage device is supported as Sun Cluster
quorum device.

Do you want to disable automatic quorum device selection (yes/no) [no]? yes

>>> Global Devices File System <<<

Each node in the cluster must have a local file system mounted on
/global/.devices/node before it can successfully participate
as a cluster member. Since the "nodeID" is not assigned until
scinstall is run, scinstall will set this up for you.
You must supply the name of either an already-mounted file system or
raw disk partition which scinstall can use to create the global
devices file system. This file system or partition should be at least
512 MB in size.
If an already-mounted file system is used, the file system must be
empty. If a raw disk partition is used, a new file system will be
created for you.

The default is to use /globaldevices.

For node "nodo1",

Is it okay to use this default (yes/no) [yes]? yes

Testing for "/globaldevices" on "nodo1" ... done

For node "nodo2",

Is it okay to use this default (yes/no) [yes]? yes

Testing for "/globaldevices" on "nodo2" ... done

Is it okay to create the new cluster (yes/no) [yes]? yes

During the cluster creation process, sccheck is run on each of the new
cluster nodes. If sccheck detects problems, you can either interrupt
the process or check the log files after the cluster has been
established.

Interrupt cluster creation for sccheck errors (yes/no) [no]? no

Cluster Creation

Log file - /var/cluster/logs/install/scinstall.log.5518

Started sccheck on "nodo1".
Started sccheck on "nodo2".

sccheck completed with no errors or warnings for "nodo1".
sccheck completed with no errors or warnings for "nodo2".

Configuring "nodo2" ... done
Rebooting "nodo2" ... done
Configuring "nodo1" ... done

Rebooting "nodo1" ...
Log file - /var/cluster/logs/install/scinstall.log.5518
Rebooting ...

Pasos para configurar IPMP



En el nodo1, agregar las siguientes lineas en el /etc/hosts:



10.77.55.110 nodo1 nodo1.dominio.com loghost
10.77.55.108 nodo1-ce0-test
10.77.55.109 nodo1-ce2-test
10.77.55.111 nodo1-virtual
10.77.55.125 nodo2-virtual
10.77.55.124 nodo2
10.77.55.187 cluster-siebel
### Red Privada Oracle Rac
10.33.33.186 nodo1-priv-test0
10.33.33.187 nodo1-priv-test1
10.33.33.188 nodo1-priv
### Sun cluster interconnect ( clprivnet0 )
10.33.33.66 nodo1-priv-sc
10.10.33.65 nodo2-priv-sc


Crear en el /etc
los siguientes archivos:



/etc/hostname.ce0. Agregar lo siguiente:



nodo1-ce0-test group SIEBEL -failover deprecated \
netmask + broadcast + up

/etc/hostname.ce2. Agregar lo siguiente:




nodo1 group SIEBEL netmask + broadcast + up
addif nodo1-ce2-test -failover deprecated \
netmask + broadcast + up

/etc/hostname.ce4. Agregar lo siguiente:



nodo1-priv-test0 group rac -failover deprecated \
netmask + broadcast + up

/etc/hostname-ce5. Agregar lo siguiente:



nodo1-priv group rac netmask + broadcast + up
addif nodo1-priv-test1 -failover deprecated \
netmask + broadcast + up

Luego rebootear y chequear con ifconfig -a (luego repetir los mismos pasos en el nodo2).




nodo1 # ifconfig -a
ce0:flags=9040843
mtu 1500 index 2 inet 10.77.55.108 netmask ffffff00 broadcast 10.77.55.255
groupname SIEBEL ether 0:14:4f:67:ad:52
ce0:1: flags=1040843 mtu 1500 index 2
inet 10.77.55.187 netmask ffffff00 broadcast 10.77.55.255
ce1: flags=1008843 mtu 1500 index 8
inet 10.33.33.18 netmask fffffff8 broadcast 10.33.33.23 ether 0:14:4f:67:ad:53
ce2: flags=1000843 mtu 1500 index 3
inet 10.77.55.110 netmask ffffff00 broadcast 10.77.55.255
groupname SIEBEL ether 0:14:4f:68:50:d0
ce2:1: flags=9040843 mtu 1500 index 3 inet 10.77.55.109 netmask ffffff00 broadcast 10.77.55.255
ce2:2: flags=1040843 mtu 1500 index 3
inet 10.77.55.111 netmask ffffff00 broadcast 10.77.100.255
ce3: flags=1008843 mtu 1500 index 7
inet 10.33.33.10 netmask fffffff8 broadcast 10.33.33.15 ether 0:14:4f:68:50:d1
ce4: flags=9040843 mtu 1500 index 4 inet 10.33.33.186 netmask ffffffc0 broadcast 10.33.33.255
groupname rac ether 0:14:4f:68:50:d2
ce5: flags=1000843 mtu 1500 index 5
inet 10.33.33.188 netmask ffffffc0 broadcast 10.33.33.255
dman0: flags=1008843 mtu 1500 index 4
inet 10.2.1.7 netmask ffffffe0 broadcast 10.2.1.31 ether 0:0:be:aa:40:d5
clprivnet0: flags=1009843 mtu 1500 index 7
inet 10.33.33.66 netmask ffffffe0 broadcast 10.33.33.95 ether 0:0:0:0:0:2


Configurar el Quórum Devices, via clsetup (si todavía no esta creado):



nodo1 # didadm -L
1 nodo2:/dev/rdsk/c0t8d0 /dev/did/rdsk/d1
2 nodo2:/dev/rdsk/c0t9d0 /dev/did/rdsk/d2
3 nodo2:/dev/rdsk/c10t60060480000290101637533030353533d0 /dev/did/rdsk/d3
3 nodo1:/dev/rdsk/c2t60060480000290101637533030353533d0 /dev/did/rdsk/d3
4 nodo2:/dev/rdsk/c10t60060480000290101637533030344544d0 /dev/did/rdsk/d4
4 nodo1:/dev/rdsk/c2t60060480000290101637533030344544d0 /dev/did/rdsk/d4
5 nodo2:/dev/rdsk/c10t60060480000290101637533030344435d0 /dev/did/rdsk/d5
5 nodo1:/dev/rdsk/c2t60060480000290101637533030344435d0 /dev/did/rdsk/d5
6 nodo2:/dev/rdsk/c10t60060480000290101637533030344537d0 /dev/did/rdsk/d6
6 nodo1:/dev/rdsk/c2t60060480000290101637533030344537d0 /dev/did/rdsk/d6
7 nodo2:/dev/rdsk/c10t60060480000290101637533030344442d0 /dev/did/rdsk/d7
7 nodo1:/dev/rdsk/c2t60060480000290101637533030344442d0 /dev/did/rdsk/d7
8 nodo2:/dev/rdsk/c10t60060480000290101637533030344531d0 /dev/did/rdsk/d8
8 nodo1:/dev/rdsk/c2t60060480000290101637533030344531d0 /dev/did/rdsk/d8
9 nodo2:/dev/rdsk/c10t60060480000290101637533030353532d0 /dev/did/rdsk/d9
9 nodo1:/dev/rdsk/c2t60060480000290101637533030353532d0 /dev/did/rdsk/d9
10 nodo2:/dev/rdsk/c10t60060480000290101637533031393430d0 /dev/did/rdsk/d10
11 nodo2:/dev/rdsk/c10t60060480000290101637533031393246d0 /dev/did/rdsk/d11
11 nodo1:/dev/rdsk/c2t60060480000290101637533031393246d0 /dev/did/rdsk/d11
12 nodo2:/dev/rdsk/c8t5006048452A66157d0 /dev/did/rdsk/d12
12 nodo2:/dev/rdsk/c6t5006048452A66168d0 /dev/did/rdsk/d12
12 nodo1:/dev/rdsk/c4t5006048C52A66147d0 /dev/did/rdsk/d12
12 nodo1:/dev/rdsk/c6t5006048C52A66168d0 /dev/did/rdsk/d12
13 nodo2:/dev/rdsk/c10t60060480000290101637533031393335d0 /dev/did/rdsk/d13
13 nodo1:/dev/rdsk/c2t60060480000290101637533031393335d0 /dev/did/rdsk/d13
14 nodo2:/dev/rdsk/c0t10d0 /dev/did/rdsk/d14
15 nodo2:/dev/rdsk/c0t11d0 /dev/did/rdsk/d15
16 nodo1:/dev/rdsk/c0t8d0 /dev/did/rdsk/d16
17 nodo1:/dev/rdsk/c0t9d0 /dev/did/rdsk/d17
18 nodo1:/dev/rdsk/c0t10d0 /dev/did/rdsk/d18
19 nodo1:/dev/rdsk/c0t11d0 /dev/did/rdsk/d19
20 nodo1:/dev/rdsk/c2t60060480000290101637533031393342d0 /dev/did/rdsk/d20
8191 nodo2:/dev/rmt/0 /dev/did/rmt/1

nodo1 # clsetup
>>> Initial Cluster Setup <<<
This program has detected that the cluster "installmode" attribute is
still enabled. As such, certain initial cluster setup steps will be
performed at this time. This includes adding any necessary quorum
devices, then resetting both the quorum vote counts and the
"installmode" property.
Please do not proceed if any additional nodes have yet to join the
cluster.
Is it okay to continue (yes/no) [yes]? yes
Do you want to add any quorum devices (yes/no) [yes]? yes
Following are supported Quorum Devices types in Sun Cluster. Please
refer to Sun Cluster documentation for detailed information on these
supported quorum device topologies.

What is the type of device you want to use?
1) Directly attached shared disk
2) Network Attached Storage (NAS) from Network Appliance
3) Quorum Server
q) Return to the quorum menu

Option: 1
>>> Add a SCSI Quorum Disk <<<
A SCSI quorum device is considered to be any Sun Cluster supported
attached storage which connected to two or more nodes of the cluster.
Dual-ported SCSI-2 disks may be used as quorum devices in two-node
clusters. However, clusters with more than two nodes require that
SCSI-3 PGR disks be used for all disks with more than two node-to-disk
paths.
You can use a disk containing user data or one that is a member of a
device group as a quorum device.
For more information on supported quorum device topologies, see the
Sun Cluster documentation.
Is it okay to continue (yes/no) [yes]? yes
Which global device do you want to use (d)? d3
Is it okay to proceed with the update (yes/no) [yes]? yes

clquorum add d3

Command completed successfully.

Press Enter to continue:
Do you want to add another quorum device (yes/no) [yes]? no
Once the "installmode" property has been reset, this program will skip
"Initial Cluster Setup" each time it is run again in the future.
However, quorum devices can always be added to the cluster using the
regular menu options. Resetting this property fully activates quorum
settings and is necessary for the normal and safe operation of the cluster.
Is it okay to reset "installmode" (yes/no) [yes]? yes
clquorum reset
claccess deny-all
Cluster initialization is complete.

Type ENTER to proceed to the main menu:

*** Main Menu ***
Please select from one of the following options:

1) Quorum
2) Resource groups
3) Data Services
4) Cluster interconnect
5) Device groups and volumes
6) Private hostnames
7) New nodes
8) Other cluster tasks
?) Help with menu options
q) Quit

Option: q


Habilitar el reboot automático de los nodos, si TODOS (ALL) los monitores Path de Discos Fallan.




nodo1 # clnode set -p reboot_on_path_failure=enable nodo1 nodo2

Deshabilitar el monitoreo en todos los discos locales.



nodo1 # cldev status

Cluster DID Devices ===

Device Instance Node Status
--------------- ---- ------
/dev/did/rdsk/d1 nodo2 Ok
/dev/did/rdsk/d10 nodo2 Ok
/dev/did/rdsk/d11 nodo2 Ok
nodo1 Ok
/dev/did/rdsk/d12 nodo2 Ok
nodo1 Ok
/dev/did/rdsk/d13 nodo2 Ok
nodo1 Ok
/dev/did/rdsk/d14 nodo2 Ok
/dev/did/rdsk/d15 nodo2 Ok
/dev/did/rdsk/d16 nodo1 Ok
/dev/did/rdsk/d17 nodo1 Ok
/dev/did/rdsk/d18 nodo1 Ok
/dev/did/rdsk/d19 nodo1 Ok
/dev/did/rdsk/d2 nodo2 Ok
/dev/did/rdsk/d20 nodo1 Ok
/dev/did/rdsk/d3 nodo2 Ok
nodo1 Ok
/dev/did/rdsk/d4 nodo2 Ok
nodo1 Ok
/dev/did/rdsk/d5 nodo2 Ok
nodo1 Ok
/dev/did/rdsk/d6 nodo2 Ok
nodo1 Ok
/dev/did/rdsk/d7 nodo2 Ok
nodo1 Ok
/dev/did/rdsk/d8 nodo2 Ok
nodo1 Ok
/dev/did/rdsk/d9 nodo2 Ok
nodo1 Ok

nodo1 # didadm -L
1 nodo2:/dev/rdsk/c0t8d0 /dev/did/rdsk/d1
2 nodo2:/dev/rdsk/c0t9d0 /dev/did/rdsk/d2
3 nodo2:/dev/rdsk/c10t60060480000290101637533030353533d0 /dev/did/rdsk/d3
3 nodo1:/dev/rdsk/c2t60060480000290101637533030353533d0 /dev/did/rdsk/d3
4 nodo2:/dev/rdsk/c10t60060480000290101637533030344544d0 /dev/did/rdsk/d4
4 nodo1:/dev/rdsk/c2t60060480000290101637533030344544d0 /dev/did/rdsk/d4
5 nodo2:/dev/rdsk/c10t60060480000290101637533030344435d0 /dev/did/rdsk/d5
5 nodo1:/dev/rdsk/c2t60060480000290101637533030344435d0 /dev/did/rdsk/d5
6 nodo2:/dev/rdsk/c10t60060480000290101637533030344537d0 /dev/did/rdsk/d6
6 nodo1:/dev/rdsk/c2t60060480000290101637533030344537d0 /dev/did/rdsk/d6
7 nodo2:/dev/rdsk/c10t60060480000290101637533030344442d0 /dev/did/rdsk/d7
7 nodo1:/dev/rdsk/c2t60060480000290101637533030344442d0 /dev/did/rdsk/d7
8 nodo2:/dev/rdsk/c10t60060480000290101637533030344531d0 /dev/did/rdsk/d8
8 nodo1:/dev/rdsk/c2t60060480000290101637533030344531d0 /dev/did/rdsk/d8
9 nodo2:/dev/rdsk/c10t60060480000290101637533030353532d0 /dev/did/rdsk/d9
9 nodo1:/dev/rdsk/c2t60060480000290101637533030353532d0 /dev/did/rdsk/d9
10 nodo2:/dev/rdsk/c10t60060480000290101637533031393430d0 /dev/did/rdsk/d10
11 nodo2:/dev/rdsk/c10t60060480000290101637533031393246d0 /dev/did/rdsk/d11
11 nodo1:/dev/rdsk/c2t60060480000290101637533031393246d0 /dev/did/rdsk/d11
12 nodo2:/dev/rdsk/c8t5006048452A66157d0 /dev/did/rdsk/d12
12 nodo2:/dev/rdsk/c6t5006048452A66168d0 /dev/did/rdsk/d12
12 nodo1:/dev/rdsk/c4t5006048C52A66147d0 /dev/did/rdsk/d12
12 nodo1:/dev/rdsk/c6t5006048C52A66168d0 /dev/did/rdsk/d12
13 nodo2:/dev/rdsk/c10t60060480000290101637533031393335d0 /dev/did/rdsk/d13
13 nodo1:/dev/rdsk/c2t60060480000290101637533031393335d0 /dev/did/rdsk/d13
14 nodo2:/dev/rdsk/c0t10d0 /dev/did/rdsk/d14
15 nodo2:/dev/rdsk/c0t11d0 /dev/did/rdsk/d15
16 nodo1:/dev/rdsk/c0t8d0 /dev/did/rdsk/d16
17 nodo1:/dev/rdsk/c0t9d0 /dev/did/rdsk/d17
18 nodo1:/dev/rdsk/c0t10d0 /dev/did/rdsk/d18
19 nodo1:/dev/rdsk/c0t11d0 /dev/did/rdsk/d19
20 nodo1:/dev/rdsk/c2t60060480000290101637533031393342d0 /dev/did/rdsk/d20
8191 nodo2:/dev/rmt/0 /dev/did/rmt/1

nodo1 # cldev unmonitor d1

nodo1 # cldev unmonitor d2

nodo1 # cldev unmonitor d14

nodo1 # cldev unmonitor d15

nodo1 # cldev unmonitor d16

nodo1 # cldev unmonitor d17

nodo1 # cldev unmonitor d18

nodo1 # cldev unmonitor d19


Verificar que se dejo de monitorear los discos locales, ejecutar cldev show o scdpm-p
all:all
.




nodo1 # clnode show
Cluster Nodes ===
Node Name: nodo2
Node ID: 1
Enabled: yes
privatehostname: clusternode1-priv
reboot_on_path_failure: enabled
globalzoneshares: 1
defaultpsetmin: 1
quorum_vote: 1
quorum_defaultvote: 1
quorum_resv_key: 0x48221C3C00000001
Transport Adapter List: ce1, ce3

Node Name: nodo1
Node ID: 2
Enabled: yes
privatehostname: clusternode2-priv
reboot_on_path_failure: enabled
globalzoneshares: 1
defaultpsetmin: 1
quorum_vote: 1
quorum_defaultvote: 1
quorum_resv_key: 0x48221C3C00000002
Transport Adapter List: ce1, ce3

nodo1 # scdpam -p all:all
nodo2:reboot_on_path_failure enabled
nodo2:/dev/did/rdsk/d1 Unmonitored
nodo2:/dev/did/rdsk/d2 Unmonitored
nodo2:/dev/did/rdsk/d3 Ok
nodo2:/dev/did/rdsk/d4 Ok
nodo2:/dev/did/rdsk/d5 Ok
nodo2:/dev/did/rdsk/d6 Ok
nodo2:/dev/did/rdsk/d7 Ok
nodo2:/dev/did/rdsk/d8 Ok
nodo2:/dev/did/rdsk/d9 Ok
nodo2:/dev/did/rdsk/d10 Ok
nodo2:/dev/did/rdsk/d11 Ok
nodo2:/dev/did/rdsk/d12 Ok
nodo2:/dev/did/rdsk/d13 Ok
nodo2:/dev/did/rdsk/d14 Unmonitored
nodo2:/dev/did/rdsk/d15 Unmonitored
nodo1:reboot_on_path_failure enabled
nodo1:/dev/did/rdsk/d16 Unmonitored
nodo1:/dev/did/rdsk/d17 Unmonitored
nodo1:/dev/did/rdsk/d18 Unmonitored
nodo1:/dev/did/rdsk/d19 Unmonitored
nodo1:/dev/did/rdsk/d20 Ok
nodo1:/dev/did/rdsk/d3 Ok
nodo1:/dev/did/rdsk/d4 Ok
nodo1:/dev/did/rdsk/d5 Ok
nodo1:/dev/did/rdsk/d6 Ok
nodo1:/dev/did/rdsk/d7 Ok
nodo1:/dev/did/rdsk/d8 Ok
nodo1:/dev/did/rdsk/d9 Ok
nodo1:/dev/did/rdsk/d11 Ok
nodo1:/dev/did/rdsk/d12 Ok
nodo1:/dev/did/rdsk/d13 Ok


Para ejecutar solo en Solaris 10, si no esta instalado el paquete SUNWescom, siga estos pasos.



Deshabilitar el servicio scsymon.



nodo1 # svcadm -v disable \
system/var/system/var/cluster/scsymon-srv

svc:/system/cluster/scsymon-srv:default disabled.

Borrar la linea $SVCADM enable svc:/system/cluster/scsymon-srv:default en el archivo

/usr/cluster/lib/svc/method/svc_cl_enable.


Tambien borrar la linea svc:/system/cluster/scsymon-srv:default" en el archivo
/usr/cluster/lib/svc/method/svc_boot_check.


Hay unas comillas (") en el final de la linea svc:/system/cluster/scsymon-srv:default". Muevelas a la linea anterior.



nodo1 # cd /usr/cluster/lib/svc/method
nodo1 # vi svc_cl_svc_enable
"svc_cl_svc_enable" [Read only] 80 lines, 2154 characters
#!/sbin/sh
#
"svc_cl_svc_enable" [Read only] 80 lines, 2154 characters
nodo1 # vi svc_boot_check
"svc_boot_check" [Read only] 203 lines, 6284 characters
#!/bin/sh
#
svc:/system/cluster/sc_svtag:default
svc:/system/cluster/scsymon-srv:default"
:wq! "svc_boot_check" 203 lines, 6288 characters

nodo1 # scshutdown -y -g0


Si necesito modificar el archivo infrastructure a mano, entonces tengo que bootear por fuera del cluster con la opción -x y correr un ccradm y finalmente
rebootear.



{181} ok boot -x

root@nodo1 # /usr/cluster/lib/sc/ccradm -i \
/etc/cluster/ccr/infrastructure -o


nodo1 # init 6
nodo1 # clinterconnect status
Cluster Transport Paths ===
Endpoint1 Endpoint2 Status
--------- --------- ------
nodo2:ce3 nodo1:ce3 Path online
nodo2:ce1 nodo1:ce1 Path online

Pasos para mirrorear disco de booteo



Inicializar el disco de mirror:



vxdisksetup -i c0t11d0 format=sliced

Agregar el disco al diskgroup.




vxdg -g rootdg adddisk rootmirror=c0t11d0s2

Mirrorear el disco.



vxmirror -g rootdg rootdisk rootmirror

Crear un diskgroup local con sus respectivos volumenes.



vxdisksetup -i Disk_5
vxdg init localdg localdg01=Disk_5
vxassist -g localdg make vol01 2g localdg01
newfs /dev/vx/rdsk/localdg01/vol01

Pasos para configurar cluster con Oracle RAC


Oracle RAC solo esta soportado en zonas globales.



En caso de que la versión de Oracle sea la 10g, se debera
instalar primero el Oracle CRS.



Chequear que esten instaladas las licencias de CVM en el caso de tener VxVM.



vxlicrep y vxlicinst

Crear el grupo y usuario para Oracle.



groupadd -g 1000 dba
groupadd -g 1001 oinstall
useradd -u 1000 -g 1000 -G 1001 -c "oracle DBA" -m -d \
/export/home/oracle -s /usr/bin/ksh oracle
chown oracle:dba /export/home/oracle
passwd oracle

Instalar los servicios de RAC en ambos nodos. Es necesario tener instalado:




SUNWscucmd
SUNWudlm
SUNWudlmr

Para SVM se necesita SUNWscmd.


Para CVM se necesita SUNWcvm,
SUNWcvmr
.


Tambien el SUNscor es necesario para que el wizard de los data service funcione correctamente.



Instalar el paquete UDLM de Oracle.





pkgadd -d .ORCLudlm

Agregar en el /etc/system,
los parámetros recomendado para Oracle RAC.



set semsys:seminfo_semmni=100
set semsys:seminfo_semmns=1024
set semsys:seminfo_semmsl=256
set semsys:seminfo_semvmx=32767
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10

Luego reboot del equipo.



Cuidado: Cambiar el port 6000 que viene seteado por default en el /opt/SUNWudlm/etc/udlm.conf, porque puede traer conflictos con el port del sshd.


Una opción valida es el port 7000. Esto hacerlo cuando no este ejecutandose el dlm.


Crear RGM para el Oracle RAC DataService.




clrt register SUNW.rac_framework
cltr register SUNW.rac_udlm

clrg create -n nodo1,nodo2 -p maximum_primaries=2 -p desired_primaries=2 -p rg_mode=Scalable rac-framework-rg
clrs create -g rac-framework-rg -t SUNW.rac_framework-rg rac-framework-rs
clrs create -g rac-framework-rg -t SUNW.rac_udlm -p port=7000 -p resource_dependencies=rac-framework-rs rac-udlm-rs
clrs create -g rac-framework-rg -t SUNW.rac_svm -p resource_dependencies=rac-framework-rs rac-svm-rs

Poner el recurso online.


clrg online -emM rac-framework-rg


Pasos para Crear Raw Devices para Oracle RAC.



vxassist -g racdg -U gen make ocr1 1g
vxedit -g racdg set user=oracle group=dba ocr1

Crear el Resource Group Scalable.




clrg create -n nodo1,nodo2 -p Desired_primaries=2 -p Maximum_primaries=2 -p RG_affinities=++rac-framework-rg RG_mode=Scalable scal-racdg-rg

clrt register SUNW.ScalDeviceGroup
clrs create -g scal-racdg-rg -t SUNW.ScalDeviceGroup -p Resource_dependencies=rac-cvm-rs -p DiskGroupName=racdg scal-racdg-rs
clrg online -emM scal-racdg-rg

Crear el recurso CRS.



clrt register SUNW.crs_framework
clrs create -g rac-framework-rg -t SUNW.crs_framework -p Resource_dependencies=rac-framework-rs -p Resource_dependencies_offline_restart{local_node} crs_framework-rs

Resource_dependencies_offline_restart
es necesario, solo si esta creado un resource group Scalable.




Crear un Proxy resource group para el Oracle RAC.


Si no se usa un device group Scalable, hay que remover las dependencias a el.



clrg create -n nodo1,nodo2 -p Maximum_primaries=2 -p Desired_primaries=2 -p RG_mode=Scalable -p RG_affinities=++rac-framework-rg,++ scal-racdg-rg rac-proxy-rg

clrt register SUNW.scalable_rac_server_proxy

clrs create -g rac-proxy-rg -t SUNW.scalable_rac_server_proxy

clrs create -g rac-proxy-rg -t SUNW.scalable_rac_server_proxy -p ORACLE_HOME=/oracle/product/10.2.0.2/db -p CRS_HOME=/oracle/product/10.2.0.2/crs -p DB_NAME=SUNPR -p ORACLE_SID{nodo1}=SUNPR1 -p ORACLE_SID{nodo2}=SUNPR2 -p Resource_dependencies=rac-framework-rs -p Resource_dependencies_offline_restart=scal-rac-rs,crs_framework-rs rac-proxy-rs

clrg online -emM rac-proxy-rg


 




martedì 13 gennaio 2009

Oracle RAC: Checking RAC status with SQL/OS level statements

By Tarry Singh

Brief intro

Our last article was about monitoring RAC, which we will get back to in upcoming articles. Monitoring can be a daunting task for a DBA but fortunately, the EM console is a good place to start. There are vendors that deliver products to monitor RAC--we did a 3-part article reviewing the beta product from Quest software called SoRAC or Spotlight on RAC. They are good graphical tools but when it comes to recovering the scenarios like voting disks, crs files and other scenarios you need more than just that.

In this article, we will attempt to run typical scripts to check the status of our RAC nodes. We will also do a quick run on the liveliness of the cluster and then go on to run our typical scripts to see the status of our datafiles. Let us start by checking the status of our RAC on ESX 3.0.1 Server.

Doing quicks checks to check the livliness of the RAC

We have gone through this command several times. It resides under the 4ORACLE_HOME/CRS/bin directory and there are several commands to perform various tasks, such as displaying individual resource and starting and stopping those resources. Anyhow, do the crs --help to get a complete list of each command.

[oracle@vm02 bin]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.esxrac.db application ONLINE ONLINE vm02
ora....c1.inst application ONLINE ONLINE vm01
ora....c2.inst application ONLINE ONLINE vm02
ora....serv.cs application ONLINE ONLINE vm02
ora....ac1.srv application ONLINE ONLINE vm01
ora....ac2.srv application ONLINE ONLINE vm02
ora....SM1.asm application ONLINE ONLINE vm01
ora....01.lsnr application ONLINE ONLINE vm01
ora.vm01.gsd application ONLINE ONLINE vm01
ora.vm01.ons application ONLINE ONLINE vm01
ora.vm01.vip application ONLINE ONLINE vm01
ora....SM2.asm application ONLINE ONLINE vm02
ora....02.lsnr application ONLINE ONLINE vm02
ora.vm02.gsd application ONLINE ONLINE vm02
ora.vm02.ons application ONLINE ONLINE vm02
ora.vm02.vip application ONLINE ONLINE vm02

By checking the status of individual nodes and all the necessary applications, we can see that the VIP, GSD, Listener and the ONS daemons are alive.

[oracle@vm02 bin]$ srvctl status nodeapps -n vm01
VIP is running on node: vm01
GSD is running on node: vm01
Listener is running on node: vm01
ONS daemon is running on node: vm01
[oracle@vm02 bin]$ srvctl status nodeapps -n vm02
VIP is running on node: vm02
GSD is running on node: vm02
Listener is running on node: vm02
ONS daemon is running on node: vm02

Now checking the status of the ASM on both nodes...

[oracle@vm02 bin]$ srvctl status asm -n vm01
ASM instance +ASM1 is running on node vm01.
[oracle@vm02 bin]$ srvctl status asm -n vm02
ASM instance +ASM2 is running on node vm02.

What about the database status?

 [oracle@vm02 bin]$ srvctl status database -d esxrac
Instance esxrac1 is running on node vm01
Instance esxrac2 is running on node vm02

What would be the status of the service that we created at the end of the database installation?

[oracle@vm02 bin]$ srvctl status service -d esxrac
Service fokeserv is running on instance(s) esxrac2, esxrac1

Cluster Status

[oracle@vm02 bin]$ crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[oracle@vm02 bin]$ ssh vm01
The authenticity of host 'vm01 (172.22.107.25)' can't be established.
RSA key fingerprint is c0:0c:75:15:9a:e5:fc:69:5c:0c:e5:c8:94:00:52:c4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'vm01,172.22.107.25' (RSA) to the list of known hosts.
Enter passphrase for key '/u01/app/oracle/.ssh/id_rsa':
Last login: Fri May 4 12:56:08 2007 from 172.22.206.62
[oracle@vm01 ~]$ crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[oracle@vm01 ~]$ exit
logout
Connection to vm01 closed.
[oracle@vm02 bin]$

Querying the RAC

SQL*Plus: Release 10.2.0.1.0 - Production on Fri May 25 10:15:27 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Oracle Label Security, OLAP and Data Mining Scoring Engine options

Here we quickly query the gv$instance cluster view to get the instances, hostname, and status of our node apps.

SQL> select instance_name, host_name, archiver, thread#, status
2 from gv$instance
3 /
INSTANCE_NAME HOST_NAME ARCHIVE THREAD# STATUS
-------------- --------------------- ------- -------- ------
esxrac1 vm01.wolga.nl STARTED 1 OPEN
esxrac2 vm02.wolga.nl STARTED 2 OPEN

Checking the SGA (System Global Area) on one of the nodes (Note: Both nodes have identical setup).

SQL> show sga
Total System Global Area 608174080 bytes
Fixed Size 1220820 bytes
Variable Size 142610220 bytes
Database Buffers 457179136 bytes
Redo Buffers 7163904 bytes

Getting a list of all our datafiles...

SQL> select file_name, bytes/1024/1024
2 from dba_data_files
3 /
FILE_NAME BYTES/1024/1024
----------------------------------------------- ---------------
+ORADATA/esxrac/datafile/system.259.620732719 500
+ORADATA/esxrac/datafile/undotbs1.260.620732753 200
+ORADATA/esxrac/datafile/sysaux.261.620732767 670
+ORADATA/esxrac/datafile/example.263.620732791 150
+ORADATA/esxrac/datafile/undotbs2.264.620732801 200
+ORADATA/esxrac/datafile/users.265.620732817 5
6 rows selected.

Getting the status of all the groups, type, membership (if any)...

SQL> select group#, type, member, is_recovery_dest_file
2 from v$logfile
3 order by group#
4 /
GROUP# TYPE MEMBER IS_
------ ------- --------------------------------------------------- ---
1 ONLINE +ORADATA/esxrac/onlinelog/group_1.257.620732695 NO
1 ONLINE +FLASH_RECO_AREA/esxrac/onlinelog/group_1.257.620732699 YES
2 ONLINE +ORADATA/esxrac/onlinelog/group_2.258.620732703 NO
2 ONLINE +FLASH_RECO_AREA/esxrac/onlinelog/group_2.258.620732707 YES
3 ONLINE +ORADATA/esxrac/onlinelog/group_3.266.620737527 NO
3 ONLINE +FLASH_RECO_AREA/esxrac/onlinelog/group_3.259.620737533 YES
4 ONLINE +ORADATA/esxrac/onlinelog/group_4.267.620737535 NO
4 ONLINE +FLASH_RECO_AREA/esxrac/onlinelog/group_4.260.620737539 YES

Querying the v$asm_diskgroup view...

select group_number, name,allocation_unit_size alloc_unit_size,state,type,total_mb,usable_file_mb
from v$asm_diskgroup;
GROUP_NUMBER NAME ALLOC_UNIT_SIZE STATE TYPE TOTAL_MB USABLE_FILE_MB
------------ ------------------------------ --------------- ----------- ------ ---------- --------------
1 FLASH_RECO_AREA 1048576 CONNECTED EXTERN 10236 2781
2 ORADATA 1048576 CONNECTED NORMAL 20472 8132

Querying v$asm_disk for our volumes (remember the ones we created first on OS level with the asmlib) :

select name, path, header_status, total_mb free_mb, trunc(bytes_read/1024/1024) read_mb, trunc(bytes_written/1024/1024) write_mb
from v$asm_disk;
NAME PATH HEADER_STATU FREE_MB READ_MB WRITE_MB
----- ---------- ------------ ---------- ---------- ----------
VOL1 ORCL:VOL1 MEMBER 10236 39617 15816
VOL2 ORCL:VOL2 MEMBER 10236 7424 15816
VOL3 ORCL:VOL3 MEMBER 10236 1123 13059

All datafiles in one go:

SQL> select name from v$datafile
2 union
3 select name from v$controlfile
4 union
5 select name from v$tempfile
6 union
7 select member from v$logfile
8 /
NAME
--------------------------------------------------------------------------------
+FLASH_RECO_AREA/esxrac/controlfile/current.256.620732691
+FLASH_RECO_AREA/esxrac/onlinelog/group_1.257.620732699
+FLASH_RECO_AREA/esxrac/onlinelog/group_2.258.620732707
+FLASH_RECO_AREA/esxrac/onlinelog/group_3.259.620737533
+FLASH_RECO_AREA/esxrac/onlinelog/group_4.260.620737539
+ORADATA/esxrac/controlfile/current.256.620732689
+ORADATA/esxrac/datafile/example.263.620732791
+ORADATA/esxrac/datafile/sysaux.261.620732767
+ORADATA/esxrac/datafile/system.259.620732719
+ORADATA/esxrac/datafile/undotbs1.260.620732753
+ORADATA/esxrac/datafile/undotbs2.264.620732801
+ORADATA/esxrac/datafile/users.265.620732817
+ORADATA/esxrac/onlinelog/group_1.257.620732695
+ORADATA/esxrac/onlinelog/group_2.258.620732703
+ORADATA/esxrac/onlinelog/group_3.266.620737527
+ORADATA/esxrac/onlinelog/group_4.267.620737535
+ORADATA/esxrac/tempfile/temp.262.620732779
17 rows selected.

Listing all the tablespaces...

SQL> select tablespace_name, file_name
2 from dba_data_files
3 union
4 select tablespace_name, file_name
5 from dba_temp_files
6 /
TABLESPACE_NAME FILE_NAME
------------------ --------------------------------------------------------------------------------
EXAMPLE +ORADATA/esxrac/datafile/example.263.620732791
SYSAUX +ORADATA/esxrac/datafile/sysaux.261.620732767
SYSTEM +ORADATA/esxrac/datafile/system.259.620732719
TEMP +ORADATA/esxrac/tempfile/temp.262.620732779
UNDOTBS1 ` +ORADATA/esxrac/datafile/undotbs1.260.620732753
UNDOTBS2 +ORADATA/esxrac/datafile/undotbs2.264.620732801
USERS +ORADATA/esxrac/datafile/users.265.620732817
7 rows selected.

This script will give you information of the +ASM1 instance files:

SQL> select group_number, file_number, bytes/1024/1024/1024 GB, type, striped, modification_date
2 from v$asm_file
3 where TYPE != 'ARCHIVELOG'
4 /
GRP_NUM FILE_NUM GB TYPE STRIPE MODIFICAT
------- -------- -------- --------------- ------ ---------
1 256 .01 CONTROLFILE FINE 04-MAY-07
1 257 .05 ONLINELOG FINE 25-MAY-07
1 258 .05 ONLINELOG FINE 24-MAY-07
1 259 .05 ONLINELOG FINE 24-MAY-07
1 260 .05 ONLINELOG FINE 25-MAY-07
1 261 .00 PARAMETERFILE COARSE 24-MAY-07
2 256 .01 CONTROLFILE FINE 04-MAY-07
2 257 .05 ONLINELOG FINE 25-MAY-07
2 258 .05 ONLINELOG FINE 24-MAY-07
2 259 .49 DATAFILE COARSE 04-MAY-07
2 260 .20 DATAFILE COARSE 04-MAY-07
2 261 .65 DATAFILE COARSE 23-MAY-07
2 262 .03 TEMPFILE COARSE 04-MAY-07
2 263 .15 DATAFILE COARSE 04-MAY-07
2 264 .20 DATAFILE COARSE 04-MAY-07
2 265 .00 DATAFILE COARSE 04-MAY-07
2 266 .05 ONLINELOG FINE 24-MAY-07
2 267 .05 ONLINELOG FINE 25-MAY-07
18 rows selected.

More detailed information:

SQL> select group_number, file_number, compound_index, incarnation, block_size, bytes/1024/1024/1024 GB, type, striped,
2 creation_date, modification_date
3 from v$asm_file
4 where TYPE != 'ARCHIVELOG'
5 /
GRP_NUM FILE_NUM COMPOUND_INDEX INCARNATION BLOCK_SIZE GB TYPE STRIPE CREATION_ MODIFICAT
------- -------- -------------- ----------- ---------- -------- --------------- ------ --------- ---------
1 256 16777472 620732691 16384 .01 CONTROLFILE FINE 24-APR-07 04-MAY-07
1 257 16777473 620732699 512 .05 ONLINELOG FINE 24-APR-07 25-MAY-07
1 258 16777474 620732707 512 .05 ONLINELOG FINE 24-APR-07 24-MAY-07
1 259 16777475 620737533 512 .05 ONLINELOG FINE 24-APR-07 24-MAY-07
1 260 16777476 620737539 512 .05 ONLINELOG FINE 24-APR-07 25-MAY-07
1 261 16777477 620737547 512 .00 PARAMETERFILE COARSE 24-APR-07 24-MAY-07
2 256 33554688 620732689 16384 .01 CONTROLFILE FINE 24-APR-07 04-MAY-07
2 257 33554689 620732695 512 .05 ONLINELOG FINE 24-APR-07 25-MAY-07
2 258 33554690 620732703 512 .05 ONLINELOG FINE 24-APR-07 24-MAY-07
2 259 33554691 620732719 8192 .49 DATAFILE COARSE 24-APR-07 04-MAY-07
2 260 33554692 620732753 8192 .20 DATAFILE COARSE 24-APR-07 04-MAY-07
2 261 33554693 620732767 8192 .65 DATAFILE COARSE 24-APR-07 23-MAY-07
2 262 33554694 620732779 8192 .03 TEMPFILE COARSE 24-APR-07 04-MAY-07
2 263 33554695 620732791 8192 .15 DATAFILE COARSE 24-APR-07 04-MAY-07
2 264 33554696 620732801 8192 .20 DATAFILE COARSE 24-APR-07 04-MAY-07
2 265 33554697 620732817 8192 .00 DATAFILE COARSE 24-APR-07 04-MAY-07
2 266 33554698 620737527 512 .05 ONLINELOG FINE 24-APR-07 24-MAY-07
2 267 33554699 620737535 512 .05 ONLINELOG FINE 24-APR-07 25-MAY-07
18 rows selected.

Conclusion

You need more than a bunch of scripts to monitor your RAC database. Normally in most shops managing and monitoring the RAC from the DB console or even a grid console makes the task much easier. However, you can become a RAC expert if you can practice and play with your RAC with various scenarios. We will start playing with our RAC and attempt to simulate all kinds of crash scenarios. In addition, with 11G coming up we will try to migrate our RAC to 11G (whenever it is publicly available

giovedì 18 dicembre 2008

Data Pump Export (expdp) and Data Pump Import(impdp)

Oracle introduced Data Pump in Oracle Database 10g Release 1. This new oracle technology enables very high transfer of data from one database to another. The oracle Data Pump provides two utilities namely:
  • Data Pump Export which is invoked with the expdp command.
  • Data Pump Import which is invoked with the impdp command.

The above two utilities have similar look and feel with the pre-Oracle 10g import and export utilities (e.g., imp and exp, respectively) but are completely separate. Meaning dump files generated by the original export utility (exp) cannot be imported by the new data pump import utility (impdp) and vice-versa.
Data Pump Export (expdp) and Data Pump Import (impdp) are server-based rather than client-based as is the case for the original export (exp) and import (imp). Because of this, dump files, log files, and sql files are accessed relative to the server-based directory paths. Data Pump requires that directory objects mapped a file system directory be specified in the invocation of the data pump import or export.
It for this reason and for convenience that a directory object be created before using the data pump export or import utilities.
For example to create a directory object named expdp_dir located at /u01/backup/exports enter the following sql statement:
SQL> create directory expdp_dir as '/u01/backup/exports'
then grant read and write permissions to the users who will be performing the data pump export and import.
SQL> grant read,write on directory dpexp_dir to system, user1, user2, user3;
Invoking Data Pump Export
Full Export Mode You can invoke the data pump export using a command line. Export parameters can be specified directly in the command line. A full export is specified using the FULL parameter. In a full database export, the entire database is unloaded. This mode requires that you have the EXP_FULL_DATABASE role.Shown below is an example
$ expdp system/ DIRECTORY=exp_dir DUMPFILE=expfull.dmp FULL=y LOGFILE=expfull.og
Schema Export Mode The schema export mode is invoked using the SCHEMAS parameter. If you have no EXP_FULL_DATABASE role, you can only export your own schema. If you have EXP_FULL_DATABASE role, you can export several schemas in one go. Optionally, you can include the system privilege grants as well.
$ expdp hr/hr DIRECTORY=exp_dir DUMPFILE=schema_exp.dmp SCHEMAS=hr,sh,oe

Table Export Mode This export mode is specified using the TABLES parameter. In this mode, only the specified tables, partitions and their dependents are exported. If you do not have the EXP_FULL_DATABASE role, you can export only tables in your own schema. You can only specify tables in the same schema.
$ expdp hr/hr DIRECTORY=exp_dir DUMPFILE=tables_exp.dmp TABLES=employees,jobs,departments

Invoking Data Pump Import The data pump import can be invoked in the command line. The export parameters can be specified directly in the command line.
Full Import Mode The full import mode loads the entire contents of the source (export) dump file to the target database. However, you must have been granted the IMP_FULL_DATABASE role on the target database. The data pump import is invoked using the impdp command in the command line with the FULL parameter specified in the same command line.
$ impdp system/ DIRECTORY=exp_dir DUMPFILE=expfull.dmp FULL=y LOGFILE=impfull.og
Schema Import Mode The schema import mode is invoked using the SCHEMAS parameter. Only the contents of the specified schemas are load into the target database. The source dump file can be a full, schema-mode, table, or tablespace mode export files. If you have a IMP_FULL_DATABASE role, you can specify a list of schemas to load into the target database.
$ impdp hr/hr DIRECTORY=exp_dir DUMPFILE=expfull.dmp SCHEMAS=hr,sh,oe

Table Import Mode This export mode is specified using the TABLES parameter. In this mode, only the specified tables, partitions and their dependents are exported. If you do not have the EXP_FULL_DATABASE role, you can import only tables in your own schema.
$ impdp hr/hr DIRECTORY=exp_dir DUMPFILE=expfull.dmp TABLES=employees,jobs,departments

mercoledì 17 dicembre 2008

How to Enable Oracle VM 2.1.2 High Availability (HA) on an Existing Server Pool using NFS Storage

In this Document
Goal
Solution
References


Applies to:

Oracle VM - Version: 2.1.2 to 2.1.2
Information in this document applies to any platform.

Goal

How to implement a High Availability (HA) fail over for an existing server pool in Oracle VM 2.1.2 using NFS. This configuration also uses ocfs2 clustering technologies (nfs + dmnfs + ocfs2 hb).

Solution

This NFS HA is using two Oracle 2.1.2 VM servers already part of a server pool (vm_pool_master.us.oracle.com, vm_pool.us.oracle.com) and one NFS server (nfs-lin.us.oracle.com).

Note: This setup has already pre-configured the ocfs2 cluster.conf and is not running iptables on both nodes.

Disabled iptables:
#/etc/init.d/iptables off ; iptables -F ; chkconfig --level 345 iptables off

Pre-configured ocfs2 cluster.conf:
http://oss.oracle.com/projects/ocfs2/dist/documentation/v1.2/ocfs2_faq.html#CONFIGURE

The servers where already part of a server pool, and confirmed live migrations where a success within VM Manager.


There is already a shared cluster root at /OVS using NFS, and not local.
[root@vm_pool_master /]# uname -a
Linux vm_pool_master 2.6.18-8.1.15.1.16.el5xen #1 SMP Fri Aug 1 18:27:30 EDT 2008 i686 i686 i386 GNU/Linux
[root@vm_pool_master /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 3.0G 2.1G 696M 76% /
/dev/sda1 99M 40M 55M 43% /boot
tmpfs 257M 0 257M 0% /dev/shm
nfs-lin.us.oracle.com:/OVS
228G 179G 37G 83% /OVS

[root@vm_pool_master /]#
[root@vm_pool_master /]# ls -al /OVS
total 20
drwxr-xr-x 5 root root 4096 Sep 30 16:22 .
drwxr-xr-x 30 root root 4096 Sep 30 15:36 ..
drwxr-xr-x 2 root root 4096 Sep 30 16:12 iso_pool
drwxr-xr-x 2 root root 4096 Sep 30 16:12 running_pool
drwxr-xr-x 2 root root 4096 Sep 30 16:12 seed_pool
[root@vm_pool_master /]#



[root@vm_pool /]# uname -a
Linux vm_pool 2.6.18-8.1.15.1.16.el5xen #1 SMP Fri Aug 1 18:27:30 EDT 2008 i686 i686 i386 GNU/Linux
[root@vm_pool /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 3.0G 825M 2.0G 30% /
/dev/sda1 99M 44M 51M 47% /boot
tmpfs 272M 0 272M 0% /dev/shm
nfs-lin.us.oracle.com:/OVS
228G 179G 37G 83% /OVS

[root@vm_pool /]#
[root@vm_pool /]# ls -al /OVS
total 20
drwxr-xr-x 5 root root 4096 Sep 30 16:22 .
drwxr-xr-x 30 root root 4096 Sep 30 15:36 ..
drwxr-xr-x 2 root root 4096 Sep 30 16:12 iso_pool
drwxr-xr-x 2 root root 4096 Sep 30 16:12 running_pool
drwxr-xr-x 2 root root 4096 Sep 30 16:12 seed_pool
[root@vm_pool /]#



1. From VM Server pool master to setup ocfs2, this script
# /usr/lib/ovs/ovs-cluster-configure
generates the /etc/ocfs2/cluster.conf file if it does not already exist and configures and starts the o2cb service. Here we pre-configure ocfs2 cluster.conf:
[root@vm_pool_master /]#
[root@vm_pool_master /]# cat /etc/ocfs2/cluster.conf
node:
ip_port = 7777
ip_address = 10.1.1.10
number = 0
name = vm_pool_master
cluster = ocfs2

node:
ip_port = 7777
ip_address = 10.1.1.11
number = 1
name = vm_pool
cluster = ocfs2

cluster:
node_count = 2
name = ocfs2
[root@vm_pool_master /]#
[root@vm_pool_master /]# /etc/init.d/o2cb configure
Configuring the O2CB driver.

This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot. The current values will be shown in brackets ('[]'). Hitting
without typing an answer will keep that current value. Ctrl-C
will abort.

Load O2CB driver on boot (y/n) [n]: y
Cluster to start on boot (Enter "none" to clear) [ocfs2]:
Specify heartbeat dead threshold (>=7) [31]:
Specify network idle timeout in ms (>=5000) [30000]:
Specify network keepalive delay in ms (>=1000) [2000]:
Specify network reconnect delay in ms (>=2000) [2000]:
Writing O2CB configuration: OK
Loading module "configfs": OK
Mounting configfs filesystem at /config: OK
Loading module "ocfs2_nodemanager": OK
Loading module "ocfs2_dlm": OK
Loading module "ocfs2_dlmfs": OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
Starting O2CB cluster ocfs2: OK
[root@vm_pool_master /]#
[root@vm_pool_master /]#
[root@vm_pool_master /]# /etc/init.d/o2cb status
Module "configfs": Loaded
Filesystem "configfs": Mounted
Module "ocfs2_nodemanager": Loaded
Module "ocfs2_dlm": Loaded
Module "ocfs2_dlmfs": Loaded
Filesystem "ocfs2_dlmfs": Mounted
Checking O2CB cluster ocfs2: Online
Heartbeat dead threshold: 31
Network idle timeout: 30000
Network keepalive delay: 2000
Network reconnect delay: 2000
Checking O2CB heartbeat: Not active
[root@vm_pool_master /]#
[root@vm_pool_master /]#
[root@vm_pool_master /]# /usr/lib/ovs/ovs-cluster-configure
O2CB cluster ocfs2 already online
[root@vm_pool_master /]#


2. On the VM Server Pool Master, configure the shared storage with
# /usr/lib/ovs/ovs-makerepo source C description. 
This creates a .ovsrepo file in the NFS mounted /OVS, and updates /etc/ovs/repositories file :
[root@vm_pool_master /]# /usr/lib/ovs/ovs-makerepo nfs-lin.us.oracle.com:/OVS C "ha for prod_pool"
Initializing NEW repository nfs-lin.us.oracle.com:/OVS
Updating local repository list.
ovs-makerepo complete
[root@vm_pool_master /]#
[root@vm_pool_master /]#
[root@vm_pool_master /]# more /OVS/.ovsrepo
OVS_REPO_UUID=05B0CE2EFE9C4842A2EFA39926657236
OVS_REPO_SHARED=1
OVS_REPO_DESCRIPTION=ha for prod_pool
OVS_REPO_VERSION=1
[root@vm_pool_master /]#
[root@vm_pool_master /]# cat /etc/ovs/repositories
# This configuration file was generated by ovs-makerepo
# DO NOT EDIT
[root@vm_pool_master /]#


3. On the VM Server Pool Master, check the cluster has been configured correctly and is running:
# /usr/lib/ovs/ovs-cluster-check --master --alter-fstab
where
--master parameter should only be used on the Server Pool Master.
--alter-fstab parameter modifies the /etc/fstab file.

A backup of the original /etc/fstab file is created in /tmp.

This also creates a .server_pool_hb file on your /OVS mount along with removing any mounts in your /etc/fstab file for /OVS as now all the mounting of this will be done from the /etc/ovs/repositories file.:

[root@vm_pool_master /]# /usr/lib/ovs/ovs-cluster-check --master --alter-fstab
O2CB cluster ocfs2 already online
300+0 records in
300+0 records out
314572800 bytes (315 MB) copied, 169.856 seconds, 1.9 MB/s
mkfs.ocfs2 1.2.7
Filesystem label=server_pool_hb
Block size=2048 (bits=11)
Cluster size=4096 (bits=12)
Volume size=314572800 (76800 clusters) (153600 blocks)
5 cluster groups (tail covers 13312 clusters, rest cover 15872 clusters)
Journal size=8388608
Initial number of node slots: 32
Creating bitmaps: done
Initializing superblock: done
Writing system files: done
Writing superblock: done
Writing backup superblock: 0 block(s)
Formatting Journals: done
Writing lost+found: done
mkfs.ocfs2 successful

Cluster setup complete.
[root@vm_pool_master /]#
[root@vm_pool_master /]#
[root@vm_pool_master /]# ls -al /OVS
total 307528
drwxr-xr-x 5 root root 4096 Sep 30 16:22 .
drwxr-xr-x 30 root root 4096 Sep 30 15:36 ..
drwxr-xr-x 2 root root 4096 Sep 30 16:12 iso_pool
-rw-r--r-- 1 root root 122 Sep 30 16:12 .ovsrepo
drwxr-xr-x 2 root root 4096 Sep 30 16:12 running_pool
drwxr-xr-x 2 root root 4096 Sep 30 16:12 seed_pool
-rw-r--r-- 1 root root 314572800 Sep 30 16:54 .server_pool_hb
[root@vm_pool_master /]#



4. Log into you VM Manager to check and enable the HA feature.

Under Server Pools Tab -> Edit your Server Pool you will see:
"High Availability Infrastructure: Check"
Click on Check button, you should see:
All the servers should share the same storage.
High Availability configuration should be correctly setup.
Now you can enable HA.
Checking the box "Enable High Availability: " and then Apply. Which should return:
The Server pool updated successfully.
In the VM Manager you should now see under the "High Availability Status" column Enabled for the Pool in the "Server Pools" tab.


5. The second VM server will show /etc/ovs/repositories and /etc/ocfs2/cluster.conf matching that of the VM Server pool master. The /OVS mount, must be maintained in the /etc/ovs/repositories file.
Confirm no /OVS mount is in /etc/fstab, a backup should be in the /tmp directory:
[root@vm_pool /]#
[root@vm_pool /]#
[root@vm_pool /]# cat /etc/ocfs2/cluster.conf
node:
ip_port = 7777
ip_address = 10.1.1.10
number = 0
name = vm_pool_master
cluster = ocfs2

node:
ip_port = 7777
ip_address = 10.1.1.11
number = 1
name = vm_pool
cluster = ocfs2

cluster:
node_count = 2
name = ocfs2
[root@vm_pool /]#
[root@vm_pool /]# more /etc/ovs/repositories
# This configuration file was generated by ovs-makerepo
# DO NOT EDIT
[root@vm_pool /]#
[root@vm_pool /]# more /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
LABEL=SWAP-sda5 swap swap defaults 0 0
#
[root@vm_pool /]#
[root@vm_pool /]# diff /etc/fstab /tmp/fstab.vzJsGq3831
9a10
> nfs-lin.us.oracle.com:/OVS /OVS nfs rw,bg,intr,hard,timeo=600,wsize=32768,rsize=32768,nfsvers=3,tcp 0 0
[root@vm_pool /]#


6. Confirm ocfs2 is loaded and set to start on boot along with the repositories on both VM servers.:
[root@vm_pool /]# /etc/init.d/o2cb status
Module "configfs": Loaded
Filesystem "configfs": Mounted
Module "ocfs2_nodemanager": Loaded
Module "ocfs2_dlm": Loaded
Module "ocfs2_dlmfs": Loaded
Filesystem "ocfs2_dlmfs": Mounted
Checking O2CB cluster ocfs2: Online
Heartbeat dead threshold: 31
Network idle timeout: 30000
Network keepalive delay: 2000
Network reconnect delay: 2000
Checking O2CB heartbeat: Active
[root@vm_pool /]#
[root@vm_pool /]# chkconfig --list | egrep "ocfs2|ovs"
ocfs2 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ovs-agent 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ovsrepositories 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@vm_pool /]#
[root@vm_pool /]# ls -al /OVS
total 307528
drwxr-xr-x 5 root root 4096 Sep 30 16:22 .
drwxr-xr-x 30 root root 4096 Sep 30 15:36 ..
drwxr-xr-x 2 root root 4096 Sep 30 16:12 iso_pool
-rw-r--r-- 1 root root 122 Sep 30 16:12 .ovsrepo
drwxr-xr-x 2 root root 4096 Sep 30 16:12 running_pool
drwxr-xr-x 2 root root 4096 Sep 30 16:12 seed_pool
-rw-r--r-- 1 root root 314572800 Sep 30 16:54 .server_pool_hb
[root@vm_pool /]#



Note, you can monitor for errors in the /var/log/ovs-agent/ovs_operation.log on the VM Server pool master during setup.
Success Log was:

"2008-09-26 20:03:24" INFO=> ha_sync_shared_storage_mount: among servers(['vm_pool_master.us.oracle.com', 'vm_pool.us.oracle.com'])...
"2008-09-26 20:03:24" INFO=> ha_mount_shared_storage: success
"2008-09-26 20:03:24" INFO=> ha_sync_shared_storage_mount: success.
"2008-09-26 20:03:25" INFO=> ha_setup_ocfs2_cluster: trying to reconfigure the cluster...
"2008-09-26 20:03:26" INFO=> ha_setup_ocfs2_cluster: success.
"2008-09-26 20:03:26" INFO=> ha_start_cluster_service: success.
"2008-09-26 20:03:27" INFO=> ha_start_agent_guard: success.
"2008-09-26 20:03:27" INFO=> ha_start_agent_guard_all: success.
"2008-09-26 20:03:27" INFO=> ha_setup_cluster_infrastructure: success.
"2008-09-26 20:03:27" INFO=> set_pool_ha_enable: pool_ha_enable=True


A failure Log (which was from a mis-configured ocfs2) was:

"2008-09-26 18:57:37" INFO=> ha_chec _oracle_vm_version: among servers(['vm_pool_master.us.oracle.com', 'vm_pool.us.oracle.com'])...
"2008-09- 6 18:57:38" INFO=> ha_check_oracle_vm_version: success:oracle_vm_version=['2.1.2']
"2008-09- 6 18:57:38" INFO=> ha_check_agent_version: among servers(['vm_pool_master.us.oracle.com', vm_pool.us.oracle.com'])...
"2008-09-26 18:57:38" INFO=> ha_check_agent_version: success:age t_version=2.2-51
"2008-09-26 18:57:38" INFO=> ha_precheck_storage_mount: success.
"2 08-09-26 18:57:38" INFO=> ha_check_cluster_prerequisite: success.
"2008-09-26 18:57:38& uot; INFO=> ha_check_shared_storage: among servers(['vm_pool_master.us.oracle.com', 'vm_pool.us.oracle.com'])...
"2008-09-26 18:57:38" INFO=> ha_check_shared_storage: success. /OVS/['']
"2008-09-26 18:57:38" INFO=> ha_check_cluster_status: among servers(['vm_pool_master.us.oracle.com', 'vm_pool.us.oracle.com'])...

"2008-09-26 18:57:39" ERROR=> ha_check_cluster_status: failed. =>
StackTrace:
File "/opt/ovs-agent-2.2/OVSSiteHA.py", line 308, in ha_check_cluster_status
raise Exception(rs)
>
StackTrace:
File "/opt/ovs-agent-2.2/OVSSiteHA.py", line 311, in ha_check_cluster_status
raise Exception("srv('%s'). failed! => %s" % (hostname, errmsg))
"2008-09-26 18:57:39" ERROR=> ha_check_cluster_infrastructure: error. =>
StackTrace:
File "/opt/ovs-agent-2.2/OVSSiteHA.py", line 308, in ha_check_cluster_status
raise Exception(rs)
>
StackTrace:
File "/opt/ovs-agent-2.2/OVSSiteHA.py", line 311, in ha_check_cluster_status
raise Exception("srv('%s'). failed! => %s" % (hostname, errmsg))
>
StackTrace:
File "/opt/ovs-agent-2.2/OVSSiteHA.py", line 373, in ha_check_cluster_infrastructure
raise Exception(msg)


References

http://download.oracle.com/docs/cd/E11081_01/doc/doc.21/e10898/ha.htm#insertedID1
http://download.oracle.com/docs/cd/E11081_01/doc/doc.21/e10898/repository.htm#insertedID1
http://oss.oracle.com/projects/ocfs2/dist/documentation/v1.2/ocfs2_faq.html#CONFIGURE

Keywords

OCFS2 ; ORACLE~VM ; NFS ; HIGH~AVAILABILITY ; OCFS2_DLM_EVICTION_CB ; ORACLE~VM~SERVER ;
Thanks MetaLink

La configurazione di Samba

La configurazione di Samba (i demoni smbd e nmbd) viene gestita dal file smb.conf, un normale file di testo ASCII con queste caratteristiche di massima:

- I parametri di configurazione vengono forniti nella forma opzione = valore
- Il file viene diviso in più sezioni che definiscono una share (condivisione), oltre alla sezione generale [global]. Ogni sezione si indica fra parentesi quadre: [printers]
- Le righe di commento sono precedute da asterisco (#) o punto e virgola (;)
- Righe di configurazione possono estendersi su più righe di smb.conf utilizzando una backslash (\) a fine riga
- Le opzioni e i valori sono case insensitive, ma se si indica un path nel file system questo è case sensitive
- Per separare una serie di valori possono essere usati sia virgole (,) che spazi vuoti ( )
- Possono essere utilizzate delle variabili, precedute dal simbolo percento (%) all'interno dei valori (es: path = /home/%u)
- Si può includere a smb.conf un altro file di configurazione con l'opzione include (es: include = /etc/samba/smb.conf.%a)

Le opzioni di configurazione possono essere di 2 tipi fondamentali:
- global, appaiono solo nella sezione [global] e definiscono i comportamente generali del server Samba
- share, appaiono all'interno di specifiche share e definiscono il comportamento riguardo alla specifica share. Se appaiono in [global] definiscono i comportamenti di default.

Qualsiasi opzione deve essere inclusa una una sezione. Esistono le seguenti sezioni speciali:
[global] Sempre presente, di solito ad inizio file, definisce le opzioni di default valide per tutte le condivisioni (possono essere sovrascritte da opzioni contrarie presenti nelle specifiche sezioni) e i parametri generali di configurazione del server.
[printers] E' una sezione speciale utilizzata per condividere l'accesso via rete a delle stampanti
[homes] E' una sezione speciale che coincide con la home directory di un utente autenticato. Di fatto è una condivisione generica con il nome dell'utente che accede a Samba.

Oltre a queste sezioni speciali ne possono esistere un numero arbitrario di altre, il nome di ogni sezione coincide con il nome della relativa condivisione, così come appare al client SMB.


La sezione [global] è praticamente presente in ogni smb.conf.
Qui si definiscono le configurazioni generali riguardanti il server Samba e i suoi comportamenti di default.
Vediamo nel dettaglio alcune opzioni:

CONFIGURAZIONI BASE NETBIOS

Netbios name
Definisce il nome NetBios della macchina, così come viene visualizzato in rete. Di default coincide con il nome DNS per la parte relativa all'host (es: pippo.dominio.it prende di default il nome PIPPO). Es:
netbios name = PLUTONE

Server string
E' il commento che si può leggere visualizzando i dettagli su un host in rete. non è indispensabile ma può essere utile per indicare le funzioni o le caratteristiche della macchina. E' possibile usare variabili, per esempio:
server string = File Server - Samba %v (%h)

Workgroup
Definisce il workgroup di cui fa parte il server Samba. Di default il valore è "WORKGROUP", definito in fase di compilazione, ma può essere cambiato. Es:
workgroup = INTRANET

Netbios aliases
Questa opzione permette di assegnare più nomi NetBios allo stesso server oltre a quello definito con netbios name, in modo da farlo comparire fra le Risorse di rete di Windows come macchine diverse, su cui è necessario eseguire login autonomi, anche se di fatto restano lo stesso server. Questa funzionalità può essere utile. per esempio, per raggruppare su un singolo server diversi server SMB che prima risiedevano su macchine diverse senza modificare alcun parametro sui client. Es:
netbios aliases = vendite marketing amministrazione

GESTIONE DEL NETWORKING

Hosts allow - Hosts deny
Queste opzioni definiscono l'accesso al server. Hanno la stessa logica dei file /etc/hosts.allow e hosts.deny, possono essere presenti sia nella [global] che definiti per singola share. Come argomento si aspettano l'IP di una network o di un host (considerando che la rete 192.168.0.0/24, per esempio, si indica 192.168.0.) oppure un singolo hostname (pippo.dominio.com) o un nome di dominio o sottodominio (.dominio.com).
Sono accettati anche gli argomenti speciali ALL (tutti gli IP) e EXCEPT, seguito da indirizzi o nomi di host.
Samba segue una logica ben precisa per gestire gli accessi con queste opzioni:
- Se non sono definite, viene permesso l'accesso da ogni IP
- Se sono definite nella [global] queste si applicano ANCHE per le singole share (anche se si sono specificate a livello di share)
- Se esiste solo hosts allow viene permesso quanto specificato come argomento e vengono esclusi tutti gli altrti IP
- Se esiste solo hosts.deny sarà permesso l'accesso a tutti gli IP tranne a quelli specificati come argomento
- Se esistono sia hosts allow che hosts.deny vengono esclusi TUTTI gli IP tranne quelli che sono presenti in hosts.allow E non sono presenti in hosts.deny.
Nell'esempio che segue viene dato accesso a 192.168.0.10 e a tutti gli host della rete 10.0.0.0/24 tranne 10.0.0.15:
hosts allow = 10.0.0. 192.168.0.10
hosts deny = 10.0.0.15

Questo esempio corrisponde a:
hosts allow = 192.168.0.10 10.0.0. EXCEPT 10.0.0.15

Se invece si vuole permettere l'accesso solo alla rete 192.168.0.0/16 si può scrivere semplicemente:
hosts allow 192.168.
che coincide con:
hosts deny = ALL EXCEPT 192.168.

Interfaces - Bind Interfaces only
interfaces definisce su quale interfacce di rete dell'host locale Samba si metterà in ascolto. Di default Samba utilizza l'interfaccia di rete principale, ma se si vuole che resti in ascolto su altre interfacce o si vuole essere certi che Samba scelga l'interfaccia voluta, queste vanno specificate tramite il loro indirizzo IP:
interfaces = 10.0.0.3/24 192.168.0.4/255.255.255.0
Il comando bind interfaces only può avere valore yes o no (default). Se viene abilitato Samba ignorerà ogni pacchetto, anche di broadcast, che origina da rete diverse da quelle specificate con interfaces. Notare che se si abilita, è necessario includere esplicitamente il localhost (127.0.0.1) nell'elenco delle interfacce su cui Samba deve stare in listening.
bind interfaces only = yes

GESTIONE DEL LOGGING

Log file
Specifica su quale file Samba va a scrivere i suoi log. L'argomento può contenere delle variabili, per cui è possibile avere diversi file di log per ogni utente, per tipo di client ecc. Per creare un log diverso per ogni client NetBios, per esempio, si può scrivere:
log file = /var/log/samba.log.%m

Log level
Specifica il livello di logging da usare, va da 0 (minimo) a 10 (estremamente verboso). Il valore di default è 1, su un server normale dovrebbe essere di 1 o 2, se si deve fare un po' di troubleshooting usare il livello 3, valori superiori servono soprattutto a chi sviluppa su Samba e rallentano notevolmente le operazioni:
log level = 2

Max Log Size
Definisce la dimensione massima in Kilobyte dei file di log. Quando viene raggiunto il limite, il file di log viene rinominato aggiungendo il suffisso .old (vengono eliminati eventuali file .old esistenti creati precedentemente) e si riparte con un file di log vuoto. Il valore di defalt è 5000 Kb, il valore suggerito dipende fondamentalmente dallo spazio su disco disponibile, evitare di impostare un valore troppo alto che rischia di occupare tutto lo spazio (considerando anche il file .old):
max log size = 2000

Debug Timestamp
Con questa opzione è possibile specifcare se inserire data e ora per ogni riga di log generata. Coincide con l'opzione timestamp logs. Il valore di default è yes per cui nei log sono indicate data e ora in cui avvengono gli eventi. Per non specificare il timestamp scrivere:
debug timestamp = no

Syslog e syslog only
Queste opzioni regolano la possibilità di usare il demone syslog, invece o parallelamente al logging diretto.
Per poter usare il syslog è necessario compilare Samba con configure --with-syslog e configurare /etc/syslog.conf per gestire la facility daemon. Ad esempio con una riga tipo:
daemon.* /var/log/daemon.log
Il valore specificato (da 0 a 10, default 1) indica quali messaggi di log inviare a syslog e, in riferimento agli argomenti dell'opzione log level, cosa loggare direttamente sui file di log interni. Ad esempio:
log level = 3
syslog = 2

Con queste opzioni i log di livello 0 e 1 (inferiori a 2) vengono mandati a syslog, quelli di livello 2 e 3 (compresi tra syslog e log level) vengono scritti sul file di log interno.
Per loggare solo su syslog si deve attivare l'opzione syslog only:
syslog only = yes

GESTIONE DEL BROWSING

Local master - Domain master
Queste opzioni servono per spingere Samba a cercare di diventare rispettivamente Local Master Browser (il server che mantiene la browse list per una rete IP) e Domain Master Browser (il server che mantiene la browse list per un intero workgroup, anche esteso su più reti IP, nel qual caso raccoglie e coordina lo scambio di browse list dai Local Master Browser remoti). Di default Samba ha attivata l'opzione Local Master (con cui semplicemente gli viene detto di partecipare alle elezioni, senza la certezza di vincerle) e non ha attivata l'opzione Domain Master (è bene che il Domain Master Browser sia la stessa macchina che fa eventualmente da Primary Domain Controller, sia esso un Samba o un Windows server). Le impostazioni di default sono quindi:
local master = yes
domain master = no


Preferred Master - OS Level
Con queste opzioni si gestisce il comportamento di Samba nelle elezioni e la sua possibilità di vincerle.
La prima impone a Samba di chiamare un'elezione ogni volta che entra in rete e gli imposta una probabilità leggermente superiore di vincerle rispetto ad altre macchine con lo stesso livello. E' bene impostarla a yes quando si configura Samba come Domain Master Browser o Local Master Browser:
preferred master = yes
domain master = yes

E' comunque raccomandabile non avere troppe macchine in rete (Windows o Samba) che cercano di partecipare alle elezioni per evitare inutili e ripetuti broadcast e possibili incongrenze sulla browse list di riferimento.
L'opzione OS Master, invece setta esplicitamente il livello con cui Samba si presenta alle elezioni. Può avere valore da 0 a 255, più è alto e maggiore la possibilità di diventare Master Browser. Un valore di 34 basta per far vincere tutte le elezioni con server Windows ad eccezione di un PDC. Il valore di default è 20. Il seguente esempio dovrebbe bastare per vincere ogni elezione (ovviamente ad eccezione di altri server Samba con un OS level superiore):
os level = 65.

Announce As - Announce version
Queste opzioni definiscono come Samba si presenta in rete. Announce as può avere come valori Win95, NT o WfW il default è:
announce as = NT
Announce version specifica la versione di Samba. Attualmente si presenta di default come:
announce version = 4.9
Generalmente non serve cambiare queste impostazioni di default.

remote browse sync - remote announce
Queste opzioni permettono di sincronizzare la browse list di un server Samba quando esistono diversi local master su reti diverse.
La prima permette di richiedere la sincronizzazione della brose list dai server delle reti remote specificate:
remote browse list = 10.0.0.255 192.168.0.255
Con la seconda opzione si può esplicitamente annunciare il server locale, con un workgroup arbitrario, ai server sulla rete remota specificata:
remote announce = 192.168.0.255/WROKGROUP
In entrambi i casi si possono indirzare direttamente gli IP dei server remoti o gli indirizzi di broadcast della loro rete (in questo caso il "directed broadcast" deve poter essere consentito sulla rete remota, di default i router Cisco non lo permettono).

GESTIONE DELLE PASSWORD
E' importante configurare la logica con cui Samba gestisce l'autenticazione e come eventualmente sincronizza le sue password con quelle di sistema. I dati relativi agli utenti sono mantenuti nel file smbpasswd, che a sua volta si può modificare con l'omonimo comando shell.
Sulla gestione delle password esistono varie opzioni di configurazione.

encrypt passwords
Di default ha valore NO, non prevedendo l'invio in chiaro delle password via rete. Sui Windows recenti, comunque, (tutti esclusi NT4 pre SP3 e Windows 95) le password vengono inviate criptate. Per cui o si modifica il registro (esiste .reg adatto nel tar.gz ufficiale) sui Windows o, meglio, si abilita la criptazione delle password:
encrypt passwords = yes.

password level
Di default samba esegue il matching delle password in lowercase (con caratteri minuscoli), compresa la prima lettera.
Password level permette di specificare, come nel caso di username level, quante lettere al massimo si possono rendere maiuscole per i tentativi di connettersi ad una smb share.
password level = 2

null password
Abilita o Disabilita la possibilità di utilizzare password (cryptate e non cryptate) pari a null.
Il valore di default è NO.
password level = yes

smb passwd file
Specifica il path del file contenente le password cryptate.
Il valore di default è : /usr/local/samba/private/smbpasswd
smb passwd file = /etc/samba/smbpasswd

CONFIGURAZIONE DEI DOMINI
SAMBA permette di usufruire dei domini di windows in varie modalità:

- PDC, samba può essere configurato come primary domain controller per i client windows/unix.
- BDC, (backup domain controller) features non del tutto funzionante per le versioni correnti (2.x), occorre aspettare la versione 3.x per avere il supporto completo.
- Host, facente parte di un dominio esistente.

Di seguito sonon riportate alcune opzioni utili per configurare il logon dei client nel dominio:

domain logons
Permette di loggarsi nel dominio tramite samba configurato come PDC server.
domain logons = yes

logon script
Specifica lo script che verrà lanciato sui client una volta loggati nel dominio.
logon script = logon.bat

logon home
Specifica l'home dell'utente, per i comandi DOS NET.
logon home = \\server\home\%U

logon path
Identifica la locazione dei roaming file.
logon path = \\server\profile\%U

RISOLUZIONE DEI NOMI CON SAMBA
E' possibile utilizzare una o più delle seguenti modalità di risoluzione dei nomi:

- Broadcasting
- LMHOST file
- Unix /etc/host o NIS
- WINS (Windows Internet Name Service), samba ha la facoltà di appoggiarsi ad un WINS server esterno oppure configurare lo stesso SAMBA per fungere da WINS server.

name resolve order
Opzione che permette di specificare con quali metodi e il rispettivo ordine da utilizzare per la risoluzione dei nomi.
name resolve order = wins hosts bcast

wins server
Permette di appoggiarsi ad un wins esterno specificando semplicemente l'IP, sarà SAMBA stesso a ridirigere le singole richieste al server specificato.
wins server = 10.0.0.100

wins proxy
Abilita il forwarding di tutte le richieste di risoluzione dei nomi anche ad WINS che sono esterni alla subnet del SAMBA server.
wins proxy = yes

wins support
Abilita il WINS server di SAMBA.
wins support = yes

dns proxy
Permette di appoggiarsi al DNS configurato sul server SAMBA (/etc/resolv.conf) per la risoluzione dei nomi fallita tramite WINS.
dns proxy = yes


Client per il managment delle ACL delle share SMB in un server NT.

smbcacls //server1/share1 filename [options]

Opzioni Comuni:
-U Opzione per specificare l'utente utilizzato per conettersi al servizio remoto
-A [acls] Aggiunge una ACL all'access list specificata
-D [acls] Elimina le ACL specificate in linea di comando
-n Visualizza le ACL in formato numerico

Formato ACL:
Le ACL sono formate da singole o più entry separate dalla virgola o più semplicemente ogni entry deve corrispondere ad una nuova linea. Esempio:
Specifica il numero della revisione della ACL lato NT server
REVISION:
Owner e Group specificano owner e group sid dell'oggetto
OWNER:

GROUP:
ACL
ACL:://


Le opzioni inserite nella sezione [share] fanno riferimento alla configurazione da applicare alla singola risorsa condivisa o alle share di sistema come [netlogon] o [printer] per abilitare/disabilitare alcune funzioni di samba stesso.

CONFIGURAZIONI BASE PER LE SINGOLE SHARE
Le seguenti opzioni sono le tipiche opzioni utilizzate in tutti i tipi di share e ne definiscono i caratteri generali come per esempio il nome della risorsa che si condivide.

[nome share]
Il nome delle singole share è settato con la seguente entry [nome share] nel file di configurazione dopo le opzioni relative alla sezione [global].
[docs]

path
Sinonimo di directory, indica il path locale della risorsa da condividere tramite Samba.
Nel caso in cui la share si riferisce ad una stampate identifica la directory che avrà la funzione da spool per la stampante stessa.
path = /home/docs

comment
E' possibile affiancare un commento al nome delle share, che verrà visualizzato lato client. Utile per descrivere il contenuto della risorsa.
comment= Documenti comuni

GESTIONE ACCESSI
La gestione degli accessi alle risorse può avvenire in vari modi a seconda del tipo di configurazione adottata nelle global options.

valid users - invalid user
La prima opzione viene utilizzata per specificare gruppi o utenti che possono accedere alla risorsa, la seconda invece per negarne definitivamente l'accesso.
valid users = pippo pluto joe

admin user
Determina quali utenti che accedono alla risorsa possono eseguire operazioni da utente root.
admin user = joe

guest ok
Abilita l'accesso alla risorsa all'utente guest.
guest ok = yes

guest account
Unix account utilizzato come guest access. L'account di default è nobody.
guest account = webmaster

guest only
Di default settata a no, limita l'accesso alla risorsa all'utente guest.
guest only = no

writable (write ok) -read only
Opzioni utilizzabili sia nella sezione global che share permette di abilitare o disabilitare gli attributi di scrittura.
I valori di default permettono la sola lettura (read only = yes e writable = no).
read only = no
writable = yes


browsable
Nega o permette la visualizzazione nella lista delle risorse del server samba. Di default è settata a yes.
browsable = yes

read - write list
Opzioni che permettono di eseguire un override della configurazione base di una share per la lista degli utenti specificati.
Rispettivamente, read list permette l'accesso con i soli diritti di lettura ad una share scrivibile mentre write list specifica quali utenti possono accedere, anche con i permessi di scrittura, ad una risorsa configurata per acconsetire gli accessi in sola lettura.
write list = webmasters developers

max connections
Specifica il numero massimo di connessioni ad una share. Settata di default a 0, permette connessioni illimitate alle risorse.
max connections = 10

SYSTEM SHARE
Samba prevede delle share con un nome specifico per abilitare alcune features o lo sharing di risorse particolari come stampanti.

netlogon
Share indispensabile nel caso in cui samba server faccia da PDC, permette il logon dei client nel dominio. Questa share deve avere le seguenti caratteristiche:
- Il nome non è modificabile, [netlogon]
- Non è possibile visualizzarla e scriverci.
- Non è possibile accederci come utente guest.
[netlogon]
Comment = share to domain logon
path = /samba/logon
public = no
writabl e = no
browsable = no


profile
E' possibile specificare tramite la share [profile] la risorsa che dovrà fungere da repository per tutti i roaming profile. Questa share non deve essere visualizzata nelle risorse dispobilli del server ma deve essere possibile scriverci.
[profile]
comment = Profili Utenti
path = /samba/profile
create mode = 0600
directory mode = 0700
writable = yes
browsable = no


homes
Share che visualizza in modo automatico la home dell'utente, senza dover mettere le relative entry nel file smb.conf per i singoli utenti. Tale share che prende il nome dell'utente è visibile e scrivibile solo dall'utente con cui si è eseguito il login sul server.
[homes]
comment = Home Directories
valid users = %S
read only = No
create mask = 0664
directory mask = 0775
browseable = No

Esiste la possibilità di vietare il salvataggio di files con una determinata estensione in una cartella condivisa tramite SAMBA.

Occorre semplicemente aggiungere nella sezione [global] del file smb.conf (/etc/samba/smb.conf) il seguente parametro:
veto files = /*.mp3/ /*.wav/ /*.mpeg/ /*.avi/
In questo caso non è permesso il salvataggio di files con estensione: mp3, wav, mpeg ed avi.


Thanks OpenSkill