Using variables in RMAN scripts

Ever wanted to use variables in your RMAN scripts? Until and including 10g R2 this was impossible. Starting with 11g R1 it is possible.

Lets me show you a short example how to do it:

First we create a simple (and imcomplete) script with the following content:

connect target /
backup &1;

The variable “&1” will be replaced with the first command line argument supplied on the command line. “&2” is the second argument and so on.

Suppose we want to backup our database we start RMAN with:

-bash-3.2$ rman target / @test.scr USING \"database\"

The resulting output will be:

Recovery Manager: Release 11.2.0.1.0 - Production on Mon Aug 2 08:16:07 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORA11R2P (DBID=2658288218)
RMAN> backup database;
2>
Starting backup at 02-AUG-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=148 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/oradata/ORA11R2P/system01.dbf
input datafile file number=00002 name=/u01/oradata/ORA11R2P/sysaux01.dbf
input datafile file number=00003 name=/u01/oradata/ORA11R2P/undotbs01.dbf
input datafile file number=00005 name=/u01/oradata/ORA11R2P/testneu.dbf
input datafile file number=00004 name=/u01/oradata/ORA11R2P/users01.dbf
channel ORA_DISK_1: starting piece 1 at 02-AUG-10

As you can see in the bold line RMAN replaced the variable with the first argument specified on the command line (“database”).

With this method you can create powerful and yet simple scripts for backing up your database.

Posted in Oracle in general | Leave a comment

Tuning Linux for Oracle

This is a short post on how to tune Linux for running Oracle.

It wont cover the background directly but i am trying to give some links with further informations.

I am planning to improve it over the time.

Currently this article covers:

  • Partition Alignment
  • Choosing a file system
  • Optimizing ext3
  • Enable Huge Pages
  • Using Async and Direct IO
  • Tune Swapping Priority

Continue reading

Posted in Oracle in general | 5 Comments

Bye bye Oracle 10g Release 2

With end of July 2010 support for Oracle 10g Release 2 ends. You can order (at additional costs of course) so called extended support to get support until July 2011. After this date there is so called “Sustaining Support” which offers support for several more years.

Update: I was told the first year of Extended Support is free of charge (Thanks Martin!). So customers have a little bit more time to test and upgrade.

See the following picture for the support end dates:

So if you start with new projects i´d strongly recommend to use Oracle 11g Release 2 at best or if 11g R2 is not an options 11g R1.

Posted in Oracle in general | 6 Comments

Patch News – Oracle Patchset 10.2.0.5.0 released

I just found Oracle released 10.2.0.5.0 patchset for the following platforms:

  • Linux x86_64
  • Linux x86

See Doc ID 1088172.1 for a list of fixed problems.

Posted in Oracle in general | 1 Comment

Oracle 11g R2: Deferred Segment Creation + imp + table with LOB column = Bug

This is a short posting about an error i found today.

This errors prevents the import of tables with lob columns when using traditional import, deferred segment creation and an altered tablespace name.

For this i created a test case in which we

  1. In the source database (10.2.0.4.0 on 64-bit Linux):
    1. create a user named TEST1 having a default tablespace named TEST1
    2. create a small table with a CLOB in it
    3. export the schema with traditional import
    4. transfer the dump to the destination database
  2. In the destination database (11.2.0.1.0 on 64-bit Linux)
    1. create a user names TESTNEU with a default tablespace TESTNEU
      NOTE: There is no tablespace TEST1 in the destination database; this is important
    2. trying to import the table… hitting a bug documented below in detail

Note: While blogging this for a fried i was in hurry; i will rewrite some paragraphs with evening… but the problem should become clear while reading…

Continue reading

Posted in Oracle in general | 2 Comments

ASM Volumes on thin-provisioned SAN dirtying all blocks?

Some time ago i´ve seen a discussion on OTN about ASM and thin provisioned volumes.

Hi there, sorry for the x-post from database-general but it was suggested that I do so.
Anyhow, we've got 11g (11.1.0.7 with the 6851110 ASM patch recently applied) running on
OEL 5 x86_64, with ASM connected to a raw, thin-provisioned ISCSI volume partitioned for
+DATA and +FRA, and in every case where we do so, the SAN device reports within a few
weeks that the whole volume has been allocated even though the DB (configured with
autoextend on) is only holding about one tenth of the amount of available space on the
device. What this means in systems terms is that somehow ASM is marking writes to nearly
every block on the drive if only momentarily.
In the original thread, there was speculation that a process of indexing AUs has led to
the dirtying of the whole volume, but this would make more sense if the whole disk had been
allocated immediately rather than over the course of a few weeks. My question is: what else
could account for this behavior, and what steps can I take to help ensure that ASM behaves
correctly in a thin-provisioned volume? (by "correctly" I mean writes contiguous blocks of
data and doesn't dirty the whole thing)

Yesterday i had some spare time available to dig a little bit deeper. I had a Windows-based system at hand and performed some smaller tests.

Continue reading

Posted in Oracle in general | Leave a comment

11g Release 2 for Windows – Single Database Installation Guide

The following illustrates the installation of Oracle 11g Release 2 database on Windows. Installation is quite straight forward.

Before installing the database you can optionally install grid infrastructure which offers some nice feature – for instance Oracle Restart and ASM. The install guide for grid infrastructure can be found here.

Continue reading

Posted in Oracle in general | Leave a comment

11g Release 2 for Windows – Grid Infrastructure Installation for Single Databases

The following pictures show the grid infrastructure installation of Oracle 11g Release 2 for Windows. This is a rather short posting without much text because the pictures are quite self-explaining.

Requirements

Windows

Note there is no grid infrastructure or ASM for 32-bit Windows!

According to the documentation the following Windows versions are certified for Oracle 11g Release 2:

  • Windows Server 2003 x64 with service pack 1 or higher.
  • Windows Server 2003 R2 x64
  • Windows Server 2008 x64 Standard, Enterprise, Datacenter, Web, and Foundation editions.
  • Windows Server 2008 R2 x64 Standard, Enterprise, Datacenter, Web, and Foundation editions

Windows Core Editions are NOT supported!

Storage

For storing your database you can use the following storage options:

  • plain file system (NTFS recommended or FAT)
  • ASM
  • Oracle NFS for Windows

In this guide we are using ASM for storing our data files.

Continue reading

Posted in Oracle in general | 8 Comments

11g Release 2 for Windows – Grid Infrastructure Installation Buggy?

I just tried installing Oracle 11g Relese 2 on Windows 2008 R2 64-bit and Windows 2008. The system were installed with Windows 2008 and 2008 R2 standard edition 64-bit on a VMWARE server with 4 core with two core assigned to each virtual machine.

Until now i was unable to install it successfully. It always failed with:

[INS-20802] Grid Infrastructure Configuration failed

This is a short blog post about my findinds. Maybe someone else experience this issue as well  and leaves a comment.

Continue reading

Posted in Oracle in general | 59 Comments

Using EMC (formerly Legato) Networker with Opensolaris

I have written an guest article (direct link) for Preston de Guises fine blog on how to use networker client on opensolaris.

Posted in Oracle in general | Leave a comment