UNIX tricks and treats

Aller au contenu | Aller au menu | Aller à la recherche

lundi 22 août 2011

SYSAUX tablespace grows because of statistics retention

I've noticed that on some of my databases, the SYSAUX tablespace kept on growing to unreasonable proportions.

The following objects would grow to several gigabytes in size .
   
SYS    WRI$_OPTSTAT_HISTGRM_HISTORY    TABLE
SYS    WRI$_OPTSTAT_HISTHEAD_HISTORY    TABLE
SYS    WRI$_OPTSTAT_IND_HISTORY    TABLE
SYS    I_WRI$_OPTSTAT_H_OBJ#_ICOL#_ST    INDEX
SYS    I_WRI$_OPTSTAT_H_ST        INDEX



This is due to the retention of system statistics by Oracle (default 1 month).


SQL> select dbms_stats.get_stats_history_retention present_retention from dual;

PRESENT_RETENTION
-----------------
               31


It is possible to modify the retention period through the dbms_stats package.

SQL> exec DBMS_STATS.ALTER_STATS_HISTORY_RETENTION(7);

PL/SQL procedure successfully completed.


SQL>  select dbms_stats.get_stats_history_retention present_retention from dual;

PRESENT_RETENTION
-----------------
                7


It is also possible to purge the statistics history, through the use of the same package.


exec DBMS_STATS.PURGE_STATS(SYSDATE-7);


Beware, the process can be quite long (several hours), and undo tablespace-consuming.
Be sure you dispose of enough diskspace to accomodate the resulting rollback segment and archivelog creation, and be prepared to delete archivelogs through RMAN.

Leave me a note if this post has been useful to you.

Happy computing

Nixman.

mercredi 16 février 2011

Cabinet architecte paysagiste

Urbicus est un cabinet d'architectes paysagistes basé à Versailles.

mardi 21 septembre 2010

Purge des logs sous adrci

La nouvelle interface de gestion des logs Oracle permet de faciliter la gestion des logs.

Par contre, au vu de la quantité de logs générées par Oracle 11gR2, il est important de mettre en place une politique de purge efficace.

Purge automatique des logs sous adrci:

/!\ L'âge des logs est exprimée en heures
Par défaut, les logs sont purgés tous les mois pour les logs à vie courte (720 heures) et tous les ans pour les logs à vie longue (8760 heures).
Nous allons baisser ces valeurs à 7 et 30 jours (168 et 720 heures).

adrci> show home
ADR Homes:
diag/tnslsnr/srv_1/listener
diag/tnslsnr/srv_1/listener_scan1
diag/asm/+asm/+ASM1

adrci> set home diag/tnslsnr/srv_1/listener
adrci> show control

ADR Home = /u01/app/grid/diag/tnslsnr/srv_1/listener:
*************************************************************************
ADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME
-------------------- -------------------- -------------------- ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------------- -------------------- -------------------- -------------------- ----------------------------------------
3936991633 720 8760 2010-01-18 18:23:33.022104 +01:00 2010-09-21 11:59:19.401387 +02:00 1 2 76 1 2010-01-18 18:23:33.022104 +01:00
1 rows fetched


adrci> set control (SHORTP_POLICY=168)
adrci> set control (LONGP_POLICY=720)
adrci> show control

ADR Home = /u01/app/grid/diag/tnslsnr/srv_1/listener:
*************************************************************************
ADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME
-------------------- -------------------- -------------------- ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------------- -------------------- -------------------- -------------------- ----------------------------------------
3936991633 168 720 2010-09-21 12:05:06.248617 +02:00 2010-09-21 11:59:19.401387 +02:00 1 2 76 1 2010-01-18 18:23:33.022104 +01:00
1 rows fetched

Réaliser la même modification pour les autres homes

adrci> set home diag/tnslsnr/srv_1/listener_scan1
adrci> set control (SHORTP_POLICY=168)
adrci> set control (LONGP_POLICY=720)

adrci> set home diag/asm/+asm/+ASM1
adrci> set control (SHORTP_POLICY=168)
adrci> set control (LONGP_POLICY=720)

Purge manuelle des logs sous adrci:

/!\ Cette fois-ci, l'âge des logs est exprimée en minutes

adrci> show home
ADR Homes:
diag/tnslsnr/srv_1/listener
diag/tnslsnr/srv_1/listener_scan1
diag/asm/+asm/+ASM1

