Irrelevant thoughts of an oracle DBA

17 February 2008

Gunnar

Filed under: personal — dhoogfr @ 13:52

Hello World,

My name is Gunnar D’Hooge, and I’m Freek and Edda’s son.
I just dropped by to inform you all of my birth on 14, Februari.
Yes, I’m feeling well, thank you.

I’m looking forward to start working with Oracle, but my dad told me I will still have to wait a couple of years before I can start working on a pc.
I was really sad when I heard this, so dad bought me a special lamp. It has the shape of a penguin. Not sure what this means, but I’m sure it is important.

Anyway, here you have a picture of me. Ain’t I cute?

gunnar

4 February 2008

rman backup to tape when you don’t have a tape

Filed under: backup — dhoogfr @ 23:14

Something I already knew for a couple of years, but recently rediscovered it: rman has the possibility to mimic a backup to tape.
You can do this by specifying the oracle test disk api when allocating the channel:

[oracle@ragna oracle]$ cd /opt/oracle
[oracle@ragna oracle]$ mkdir tape_backup
[oracle@ragna oracle]$ export ORACLE_SID=LOKI
[oracle@ragna oracle]$ rman target / nocatalog

Recovery Manager: Release 10.2.0.3.0 - Production on Mon Feb 4 21:04:33 2008

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

connected to target database: LOKI (DBID=2591136617)
using target database control file instead of recovery catalog

RMAN> run {
 allocate channel ch00 device type 'SBT_TAPE'
    PARMS="SBT_LIBRARY=oracle.disksbt,
    ENV=(BACKUP_DIR=/opt/oracle/tape_backup)";
 backup datafile 1 format='%U';
}
2> 3> 4> 5> 6>
allocated channel: ch00
channel ch00: sid=140 devtype=SBT_TAPE
channel ch00: WARNING: Oracle Test Disk API

Starting backup at 04-FEB-08
channel ch00: starting full datafile backupset
channel ch00: specifying datafile(s) in backupset
input datafile fno=00001 name=/opt/oracle/oradata/LOKI/system01.dbf
channel ch00: starting piece 1 at 04-FEB-08
channel ch00: finished piece 1 at 04-FEB-08
piece handle=1dj7t4rb_1_1 tag=TAG20080204T210443 comment=API Version 2.0,MMS Version 8.1.3.0
channel ch00: backup set complete, elapsed time: 00:00:25
channel ch00: starting full datafile backupset
channel ch00: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ch00: starting piece 1 at 04-FEB-08
channel ch00: finished piece 1 at 04-FEB-08
piece handle=1ej7t4s4_1_1 tag=TAG20080204T210443 comment=API Version 2.0,MMS Version 8.1.3.0
channel ch00: backup set complete, elapsed time: 00:00:06
Finished backup at 04-FEB-08
released channel: ch00

RMAN> list backup;

List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
36      Full    346.25M    SBT_TAPE    00:00:23     04-FEB-08
        BP Key: 36   Status: AVAILABLE  Compressed: NO  Tag: TAG20080204T210443
        Handle: 1dj7t4rb_1_1   Media:
  List of Datafiles in backup set 36
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 2854789    04-FEB-08 /opt/oracle/oradata/LOKI/system01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
37      Full    8.75M      SBT_TAPE    00:00:04     04-FEB-08
        BP Key: 37   Status: AVAILABLE  Compressed: NO  Tag: TAG20080204T210443
        Handle: 1ej7t4s4_1_1   Media:
  Control File Included: Ckp SCN: 2854804      Ckp time: 04-FEB-08
  SPFILE Included: Modification time: 04-FEB-08

RMAN> exit

Recovery Manager complete.
[oracle@ragna oracle]$ ls -lhd tape_backup/
drwxr-xr-x  2 oracle oinstall 4.0K Feb  4 21:05 tape_backup/
[oracle@ragna oracle]$ ls -lh tape_backup/
total 356M
-rw-rw-rw-  1 oracle oinstall 347M Feb  4 21:05 1dj7t4rb_1_1
-rw-rw-rw-  1 oracle oinstall 8.8M Feb  4 21:05 1ej7t4s4_1_1
-rw-r--r--  1 oracle oinstall 2.0K Feb  4 21:05 Oracle_Disk_SBT_Catalog

Neat isn’t it?
But what can you use it for, I hear you say?
Well, euh…..  Testing I suppose or maybe for learning purposes. I’m sure someone might know a good use for it.

Blog at WordPress.com.