Professional Documents
Culture Documents
RMAN
RMAN
RMAN
Incremental backups
Backup of block level changes to database made after previous
incremental/full backup. can be level 0 or level 1.
“level 1? Incremental backup- This backs up database block changes after previous
incremental backup. If there is no level 0 incremental backup and you run
level 1 incremental backup, RMAN will automatically make level 0
incremental backup.
Image Copies
Tablespace Backups
A tablespace backup is a subset of the database. Tablespace backups are
only valid if the database is operating in ARCHIVELOG mode. The only time
a tablespace backup is valid for a database running in NOARCHIVELOG mode
is when that tablespace is read-only or offline-normal.
Datafile Backups
A datafile backup is a backup of a single datafile. Datafile backups,
which are not as common as tablespace backups and are only valid if the
database is run in ARCHIVELOG mode. The only time a datafile backup is
valid for a database running in NOARCHIVELOG mode is if that datafile is
the only file in a tablespace. For example, the backup is a tablespace
backup, but the tablespace only contains one file and is read-only or
offline-normal.
To Connect to RMAN
[oracle@ue1usboxora501 ~] $ rman target /
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
The format clause allows the backup files to be directed to a specific location
For example:
BACKUP FORMAT '/u01/app/oracle/backup/%U' DATABASE;
Other format options are listed below.
Syntax
Element Description
%s Specifies the backup set number. This number is a counter in the control file that is incremented for each
backup set. The counter value starts at 1 and is unique for the lifetime of the control file. If you restore a
backup control file, then duplicate values can result. Also, CREATE CONTROLFILE initializes the counter back
to 1.
%t Specifies the backup set time stamp, which is a 4-byte value derived as the number of seconds elapsed
since a fixed reference time. You can use a combination of %s and %t to form a unique name for the backup
set.
%T Specifies the year, month, and day in the Gregorian calendar in this format: YYYYMMDD.
%u Specifies an 8-character name constituted by compressed representations of the backup set or image copy
number and the time the backup set or image copy was created.
The meaning of %U is different for image copies and backup pieces. For a backup piece, %U specifies a
convenient shorthand for %u_%p_%c that guarantees uniqueness in generated backup file names. For an
image copy of a data file, %Umeans the following:
data-D-%d_id-%I_TS-%N_FNO-%f_%u
arch-D_%d-id-%I_S-%e_T-%h_A-%a_%u
cf-D_%d-id-%I_%u
%% Specifies the percent (%) character. For example, %%Y translates to the string %Y.
One can do datafile backup by specifying file number also for that you need to
Check by:
SQL> SELECT file#, name FROM v$datafile;
After this
Differential - includes all changes since the last full or incremental backup
Cumulative - includes all changes since the last full backup
Differential backups require less space; Cumulative backups are faster to restore
CRONTAB - Crontab is a file which contains the schedule of cron entries to be run and at specified times. File
location varies by operating systems, See Crontab file location at the end of this document.
CRONTAB COMMANDS:
Crontab Entries:
For Reference im attaching Cron entries
CRONTAB
ENTRIES_TEXT FORMAT.txt
Please go through .txt file
purge_adr_logs.ksh
10 02 * * * /home/oracle/epsilon/scripts/statistics/gather_schema_stats.ksh -s
d1gmcc -e gmcc_ora_dba@epsilon.com -F -f d1gmcc_schemas.dat >
/home/oracle/epsilon/scripts/statistics/log/gather_schema_stats_d1gmcc.out 2>&1
For this supporting file is d1gmcc_schemas.dat and this should be present in dat folder.
10 2 * * * /home/oracle/epsilon/scripts/healthreports/health_check_d1gmcc.ksh >
/home/oracle/epsilon/scripts/healthreports/log/health_check_d1gmcc.log 2>&1
This entry is for health report on db from this we can know the SID name, Tablespace space, ASM Disk space,
full Backup history, Archive log Backup history, Top 5 SQL with highest I/O in last 24 Hrs etc.
Along with .ksh script two more .sql files are also required.
overall_check.sql perf_check.sql
Note: - LOG should be created. so that we can check for errors or warning in execution.