adrci> set home diag/tnslsnr/srv_1/listener
adrci> purge -age 5400

mercredi 25 août 2010

A handy command to monitor Linux multipath

Works on: Red Hat 5.3 with Qlogic fiber channel cards

Monitoring failing paths on a fibre channel card connected to a SAN on Linux isn't very straightforward

A handy command to check it in real time would be this one:

watch -n 1 "echo show paths | multipathd -k "

The output would look something like this:

multipathd> hcil    dev  dev_t  pri dm_st   chk_st   next_check

[...]
1:0:3:3 sdam 66:96  50  [failed][faulty] XX........ 4/20
1:0:3:4 sdan 66:112 50  [failed][faulty] XX........ 4/20
0:0:0:0 sda  8:0    50  [active][ready]  XXXXXXXX.. 17/20
0:0:0:1 sdb  8:16   10  [active][ready]  XXXXXXXX.. 17/20
0:0:0:2 sdc  8:32   50  [active][ready]  XXXXXXXX.. 17/20

[...]

Here, controller 1 is failing, resulting in 4 failed paths out of 8.

"4/20" and "17/20" being the number of secons left till the next check

Leave me a note if this post has been useful to you

Happy computing

Nixman

jeudi 8 avril 2010

Multiplexer les redo logs Oracle sous ASM

SQL> select group#, member from v$logfile;

    GROUP# MEMBER
---------- --------------------------------------------------
         1 +FRA/MYDB/onlinelog/group_1.257.715620719
         2 +FRA/MYDB/onlinelog/group_2.258.715620719
         3 +FRA/MYDB/onlinelog/group_3.259.715620719

SQL>  select group#, status, bytes/1024  from v$log;

    GROUP# STATUS           BYTES/1024
---------- ---------------- ----------
         1 ACTIVE                51200
         2 CURRENT               51200
         3 ACTIVE                51200


SQL> alter system switch logfile;
SQL> alter system switch logfile;
SQL> alter system switch logfile;


SQL> alter system checkpoint global;


SQL>  select group#, status from v$log;

    GROUP# STATUS
---------- ----------------
         1 CURRENT
         2 INACTIVE
         3 INACTIVE


Prendre un des groupes en état INACTIVE et le supprimer, puis le recréer avec deux membres.

Dans cet exemple, on suppose que l'instance est en mode OMF.

SQL> alter database drop logfile group 3;
(si le groupe 3 est en état INACTIVE)

SQL> select group#, status, bytes/1024  from v$log;

    GROUP# STATUS           BYTES/1024
---------- ---------------- ----------
         1 CURRENT               51200
         2 INACTIVE              51200

SQL> alter database add logfile group 3 ('+DATA','+FRA') size 51200K;

SQL> alter system switch logfile;

On vérifie que le groupe 3 possède désormais deux membres

SQL> select group#, status, members, bytes/1024  from v$log;

    GROUP# STATUS              MEMBERS BYTES/1024
---------- ---------------- ---------- ----------
         1 ACTIVE                    1      51200
         2 INACTIVE                  1      51200
         3 CURRENT                   2      51200


SQL> select group#, member from v$logfile order by 1

    GROUP# MEMBER
---------- --------------------------------------------------
         1 +FRA/MYDB/onlinelog/group_1.257.715710709
         1 +DATA/MYDB/onlinelog/group_1.285.715710709
         2 +FRA/MYDB/onlinelog/group_2.258.715710073
         2 +DATA/MYDB/onlinelog/group_2.284.715710073
         3 +FRA/MYDB/onlinelog/group_3.259.715709881
         3 +DATA/MYDB/onlinelog/group_3.282.715709881

Et faire ainsi de suite pour les trois groupes... Ici, on peut dropper et recréer le groupe 2 car il est inactif

Attention à ne pas dropper les trois groupes de logs en même temps ou de dropper un logfile group actif!


N'hésitez pas à un message si cet article vous a été utile.

Nixman

mercredi 7 avril 2010

Multiplexing an Oracle controlfile in ASM


1) Check current controlfile's name and restart the database NOMOUNT

SQL> show parameter control_files

NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------------------------------------------
control_files                        string      +FRA/MYDB/controlfile/current.256.715620719


SQL> shutdown immediate

