Lab-03-Using RMAN
Lab-03-Using RMAN
Overview
In these practices, you will verify the default backup destination, set the RMAN display data and
time format, verify that control file autobackup is configured, and verify the backup retention
policy.
Overview
In this practice, you determine the default backup destination setting and create a backup in the
default location.
Timing Estimate
It should take approximately 5 minutes to complete this practice.
Tasks
1. Open a terminal window and run the setup03-01.sh script to prepare the environment for
this practice.
SQL> exit
$
3. Log in to RMAN, execute the BACKUP DATABASE command, and then exit RMAN.
$ rman target "'/ as sysbackup'"
…
RMAN> BACKUP DATABASE;
Starting backup at 18-JUN-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
…
Finished backup at 18-JUN-19
…
Overview
In this practice, you set the date/time format that RMAN uses for displaying time stamps. The
default date format does not include the time of day information. You will be performing several
backups and recoveries in the same day, and in some cases, you will need to determine which
backup to use.
Assumptions
You completed Practice 3-1.
Timing Estimate
Tasks
1. (Catchup Step) If you skipped the Practice 3-1, run the prep03-02.sh script and then
proceed to step 3, otherwise proceed to step 2.
$ /home/oracle/labs/admin/prep03-02.sh
...
$
2. Open a terminal window to run the setup03-02.sh script to prepare the environment for
this practice.
$ /home/oracle/labs/admin/setup03-02.sh
$
3. Open a new terminal window to set the NLS_LANG and NLS_DATE_FORMAT variables so
that RMAN includes time information in any time stamp values.
Use the editor of your choice (vi, gedit) and add the following two lines to the end of the
~oracle/.bashrc file:
export NLS_LANG=american_america.al32utf8
export NLS_DATE_FORMAT="yyyy-mm-dd:hh24:mi:ss"
a. In a terminal window, invoke your editor. This example uses the gedit editor.
$ gedit ~oracle/.bashrc
b. Copy and paste by using the mouse buttons and icons in the editor, save your changes,
and then close the gedit window.
Note: If you are not copying and pasting the variables, double-check that the
NLS_LANG value is written correctly with a letter “l”, not a digit “1”.
c. View the modified file by using the cat command and apply the new settings.
$ cat ~oracle/.bashrc
# .bashrc
$ . /home/oracle/.bashrc
$
4. Verify the settings by starting RMAN and listing the backups in the recovery catalog or from
the control file.
a. Log in to RMAN.
$ rman target "'/ as sysbackup'"
…
connected to target database: ORCLCDB (DBID=2778750799)
Overview
In this practice, you configure or confirm RMAN settings for the following tasks:
To back up the control file and server parameter file (SPFILE) each time RMAN takes a
backup of anything in the orclcdb database
To ensure that one redundant backup is kept
Then you perform a tablespace backup to verify these settings.
Timing Estimate
It should take approximately 5 minutes to complete this practice.
RMAN>
2. View the current retention policy setting to verify that it is set to 1.
RMAN> show retention policy;
RMAN>
3. Determine which data file belongs to the USERS tablespace in ORCLPDB1.
RMAN> REPORT SCHEMA;
Report of database schema for database with db_unique_name
ORCLCDB
RMAN>
4. Back up the USERS tablespace in both the CDB and ORCLPDB1.
RMAN>
5. Exit RMAN.
RMAN> exit