Backup is a top priority for DBAs. No matter how powerful your technology is and there is no backup, you are still helpless when something goes wrong.
Here is just the BACKUP command summarized in the work. The scripts collected in the future will be continuously updated ......
1. In the RAC environment, if the archivelog of the two nodes are stored locally, how can I perform the backup?
Enable the two channels and connect them to the two instances using the TNS connection string for backup. This means that a backup script is enabled but executed on both nodes at the same time. Note: You need to configure the tnsnames file. Otherwise, you cannot find another node.
- Nbrbdb1 $ [/archivelog] more backup_log.sh
- #! /Bin/sh
- # Set env
- Export Oracle_HOME =/oracle/product/10.2.0/db_1
- Export ORACLE_SID = orcl1
- Export PATH = $ PATH: $ ORACLE_HOME/db_1/bin:/sbin:/usr/sbin
- Echo "------------------------------- start -----------------------------"; date
- # Backup start
- $ ORACLE_HOME/bin/rman <EOF
- Connect target
- Delete noprompt obsolete;
- Run {
- Allocate channel c3 type disk connect 'sys/oracle @ orcl1 ';
- Allocate channel c4 type disk connect 'sys/oracle @ orcl2 ';
- SQL 'alter system archive log current ';
- Backup archivelog all delete input format'/archivelog/rman/% U. bak 'filesperset = 5;
- Release channel c3;
- Release channel c4;
- }
- Exit;
- EOF
- Echo "------------------------------ end ------------------------------"; date
2. What if the operating system limits the size of a single file during backup?
Set the size of a single file generated by the channel during backup. In the following example, the size is set to 2 GB.
- # Backup start
- $ ORACLE_HOME/bin/rman <EOF
- Connect target
- Run {
- Configure controlfile autobackup on;
- Configure controlfile autobackup format device type disk to '/backup/controlfile/% F ';
- Allocate channel cannel1 type disk connect 'sys/oracle @ rac1 ';
- Allocate channel cannel2 type disk connect 'sys/oracle @ rac2 ';
- Set limit channel cannel1 kbytes 2000000;
- Set limit channel cannel2 kbytes 2000000;
- Backup incremental level 0 database tag 'fullbak _ level0 'format'/backup/database/full_level0 _ % U ';
- Release channel cannel1;
- Release channel cannel2;
- }
- Exit;
- EOF