SQL> startup nomount


2) Copy/restore current controlfile through RMAN

$ rman target /

RMAN> restore controlfile to '+DATA' from '+FRA/MYDB/controlfile/current.256.715620719';

Starting restore at 07-APR-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=272 device type=DISK

channel ORA_DISK_1: copied control file copy
Finished restore at 07-APR-10

3) Find out the name of the new controlfile through asmcmd

ASMCMD> ls -lsa +DATA/MYDB/controlfile

Type         Redund  Striped  Time             Sys  Block_Size  Blocks    Bytes     Space  Name
CONTROLFILE  UNPROT  FINE     APR 07 14:00:00  Y         16384     595  9748480  16777216  none => current.283.715704921


4) Modify your spfile to take into account the new controlfile

SQL> alter system set control_files='+DATA/MYDB/controlfiles/current.283.715704921','+FRA/MYDB/controlfile/current.256.715620719' scope=spfile;


5) Restart the database and check

SQL> shutdown immediate

SQL> startup

SQL> show parameter control_files;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      +DATA/MYDB/controlfiles/cu
                                                 rrent.283.715704921, +FRA/mmtw
                                                 ebdv/controlfile/current.256.7
                                                 15620719



Leave me a line if this note has been useful to you.

Happy computing


Nixman

Multiplexer le fichier de contrôle Oracle sous ASM


1) Vérifier le nom du fichier de contrôle actuel:

SQL> show parameter control_files

NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------------------------------------------
control_files                        string      +FRA/MYDB/controlfile/current.256.715620719


SQL> shutdown immediate

SQL> startup nomount


2) Effetuer la copie du fichier de contrôle via rman

$ rman target /

RMAN> restore controlfile to '+DATA' from '+FRA/MYDB/controlfile/current.256.715620719';

Starting restore at 07-APR-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=272 device type=DISK

channel ORA_DISK_1: copied control file copy
Finished restore at 07-APR-10


3) Retrouver le nom du nouveau fichier de contrôle via asmcmd:

ASMCMD> ls -lsa +DATA/MYDB/controlfile

Type         Redund  Striped  Time             Sys  Block_Size  Blocks    Bytes     Space  Name
CONTROLFILE  UNPROT  FINE     APR 07 14:00:00  Y         16384     595  9748480  16777216  none => current.283.715704921


4) Modifier les paramètres d'init pour prendre en compte le nouveau fichier de contrôle:

SQL> alter system set control_files='+DATA/MYDB/controlfiles/current.283.715704921','+FRA/MYDB/controlfile/current.256.715620719' scope=spfile;


5) Redémarrer la base et vérifier:

SQL> shutdown immediate

SQL> startup

SQL> show parameter control_files;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      +DATA/MYDB/controlfiles/cu
                                                 rrent.283.715704921, +FRA/mmtw
                                                 ebdv/controlfile/current.256.7
                                                 15620719



Laissez-moi une note si cet article vous a été utile.

Bonne journée.


Nixman

lundi 22 mars 2010

Purge backups OCR non fonctionnel sous Cluster Oracle 11gR2

Dans un cluster Oracle 11gR2, la purge des backups automatiques de l'OCR ne fonctionne pas (depuis version 10.2.4) si les  fichiers *.ocr situés sous $ORA_CRS_HOME/cdata/<cluster_name> (ex:/u01/app/11.2.0/grid/cdata/inbdor0809-rac/) ont les mauvaises permissions. De ce fait, les fichiers *.ocr avec des noms aléatoires ne sont pas renoimmés en backupXX.ocr et ne sont pas purgés, saturant la partition.

ocrconfig -showbackup montre bien la bonne date de sauvegarde, mais les fichiers backupXX.ocr ont une date bien antérieure.

Un grand nombre de fichiers XXXXXXXXX.ocr existe sous $ORA_CRS_HOME/cdata/<cluster_name>.


# ls -rtl $ORA_CRS_HOME/cdata/<cluster_name>

-rw------- 1 grid oinstall 7081984 jan 18 22:24 day.ocr
-rw------- 1 grid oinstall 7081984 jan 19 02:24 day_.ocr
-rw------- 1 grid oinstall 7081984 jan 19 06:24 backup02.ocr
-rw------- 1 grid oinstall 7081984 jan 19 10:24 backup01.ocr
-rw------- 1 grid oinstall 7081984 jan 19 14:24 backup00.ocr

