RMAN-Katalogdatenbank erstellen

Bevor es so richtig losgeht, muss erstmal ein RMAN-Katalog mit dem passenden Nutzer erstellt werden. Dieses ist der erste Teil der Anleitung und im folgenden beschrieben.

Katalog anlegen

export ORACLE_SID=cat sqlplus /nolog

SQL*Plus: Release 11.1.0.6.0 - Production on Sat Sep 26 12:37:25 2009 Copyright (c) 1982, 2007, Oracle.  All rights reserved.

conn / as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started. Total System Global Area  418484224 bytes Fixed Size                  1300324 bytes Variable Size             310380700 bytes Database Buffers          100663296 bytes Redo Buffers                6139904 bytes Datenbank mounted. Datenbank geoffnet.

SQL> CREATE TABLESPACE rcat_ts DATAFILE '/opt/app/oracle/oradata/cat/rman_ts.dbf' SIZE 50M;

Tablespace wurde angelegt.

SQL> CREATE USER rcat IDENTIFIED BY oracle DEFAULT TABLESPACE rcat_ts QUOTA UNLIMITED ON rcat_ts;

Benutzer wurde erstellt.

SQL> GRANT recovery_catalog_owner TO rcat;

Benutzerzugriff (Grant) wurde erteilt.

Um die gesetzen Privilegien zu sehen, kann folgender Befehl in der SQL-Konsole abgesetzt werden: SQL> SELECT * FROM session_privs;

Mittels des altbekannten exit verlässt man dann wieder die Konsole: SQL> EXIT

Verbindung zu Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options beendet

Nun verbindet man sich mit dem RMAN, dem man gleich die Daten des neu erstellten Katalogs mitgibt. export ORACLE_SID=orcl rman catalog rcat/oracle@cat

Recovery Manager: Release 11.1.0.6.0 - Production on Sat Sep 26 12:52:59 2009 Copyright (c) 1982, 2007, Oracle.  All rights reserved. connected to recovery catalog database

RMAN> create catalog;

recovery catalog created

RMAN> exit

Recovery Manager complete.

rman target / catalog rcat/oracle@cat

Recovery Manager: Release 11.1.0.6.0 - Production on Sat Sep 26 12:57:29 2009 Copyright (c) 1982, 2007, Oracle.  All rights reserved. connected to target database: ORCL (DBID=1217756087) connected to recovery catalog database

RMAN> register database;

database registered in recovery catalog starting full resync of recovery catalog full resync complete

RMAN> report schema;

Report of database schema for database with db_unique_name ORCL

List of Permanent Datafiles File Size(MB) Tablespace           RB segs Datafile Name 1    700      SYSTEM               YES     /opt/app/oracle/oradata/orcl/system01.dbf 2    669      SYSAUX               NO      /opt/app/oracle/oradata/orcl/sysaux01.dbf 3    100      UNDOTBS1             YES     /opt/app/oracle/oradata/orcl/undotbs01.dbf 4    5        USERS                NO      /opt/app/oracle/oradata/orcl/users01.dbf 5    100      EXAMPLE              NO      /opt/app/oracle/oradata/orcl/example01.dbf

List of Temporary Files File Size(MB) Tablespace           Maxsize(MB) Tempfile Name 1    28       TEMP                 32767       /opt/app/oracle/oradata/orcl/temp01.dbf

RMAN> resync catalog;

starting full resync of recovery catalog full resync complete

RMAN> report schema;

Report of database schema for database with db_unique_name ORCL

List of Permanent Datafiles File Size(MB) Tablespace           RB segs Datafile Name 1    700      SYSTEM               YES     /opt/app/oracle/oradata/orcl/system01.dbf 2    669      SYSAUX               NO      /opt/app/oracle/oradata/orcl/sysaux01.dbf 3    100      UNDOTBS1             YES     /opt/app/oracle/oradata/orcl/undotbs01.dbf 4    5        USERS                NO      /opt/app/oracle/oradata/orcl/users01.dbf 5    100      EXAMPLE              NO      /opt/app/oracle/oradata/orcl/example01.dbf

List of Temporary Files File Size(MB) Tablespace           Maxsize(MB) Tempfile Name 1    28       TEMP                 32767       /opt/app/oracle/oradata/orcl/temp01.dbf

RMAN> exit