In this post we are going to discuss RMAN disk backup and how to list the same.
consider database name is :ASGARD
We will see example how to take RMAN full backup of database with archive log mode on.
Check if ARCHIVELOG mode is on
run
{
allocate channel ch1 type disk format '/u01/rman_backup/full_rman_disk1_ASGARD_%U.bck' maxpiecesize 10240M;
allocate channel ch2 type disk format '/u01/rman_backup/full_rman_disk2_ASGARD_%U.bck' maxpiecesize 10240M;
backup incremental level 0 database tag = full_rman_disk;
sql 'alter system archive log current';
release channel ch1;
release channel ch2;
allocate channel ch3 type disk format '/u01/rman_backup/arch_backup_disk3_ASGARD_%U.bck' maxpiecesize 10240M;
backup archivelog from logseq 404;
backup current controlfile format '/u01/rman_backup/ctrl_backup_disk4_ASGARD_%U.bck';
release channel ch3;
}
shell script to call above command file
vi rman_disk_bkp_ASGARD_20Nov2018.sh
rman target / cmdfile=rman_disk_bkp_ASGARD_20Nov2018.rcv log=rman_disk_bkp_ASGARD_20Nov2018.log
Check if any syntactical error
$ rman checksyntax@rman_disk_bkp_ASGARD_20Nov2018.rcv
Recovery Manager: Release 11.2.0.4.0 - Production on Tue Nov 20 02:25:58 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
RMAN> run
2> {
3> allocate channel ch1 type disk format '/u01/rman_backup/full_rman_disk1_ASGARD_%U.bck' maxpiecesize 10240M;
4> allocate channel ch2 type disk format '/u01/rman_backup/full_rman_disk2_ASGARD_%U.bck' maxpiecesize 10240M;
5> backup incremental level 0 database tag = full_rman_disk;
6> sql 'alter system archive log current';
7> release channel ch1;
8> release channel ch2;
9> allocate channel ch3 type disk format '/u01/rman_backup/arch_backup_disk3_ASGARD_%U.bck' maxpiecesize 10240M;
10> backup archivelog from logseq 12404;
11> backup current controlfile format '/u01/rman_backup/ctrl_backup_disk4_ASGARD_%U.bck';
12> release channel ch3;
13> }
14>
The cmdfile has no syntax errors
Recovery Manager complete.
$
Now we need just need to execute the sh file.
$sh rman_disk_bkp_ASGARD_20Nov2018.sh &
once this backup is completed, we can check the same in RMAN client
Comment below if you need any additional info.
also check rman-backup-single-datafile-and-list
consider database name is :ASGARD
We will see example how to take RMAN full backup of database with archive log mode on.
Check if ARCHIVELOG mode is on
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/ASGARD/arch
Oldest online log sequence 404
Next log sequence to archive 406
Current log sequence 406
We need to create command file(rcv) and shell script to call command file
First create commandfile (this will take backup of datafiles, controlfile and archivelogs as well)
vi rman_disk_bkp_ASGARD_20Nov2018.rcv
{
allocate channel ch1 type disk format '/u01/rman_backup/full_rman_disk1_ASGARD_%U.bck' maxpiecesize 10240M;
allocate channel ch2 type disk format '/u01/rman_backup/full_rman_disk2_ASGARD_%U.bck' maxpiecesize 10240M;
backup incremental level 0 database tag = full_rman_disk;
sql 'alter system archive log current';
release channel ch1;
release channel ch2;
allocate channel ch3 type disk format '/u01/rman_backup/arch_backup_disk3_ASGARD_%U.bck' maxpiecesize 10240M;
backup archivelog from logseq 404;
backup current controlfile format '/u01/rman_backup/ctrl_backup_disk4_ASGARD_%U.bck';
release channel ch3;
}
shell script to call above command file
vi rman_disk_bkp_ASGARD_20Nov2018.sh
rman target / cmdfile=rman_disk_bkp_ASGARD_20Nov2018.rcv log=rman_disk_bkp_ASGARD_20Nov2018.log
Check if any syntactical error
$ rman checksyntax@rman_disk_bkp_ASGARD_20Nov2018.rcv
Recovery Manager: Release 11.2.0.4.0 - Production on Tue Nov 20 02:25:58 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
RMAN> run
2> {
3> allocate channel ch1 type disk format '/u01/rman_backup/full_rman_disk1_ASGARD_%U.bck' maxpiecesize 10240M;
4> allocate channel ch2 type disk format '/u01/rman_backup/full_rman_disk2_ASGARD_%U.bck' maxpiecesize 10240M;
5> backup incremental level 0 database tag = full_rman_disk;
6> sql 'alter system archive log current';
7> release channel ch1;
8> release channel ch2;
9> allocate channel ch3 type disk format '/u01/rman_backup/arch_backup_disk3_ASGARD_%U.bck' maxpiecesize 10240M;
10> backup archivelog from logseq 12404;
11> backup current controlfile format '/u01/rman_backup/ctrl_backup_disk4_ASGARD_%U.bck';
12> release channel ch3;
13> }
14>
The cmdfile has no syntax errors
Recovery Manager complete.
$
Now we need just need to execute the sh file.
$sh rman_disk_bkp_ASGARD_20Nov2018.sh &
once this backup is completed, we can check the same in RMAN client
$ rman target / nocatalog
Recovery Manager: Release 11.2.0.4.0 - Production on Tue Nov 20
02:35:57 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates.
All rights reserved.
connected to target database: ASGARD (DBID=2227813556)
using target database control file instead of recovery catalog
RMAN> LIST BACKUPSET TAG 'full_open_backup_disk';
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
19089 Incr 0 7.70M DISK 00:00:02 20-NOV-18
BP Key: 19089 Status: AVAILABLE Compressed: NO Tag: FULL_OPEN_BACKUP_DISK
Piece Name: /u01/rman_backup/rman_full_open_backup2_ASGARD_992656989_19415_1_untilfit_1_1.bck
List of Datafiles in backup set 19089
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
5 0 Incr 14718266652218 20-NOV-18 /u02/ASGARD/data/undotbs1_02.dbf
7 0 Incr 14718266652218 20-NOV-18 /u02/ASGARD/data/tools_01.dbf
9 0 Incr 14718266652218 20-NOV-18 /u02/ASGARD/data/perfstats_i1_01.dbf
10 0 Incr 14718266652218 20-NOV-18 /u02/ASGARD/data/sys_audit_d1_01.dbf
11 0 Incr 14718266652218 20-NOV-18 /u02/ASGARD/data/db_qts01.dbf
12 0 Incr 14718266652218 20-NOV-18 /u02/ASGARD/data/db_qts02.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
19090 Incr 0 46.39M DISK 00:00:02 20-NOV-18
BP Key: 19090 Status: AVAILABLE Compressed: NO Tag: FULL_OPEN_BACKUP_DISK
Piece Name: /u01/rman_backup/rman_full_open_backup2_ASGARD_992656993_19416_1_uotilfj1_1_1.bck
Control File Included: Ckp SCN: 14718266652220 Ckp time: 20-NOV-18
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
19091 Incr 0 80.00K DISK 00:00:00 20-NOV-18
BP Key: 19091 Status: AVAILABLE Compressed: NO Tag: FULL_OPEN_BACKUP_DISK
Piece Name: /u01/rman_backup/rman_full_open_backup2_ASGARD_992656997_19417_1_uptilfj5_1_1.bck
SPFILE Included: Modification time: 11-JUL-18
SPFILE db_unique_name: ASGARD
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
19092 Incr 0 7.86G DISK 00:01:54 20-NOV-18
BP Key: 19092 Status: AVAILABLE Compressed: NO Tag: FULL_OPEN_BACKUP_DISK
Piece Name: /u01/rman_backup/rman_full_open_backup1_ASGARD_992656989_19414_1_umtilfit_1_1.bck
List of Datafiles in backup set 19092
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 0 Incr 14718266652216 20-NOV-18 /u01/ASGARD/data/system_01.dbf
2 0 Incr 14718266652216 20-NOV-18 /u02/ASGARD/data/sysaux_01.dbf
3 0 Incr 14718266652216 20-NOV-18 /u03/ASGARD/data/sysaux_02.dbf
4 0 Incr 14718266652216 20-NOV-18 /u01/ASGARD/data/undotbs1_01.dbf
6 0 Incr 14718266652216 20-NOV-18 /u01/ASGARD/data/users_01.dbf
8 0 Incr 14718266652216 20-NOV-18 /u03/ASGARD/data/perfstats_d1_01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
19095 Incr 0 7.70M DISK 00:00:00 20-NOV-18
BP Key: 19095 Status: AVAILABLE Compressed: NO Tag: FULL_OPEN_BACKUP_DISK
Piece Name: /u01/rman_backup/rman_full_open_backup2_992657412_19421_1_uttilg04_1_1.bck
List of Datafiles in backup set 19095
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
5 0 Incr 14718266652461 20-NOV-18 /u02/ASGARD/data/undotbs1_02.dbf
7 0 Incr 14718266652461 20-NOV-18 /u02/ASGARD/data/tools_01.dbf
9 0 Incr 14718266652461 20-NOV-18 /u04/ASGARD/data/perfstats_i1_01.dbf
10 0 Incr 14718266652461 20-NOV-18 /u01/ASGARD/data/sys_audit_d1_01.dbf
11 0 Incr 14718266652461 20-NOV-18 /u01/ASGARD/data/db_qts01.dbf
12 0 Incr 14718266652461 20-NOV-18 /u01/ASGARD/data/db_qts02.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
19096 Incr 0 46.39M DISK 00:00:02 20-NOV-18
BP Key: 19096 Status: AVAILABLE Compressed: NO Tag: FULL_OPEN_BACKUP_DISK
Piece Name: /u01/rman_backup/rman_full_open_backup2_ASGARD_992657413_19422_1_uutilg05_1_1.bck
Control File Included: Ckp SCN: 14718266652462 Ckp time: 20-NOV-18
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
19097 Incr 0 80.00K DISK 00:00:01 20-NOV-18
BP Key: 19097 Status: AVAILABLE Compressed: NO Tag: FULL_OPEN_BACKUP_DISK
Piece Name: /u01/rman_backup/rman_full_open_backup2_ASGARD_992657417_19423_1_uvtilg09_1_1.bck
SPFILE Included: Modification time: 11-JUL-18
SPFILE db_unique_name: ASGARD
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
19098 Incr 0 7.86G DISK 00:01:14 20-NOV-18
BP Key: 19098 Status: AVAILABLE Compressed: NO Tag: FULL_OPEN_BACKUP_DISK
Piece Name: /u01/rman_backup/rman_full_open_backup1_ASGARD_992657412_19420_1_ustilg04_1_1.bck
List of Datafiles in backup set 19098
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 0 Incr 14718266652459 20-NOV-18 /u01/ASGARD/data/system_01.dbf
2 0 Incr 14718266652459 20-NOV-18 /u02/ASGARD/data/sysaux_01.dbf
3 0 Incr 14718266652459 20-NOV-18 /u03/ASGARD/data/sysaux_02.dbf
4 0 Incr 14718266652459 20-NOV-18 /u01/ASGARD/data/undotbs1_01.dbf
6 0 Incr 14718266652459 20-NOV-18 /u01/ASGARD/data/users_01.dbf
8 0 Incr 14718266652459 20-NOV-18 /u03/ASGARD/data/perfstats_d1_01.dbf
RMAN>
Comment below if you need any additional info.
also check rman-backup-single-datafile-and-list
0 comments:
Post a Comment