...

-rw------- 1 root root 7413760 mar 19 22:06 40778839.ocr
-rw------- 1 root root 7413760 mar 20 02:06 26378630.ocr
-rw------- 1 root root 7413760 mar 20 06:06 11332652.ocr
-rw------- 1 root root 7413760 mar 20 10:06 35215677.ocr
-rw------- 1 root root 7413760 mar 20 14:06 41977816.ocr
-rw------- 1 root root 7413760 mar 20 18:06 18335174.ocr
-rw------- 1 root root 7413760 mar 20 22:06 90743999.ocr
-rw------- 1 root root 7413760 mar 21 02:06 20182690.ocr
-rw------- 1 root root 7413760 mar 21 06:06 28125568.ocr
-rw------- 1 root root 7413760 mar 21 10:06 20121708.ocr
-rw------- 1 root root 7413760 mar 21 14:06 34916120.ocr
-rw------- 1 root root 7413760 mar 21 18:06 24068304.ocr



Solution:

chown root:root $ORA_CRS_HOME/cdata/<cluster_name>/*.ocr

Les fichiers XXXXXXXX.ocr peuvent être ensuite supprimés.

Référence: Note Metalink 741271.1

mardi 17 novembre 2009

STREAMS alter table move bug


A very annoying STREAMS bug, which should be corrected in the 11GR2 release, is the failure of STREAMS to keep up with an alter table move tablespace command.

If your table contains a LOB, and want to do some reorg through a move, then you will very likely hit the bug and receive the following error message in your alert.log:

ORA-26744: STREAMS capture process "STREAMS_CAPTURE" does not support "OWNER"."TABLE_NAME" because of the following reason:
ORA-26773: Invalid data type for column "malformed redo"


No workarounds exist, except excluding your table from your STREAMS propagation.

Reimporting the table with a new flashback SCN won't work. You have to reimplement the whole STREAMS process to get back on your feet.

Metalink réference:Bug 5623403.

lundi 16 novembre 2009

Nombre de processeurs physiques sur serveur Red Hat Linux

Des outils comme top affichent le nombre de coeurs, ou le nombre de threads, et non le nombre de processurs physiques d'un serveur.


Afin d'obtenir le nombre de processurs physiques, il faut taper la commande suivante:

$ cat /proc/cpuinfo | grep "physical id"
physical id     : 0
physical id     : 2
physical id     : 0
physical id     : 2



Dans ce cas-ci, nous avons deux processurs physiques: 0 et 2

vendredi 9 octobre 2009

Configuration particulière de STREAMS pour RAC

Dans le cadre d'un RAC, si l'on a configuré la propagation via un dblink, il faut indiquer un des noeuds comme propriétaire par défaut de la queue capture et apply de STREAMS. Sinon, on peut se retrouver confroté à une erreur ORA-25315 de façon aléatoire.

Le mieux, sur des configurations 10.2 ou supérieurs, étant de positionner le paramètre queue_to_queue à TRUE lors de la mise en place de la propagation avec DBMS_PROPAGATION_ADM.CREATE_PROPAGATION. On ne passera alors plus par le dblink. Il est impossible de modifier le paramètre en cours de route.

Réf: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_prop_a.htm

Retrouver les noms des queues STREAMS

set lines 150

SELECT q.OWNER, q.NAME, t.QUEUE_TABLE, t.OWNER_INSTANCE

  • FROM DBA_QUEUES q, DBA_QUEUE_TABLES t
  • WHERE t.OBJECT_TYPE = 'SYS.ANYDATA'
  • AND q.QUEUE_TABLE = t.QUEUE_TABLE
  • AND q.OWNER = t.OWNER;

Indiquer un propriétaire par défaut et un propriétaire secondaire

DBMS_AQADM.ALTER_QUEUE_TABLE (

  • queue_table IN VARCHAR2,
  • comment IN VARCHAR2 DEFAULT NULL,
  • primary_instance IN BINARY_INTEGER DEFAULT NULL,
  • secondary_instance IN BINARY_INTEGER DEFAULT NULL);

ex:

BEGIN

  • DBMS_AQADM.ALTER_QUEUE_TABLE(
    • queue_table => 'MON_QUEUE_TABLE_APPLY',

    • primary_instance => 1,

    • secondary_instance => 2);

END; /

BEGIN

  • DBMS_AQADM.ALTER_QUEUE_TABLE(
    • queue_table => 'MON_QUEUE_TABLE_CAPTURE',

    • primary_instance => 1,

    • secondary_instance => 2);

END; /

BEGIN

  • DBMS_AQADM.ALTER_QUEUE_TABLE(
    • queue_table => 'SCHEDULER$_JOBQTAB',

    • primary_instance => 1,

    • secondary_instance => 2);

END; /

lundi 21 septembre 2009

Installing ocfs2 filesystem on RHEL 5.3


Until Oracle finally releases its much awaited-for Universal FileSystem, the only way to install grid infrastructure on shared storage is still ocfs2, which you may find useful as a regular cluster filesystem, too.

Download the rpms for Red Hat from
http://oss.oracle.com/projects/ocfs2/

For a 64-bit platform, you will need these ones:

( Do a uname -r to check which is your platform)

ocfs2-2.6.18-128.el5-1.4.2-1.el5.x86_64.rpm
ocfs2-tools-1.4.2-1.el5.x86_64.rpm
ocfs2console-1.4.2-1.el5.x86_64.rpm

# rpm -Uvh ocfs2-tools-1.4.2-1.el5.x86_64.rpm ocfs2-2.6.18-128.el5-1.4.2-1.el5.x86_64.rpm ocfs2console-1.4.2-1.el5.x86_64.rpm

You might have to install pygtk and vte first
# yum install vte.x86_64
# yum install pygtk2.x86_64

Contrarily to what the install doc states, you will first have to edit the /etc/ocfs2/cluster.conf by hand before being able to do anything.

cluster:
       node_count =1
       name=ocfs2
node:
        ip_port = 7777
        ip_address = my_cluster_node_1_interconnect_ip_adress
        number = 1
        name = my_cluster_node_1_hostname
        cluster = ocfs2


Once you've edited the file on one of the nodes, you're not done yet. Do a:

# service 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
<ENTER> without typing an answer will keep that current value.  Ctrl-C
will abort.

Load O2CB driver on boot (y/n) [y]: y
Cluster stack backing O2CB [o2cb]:
Cluster to start on boot (Enter "none" to clear) [ocfs2: 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
Starting O2CB cluster ocfs2: OK

Then only you may start the graphic ocfs2 console:

# ocfs2console

In the GUI, go to Edit-> Add node, and add your second node, with its interconnect ip address. Validate.

Go to Edit -> Propagate Configuration.

By now, you should see the following configuration on your two nodes.

node:
        ip_port = 7777
        ip_address = my_cluster_node_1_interconnect_ip_adress
        number = 1
        name = my_cluster_node_1_hostname
        cluster = ocfs2

node:
        ip_port = 7777
        ip_address = my_cluster_node_2_interconnect_ip_adress
        number = 2
        name = my_cluster_node_2_hostname
        cluster = ocfs2

cluster:
       node_count =3
       name=ocfs2



Do a:
# service o2cb configure
on the second node

Check if the service is finally up and running running on both nodes:

# ps -ef | grep o2
root     24816   153  0 17:27 ?        00:00:00 [o2net]
root     24891 18206  0 17:27 pts/0    00:00:00 grep o2

Then, you may go on formatting the volume you've prepared on your shared storage.

Here, the volume is configured under Linux with Device-Mapper multipath, and is seen under /dev/mapper as VOL1.

# mkfs.ocfs2 -c 4K -C 4K -L "ocfs2volume1" /dev/mapper/VOL1


Then, you may  just create a mount point on which to mount the volume on both nodes, /u01/app/ocfs2mounts/grid for example, if you're planning on installing Oracle grid infrastructure.

Mount the filesystem on both nodes

# mount /dev/mapper/VOL1 /u01/app/ocfs2mounts/grid

Drop me a line, or have a look at the links, if this post has been useful to you.

Happy computing

Nixman.






samedi 19 septembre 2009

Oracle 11gr2 RAC on Red Hat Linux 5.3 install guide part1


Oracle 11gr2 RAC on Red Hat Linux 5.3 install guide part1: Installing the grid infrastructure:

Oracle 11gR2 has been released for Linux, and the installation has somewhat changed from precedent versions, including 11gR1. In this step-by-step guide, we will lead you through a real-life Oracle Real Application Cluster (RAC) installation, its novelties, incompatibilities, and the caveats of Oracle install documentation.

The installation process is divided into two parts: The grid infrastructure installation, which now includes the clusterware, but also ASM installation, which has been moved there from the regular database installation. This stems from the fact that ASM now supports voting disks, and OCR files, and you are no longer required (actually, its now discouraged) to place the voting disks and OCR files on raw devices.

Grid infrastructure also installs for you the ACFS cluster file system, which allows you to share the ORACLE_HOME of your database installation between all the nodes of your RAC cluster. However, it doesn't allow you to share the grid infrastructure ORACLE_HOME between the nodes. For that, you would need to install the grid infrastructure binaries on an ocfs2 filesystem. However, that's not supported by Oracle, nor does it work. Last year, Oracle had promised an Oracle Universal File System (UFS), and it is a bit disappointing to see that ACFS is not what we expected yet.

Download the necessary files:

You will need the grid infrastructure disk, as well as the two database disks from Oracle's site. Download as well the deinstall disk, as Oracle Universal Installer doesn't support the deinstallation of the binaries anymore, and everything has moved to this 300Mb plus disk.

You will also need the three asmlib files from OTN, that are downloadable here.

Do a uname -rm on your platform in order to find out which ones are the right ones for you.

Oracle validate rpm will also be useful in order to ensure you have all the necessary rpm's installed on your server.

Setting the system parameters and prerequisites:

Nothing much new here. Simply follow the install guide's  instructions. The installer will check anyhow if you have set the parameters right, and even generate a fixup script for most of the prerequisites.

# cat >> /etc/sysctl.conf <<EOF
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = 4294967296
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
EOF

# sysctl -p

An extremely intriguing fact is the necessity to set up ntpd with the -x option which disallows any brutal adjustment of the system clock under a drift of 600s (instead of 128ms by default). This is a workaround for a RAC bug that was supposed to have been corrected in release 10.2.0.3... Well, actually, it may not be a bug, but a feature for any cluster that needs synchronization. The downside of the -x option is, that if your hardware is down for a month, and the system clock goes off half an hour, it will take days for it to adjust slowly to network time.

Be sure to do a chkconfig oracleasm on after setting up oracleasm on a RHEL 5.3. Else, you will corrupt your voting disks and OCR upon the first reboot. The install guide has simply forgotten to mention that oracleasm enable/disable have been deprecated on this platform.

Don't bother setting up VIP's or passwordless ssh connectivity, contrarily to what the install guide instructs you to do: the installer won't appreciate your initiative, and you will have to set them up the way Oracle wants it. Simply give the same password to your grid and oracle users on both nodes.

Creating the UNIX groups, users, and directories:

Create two separate users (grid and oracle for example), one for grid infrastructure installation, and one for the database installation, with separate ORACLE_BASE and ORACLE_HOME directories.

A new set of three groups have been created to manage asm. Grid user should be member of them.

A change to OFA is that the grid user's ORACLE_HOME cannot be under its ORACLE_BASE directory, but on a separate path.

Here, we will point oracle user's home to a shared ACFS mount. We'll mount that filesystem later, after grid infrastructure's installation  when we will have ACFS installed. Indeed, ACFS is built on top of ASM, which in turn is installed as part of grid infrastructure. Hence the separation of grid infrastructure and database installation.

(As a footnote: you may change u01 to get27, for example, and still be OFA-compliant)

# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
# /usr/sbin/groupadd oper
# /usr/sbin/groupadd asmadmin
# /usr/sbin/groupadd asmdba
# /usr/sbin/groupadd asmoper
# /usr/sbin/groupadd orauser

# /usr/sbin/usermod -g oinstall -G dba,asmdba oracle
# /usr/sbin/usermod -g oinstall -G dba,asmdba,oper,oinstall,asmadmin grid

# mkdir /u01/app/11.2.0/grid
# mkdir /u01/app/grid
# mkdir /u01/app/acfsmounts/oracle
# chown -R grid:oinstall /u01/app
# chmod -R 775 /u01/app
# chown -R oracle:oinstall /u01/app/acfsmounts
# chmod -R 775 /u01/app/acfsmounts

# cat >> /etc/security/limits.conf <<EOF
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF

To be continued ... stay tuned.

vendredi 18 septembre 2009

Discrepancies and catchas in Oracle 11gR2 grid infrastructure install guide for Linux


Discrepancies in Oracle 11gR2 grid infrastructure install guide for Linux:

- Oracle instructs you to create VIP's on both nodes as a preinstall task.
However, if you do so, Oracle grid infrastructure installer will tell you the VIP adresses are already in use.

- Even though you have set up passwordless ssh connectivity between two RAC nodes, the installer keeps telling you this is not the case. I guess it has something to do with Oracle using rsa1. I gave up and gave both my oracle users the same password, and clicked on "setup", and let the installer do it for me. Everything went fine afterwards.

- /usr/sbin/oracleasm enable and disable have been deprecated on RHEL 5.3.
You have to use chckconfig oracleasm on.
If you fail to do so, upon reboot, asmlib is not loaded, and your voting disks and OCR are corrupted.

- If you use ACFS have to use different ORACLE_BASE directories for the Oracle grid infrastructure user (ex:grid: /u01/app/grid/), and the Oracle database user (ex: oracle: /u01/app/oracle/).
In the install doc, this is not so clear, as only ORACLE_HOME directories (ex:/u01/app/11.2.0/grid/ for grid and /u01/app/oracle/acfsmounts/orahome1/ for oracle) have to be different, the ORACLE_BASE seeming to be a unique one.

- Even though you can set up a shared ORACLE_HOME through ACFS for the database binaries, you still have to rely on ocfs2 if you want to have the Oracle grid infrastructure binaries on a shared filesystem.

- You absolutely have to be patient ant wait for the root.sh script to finish on your first node (can last half an hour), before you may execute it on your other nodes. Else, your  installation will miserably fail.

A complete RAC installation guide for Oracle 11gR2 on RHEL 5.3 with multipath will follow soon.

mercredi 16 septembre 2009

Enabling server-side failover, TAF and load-balancing on Oracle 1OgR2 RAC


Sometimes, you don't  have the possiblity enable Transparent application failover on the client side (in the tnsnames.ora file for example).

That's where this new feature in Oracle 10gR2 RAC comes handy:

You can enable both failover and load-balancing on the server side, by executing a simple dbms_service procedure.

EXECUTE DBMS_SERVICE.MODIFY_SERVICE (service_name => 'MY_SERVICE_NAME'
, aq_ha_notifications => TRUE
, failover_method => DBMS_SERVICE.FAILOVER_METHOD_BASIC
, failover_type => DBMS_SERVICE.FAILOVER_TYPE_SELECT
, failover_retries => 60
, failover_delay => 10
, clb_goal => DBMS_SERVICE.CLB_GOAL_LONG);


To disable the feature, it's as simple:

begin
    dbms_service.modify_service(
      service_name=>'MY_SERVICE_NAME',
      failover_type=>DBMS_SERVICE.FAILOVER_TYPE_NONE,
      failover_method=>DBMS_SERVICE.FAILOVER_METHOD_NONE
    );
  end;
/


For complete documentation, you can check:

http://download.oracle.com/docs/cd/B19306_01/rac.102/b14197/hafeats.htm#BABIAICG



Happy computing,

Nixman

Purger les jobs Datapump terminés ou orphelins

Réf: Metalink Doc ID: 336014.1

SQL > SET lines 200

COL owner_name FORMAT a10

COL job_name FORMAT a20

COL state FORMAT a11

COL operation LIKE state

COL job_mode LIKE state

SQL> SELECT owner_name, job_name, operation, job_mode, state, attached_sessions FROM dba_datapump_jobs WHERE job_name NOT LIKE 'BIN$%' order by 1,2;

EXPIMP SYS_EXPORT_TABLE_02 EXPORT TABLE NOT RUNNING 0
EXPIMP SYS_EXPORT_FULL_01 EXPORT FULL NOT RUNNING 0

Ne sélectionner que ceux qui sont en "NOT RUNNING". Voir où se trouvent leurs Master tables:

SQL> SELECT o.status, o.object_id, o.object_type,
o.owner||'.'||object_name "OWNER.OBJECT"
FROM dba_objects o, dba_datapump_jobs j
WHERE o.owner=j.owner_name AND o.object_name=j.job_name
AND j.job_name NOT LIKE 'BIN$%' ORDER BY 4,2;

VALID 85215 TABLE EXPIMP.SYS_EXPORT_TABLE_02
VALID 85162 TABLE EXPIMP.SYS_EXPORT_FULL_01

Dropper les Master tables concernés:

SQL> DROP TABLE EXPIMP.sys_export_table_02;

SQL> DROP TABLE EXPIMP.sys_export_full_01;

Killer un job datapump non interactif proprement

Réf: Metalink Doc ID: 336014.1

SQL> SET lines 200

COL owner_name FORMAT a10

COL job_name FORMAT a20

COL state FORMAT a11

COL operation LIKE state

COL job_mode LIKE state

SQL> SELECT owner_name, job_name, operation, job_mode, state, attached_sessions FROM dba_datapump_jobs WHERE job_name NOT LIKE 'BIN$%';

EXPIMP SYS_EXPORT_FULL_05 EXPORT FULL RUNNING 0

SQL> connect expimp/expimp

SQL> DECLARE h1 number;

  • BEGIN
  • h1 := DBMS_DATAPUMP.ATTACH('SYS_EXPORT_FULL_05','EXPIMP');
  • DBMS_DATAPUMP.STOP_JOB (h1);
  • END;

/

La session passe en "STOP PENDING" pendant un certain temps, puis en "NOT RUNNING"

Correspondance volumes ASM ORACLE , disks et device côté Linux:

/etc/init.d/oracleasm listdisks

VOL1

VOL2

export $ORACLE_SID=+ASM

sqlplus / as sysdba

SQL> show parameter asm_diskstring asm_disk

string string /dev/oracleasm/disks/*

SQL> select path from v$asm_disk;

/dev/oracleasm/disks/VOL1

ls -lsa /dev/oracleasm/disks total 0

  • 0 drwxr-xr-x 1 root root 0 avr 18 12:51 .
  • 0 drwxr-xr-x 1 root root 0 avr 18 12:51 ..
  • 0 brw-rw 1 oracle dba 8, 81 avr 18 12:51 VOL1
  • 0 brw-rw 1 oracle dba 8, 97 avr 18 12:51 VOL2

Voir le major/minor (ex:8,81) et les trouver dans /dev:

ls -lsa /dev |grep " 8,"

  • 0 brw-rw 1 root floppy 8, 80 Jun 24 2004 sdf

    0 brw-rw 1 root disk 8, 81 Jun 24 2004 sdf1 --> VOL1 est monté sur /dev/sdf1

  • 0 brw-rw 1 root disk 8, 90 Jun 24 2004 sdf10
Ou cat /proc/partitions -> voir le major/minor

mardi 24 février 2009

Démarrage verbeux de Solaris 10

Note: The english translation of this note can be found here

Par défaut, le démarrage de Solaris 10 se fait en mode silencieux. En d'autres termes, vous ne voyez plus le log de démarrage sur la console.


Ce comportement, issu de l'utilisation de svcadm, peut etre aisément modifié avec l'aide de la commande svccfg.

Mise en place du démarrage verbeux sous Solaris 10:

  # /usr/sbin/svccfg -s system/svc/restarter:default
  svc:/system/svc/restarter:default> addpg options application
  svc:/system/svc/restarter:default> setprop options/logging = astring: verbose
  svc:/system/svc/restarter:default> listprop
...
options/logging            astring  verbose
...

  svc:/system/svc/restarter:default> exit

Retour au démarrage silencieux sous Solaris 10:

  # svccfg -s system/svc/restarter:default
  svc:/system/svc/restarter:default> delpg options
  svc:/system/svc/restarter:default> listprop
  svc:/system/svc/restarter:default> exit


Laissez-moi une note si cet article vous a été utile.

Bonne journée.


Nixman

vendredi 30 janvier 2009

OS and Browser Statistics

DECEMBER 2008:


Operating systems:

Windows


745
93%
Linux


42
5.2%
Macintosh


12
1.5%
SunOS


2
0.2%


Browsers:

Explorer


302

40%
Firefox


263

34.8%
Explorer x.x


137

18.1%
Opera


21

2.8%
Safari


15

2%
Explorer 5.x


8

1.1%
Other Mozilla


6

0.8%
Explorer 4.x


2

0.3%
Konqueror


1

0.1%

- page 1 de 2