Topics: Use of the RMAN
commands
|
More Resources by
Google: |
|
|
|
|
Hands-On 02 (Use of
the RMAN commands)
You, as a DBA, are
responsible for registering a database, synchronizing a database, and backing-up
a database. Your job’s responsibilities dictate that you should at least be
informed of the following basic fundamental subjects:
Connecting to the
RMAN tool
Using the source
and the target database commands
Registering a
database
Synchronizing a
catalog
Creating a snapshot
of a controlfile
Backing up a
database
Backing up a
datafile
Backing up the
current controlfile
Commands:
DOS>
CATALOG TARGET
RMAN> register database;
RMAN>
resync catalog;
RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO
RMAN> BACKUP DATAFILE
RMAN>
BACKUP CURRENT CONTROLFILE;
RMAN>
exit;
-- Hands-On 02 (Use of the RMAN commands)
-- Preparation
SET ECHO ON
SET linesize 1000 pagesize 55
COL name FORMAT a30
col description format a30
pause
--Start
CLEAR SCR
-- In this exercise you will learn how to connect to the RMAN
-- utility tool using the source and the target database commands.
-- We will also learn how to register a database, resync a catalog,
-- create a snapshot of a controlfile, backup a database,
-- backup a datafile, and backup the current controlfile.
-- Now, begin by connect to the SCHOOL database as the SYSTEM/MANAGER
-- user.
pause
CONNECT system/manager@school AS SYSDBA
pause
CLEAR SCR
-- Query the DBA_DATA_FILES dictionary view.
pause
SELECT file_id, tablespace_name, bytes
FROM dba_data_files
/
-- Note the TOOLS tablespace's file id.
-- We will use it on our following steps.
pause
CLEAR SCR
-- Go back to RMAN and connect to the SCHOOL database as
-- target database and the RMAN database as a repository.
--\/-- DOS> rman CATALOG rman/password@dbs4rman TARGET system/manager@school
pause
pause
-- Then register the school database.
--\/-- rman> register database;
pause
pause
-- Now, resync the recovery catalog with the database control file.
--\/-- rman> resync catalog;
pause
pause
-- Issue a command to create a snapshot of the control file.
--\/-- rman> CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'c:\newfolder\snape01.snp';
pause
pause
-- Backup the TOOLS datafile that you took a note about it.
-- We will use the datafile number 7.
--\/-- rman> BACKUP DATAFILE 7;
pause
pause
-- Use the pre-allocated channel to backup the current control file.
--\/-- rman> BACKUP CURRENT CONTROLFILE;
pause
pause
-- Notice that the default backup destination is %ORACLE_HOEM%\database.
-- Exit the Recovery Manager.
-- rman> exit;
pause
pause
CLEAR SCR
-- Now, you should practice this Hands-On exercise.
-- For more information about the subject, you are encouraged
-- to read from a wide selection of available books.
-- Good luck.
--
pause
pause
|