Rman backup script set

Source: Internet
Author: User

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.

  1. Nbrbdb1 $ [/archivelog] more backup_log.sh
  2. #! /Bin/sh
  3. # Set env
  4. Export Oracle_HOME =/oracle/product/10.2.0/db_1
  5. Export ORACLE_SID = orcl1
  6. Export PATH = $ PATH: $ ORACLE_HOME/db_1/bin:/sbin:/usr/sbin
  7. Echo "------------------------------- start -----------------------------"; date
  8. # Backup start
  9. $ ORACLE_HOME/bin/rman <EOF
  10. Connect target
  11. Delete noprompt obsolete;
  12. Run {
  13. Allocate channel c3 type disk connect 'sys/oracle @ orcl1 ';
  14. Allocate channel c4 type disk connect 'sys/oracle @ orcl2 ';
  15. SQL 'alter system archive log current ';
  16. Backup archivelog all delete input format'/archivelog/rman/% U. bak 'filesperset = 5;
  17. Release channel c3;
  18. Release channel c4;
  19. }
  20. Exit;
  21. EOF
  22. 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.

  1. # Backup start
  2. $ ORACLE_HOME/bin/rman <EOF
  3. Connect target
  4. Run {
  5. Configure controlfile autobackup on;
  6. Configure controlfile autobackup format device type disk to '/backup/controlfile/% F ';
  7. Allocate channel cannel1 type disk connect 'sys/oracle @ rac1 ';
  8. Allocate channel cannel2 type disk connect 'sys/oracle @ rac2 ';
  9. Set limit channel cannel1 kbytes 2000000;
  10. Set limit channel cannel2 kbytes 2000000;
  11. Backup incremental level 0 database tag 'fullbak _ level0 'format'/backup/database/full_level0 _ % U ';
  12. Release channel cannel1;
  13. Release channel cannel2;
  14. }
  15. Exit;
  16. EOF
  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.