NBU Network Backup Encyclopedia of Oracle system Hot backup ____oracle

Source: Internet
Author: User
Tags oracle database

Learning and mastering how to use NBU to back up the file system is just the beginning for a data administrator. Because for most enterprises, buy NBU is mainly to back up the data of the enterprise database, protect the data security of the database, and then ensure the safe operation of the enterprise application. As a result, database backups for Oracle, DB2, and Sybase will be rolled out from this article. Brief Introduction to Oracle Backup: Simple in the way of backup, can be divided into logical backup, cold backup (offline backup), hot backup (online backup), in fact, cold backup and hot backup can also be called physical backup. According to the Backup tool, it can be divided into Exp/imp backup and Rman. Generally speaking, exp/imp is a good dump tool for Oracle, especially in small database dumps, table space migration, table extraction, detection logic and physical conflict and so on have very strong function. But currently the most widely available Oracle Backup Recovery tool is Rman. Rman is a database backup and recovery tool provided by Oracle, which makes it easy to make cold and hot backups of the database. In addition, some individual users will use the OS copy, but its disadvantage is that the footprint is large, and the content of the copy file is generally related to the system environment, transfer to other machines is not easy to recover, not the choice of enterprise users. In this article, we will describe how to use NBU and Oracle's Rman tools for hot backup of Oracle. Hot backups, also known as online (archivelog) backups, are OS-level data backups that are available when the database is open and effective for the user. The biggest difference between hot and cold backups is that the database does not need to be shut down for backup, and is suitable for 24x7 business type needs. Note that the author assumes that it is used to back up the Oracle system with NBU-cold backup, so that some basic configuration procedures are ignored in the narration, focusing on the difference between cold backup and hot backup. So if the details are not very clear to users, you can flip through the previous. Condition of hot backup: The user must set the database to Archivelog mode if a hot backup is required. After the user can log on to the database, the Sql> archive log list is used to see if the schema of the database is Archivelog mode. If the user database is not in Archivelog mode, it can be set to archive mode by the following command: sql>shutdown immediate Sql>startup Mount Sql>alter database Archivelog Sql>alter DB Open in archive mode, the user's database will record all the logs, so the time will take up a lot ofDisk space so that users can change the database back to the archive mode on demand, as follows: Sql>shutdown immediate Sql>startup Mount Sql>alter database Type of Noarchivelog sql>alter database open Hot backup: From a NBU perspective, there are two types of hot backup for Oracle: A database backup that backs up a database's data files without shutting down the database, Control file and archive log files, and so on; the second backup mode is the hot backup table space, where the contents of a database tablespace can be backed up when the database is shut down. In this article, we'll explain how to do database-level backups and tablespace-level backups separately. Note: Here, I'll just talk about how to modify backup scripts for backup, and if users are wondering how to create an Oracle backup strategy, how to run full and incremental backups, how to find the backup script templates provided by NBU, and so on, take a look at the previous "Backup Oracle system with NBU-cold backup." Database-Level Hot backup: For database-level hot backup, we can take advantage of the script files provided by NBU:/usr/openv/netbackup/ext/db_ext/oracle/samples/rman/hot_database_ Backup.sh, this is an executable script, the content is set up to run the Oracle Rman program of the necessary environment variables, from root user to the Oracle System user account, the use of Rman program, the database data files, Archive log files and control files are backed up to the user-specified storage unit. In this file, we need to modify the following parameters (it is recommended to copy the file to make changes, so as to avoid error): Oracle_home: Indicates the directory where ORACLE resides, Nbu needs to execute the appropriate Rman command to its directory; Oracle_sid: Indicates a database that requires cold backup; Oracle_user:oracle the system user to which the database belongs, NBU will first log in with the user and perform various backup operations; TARGET_CONNECT_STR: Login to the Oracle database account must be a system administrator, Because the cold backup needs to stop the Oracle database first; hot and cold backup templates The difference between scripting modifications is that a cold backup requires that you specify an Oracle boot file parameter because a cold backup requires the database to be shut down and restarted, so the configuration file needs to be started, and hot backups do not shut down the database, so you do not need the variable. Important: In addition to the user's attention, the script provided by NBU is run at the scriptGenerates an. out file with the same name under the directory. It records the log generated when the Nbu script runs, but the script passes the log name as an argument to Rman, and Rman does not recognize the "." In ". Out" in the argument, so when you run the script, the error shown in Figure one appears. The solution is that either the user deletes the log-related contents of the Rman command in the hot_database_backup.sh script (figure II) or processes the string with an escape character so that Rman can recognize the command correctly. Figure I: Problems with executing NBU scripts figure II: User needs to delete the script in this way, the user can place the script in the backup selection in the Oracle backup policy and execute it. Tip: In order to ensure that the NBU script is not a problem, users should run the script manually before running the NBU backup strategy, and check that the script can run correctly if the script runs incorrectly, and the user enters "# echo $?" By viewing the relevant ". Out" file. Returns a value other than 0, in which case the user needs to discover the cause of the error from the input file and modify the run script. Only the script can successfully run successfully in the backup policy. Table space-level hot backup: Before using tablespace-level backups, we need to explain the catalog database (this catalog is not NBU catalog, which is Oracle content). Catalog is also a database (dozens of trillion), except that the database is used to hold backup information, and a recovery directory can be used to back up multiple databases. Rman can run without a recovery directory (Nocatalog), at which point the backup information is saved in the control file. The backup information stored in the control file is dangerous, and if the control file's destruction will result in loss of backup information and recovery failures, and no recovery directory, many Rman commands will not be supported. Therefore, for important databases, it is recommended that you create a recovery directory. In a table space-level hot backup, you need to first create a catalog database with the following commands: 1, create a separate tablespace for the directory: sql>create tablespace ts_rman datafile '/oracle/catalog_ RMAN.BDF size 50m; 2, create the RMAN User: Sql>create user RMAN identified by rman default tablespace ts_rman temporary tablespace temp; 3, Grant Rman permission: Sql>grant Connect, resource, RecovEry_catalog_owner to Rman; 4, connect to target database and catalog database: Rman target system/manager@target_tnsname rcvcat rman/rman@catalog_tnsname, target_ Tnsname is the name of the database we want to back up, Catalog_tnsname is the name of the database that created the Rman tablespace and the Rman user, and can back up the database one because we're just backing up other tablespaces. 5, create catalog user's Table: Rman>create Catalog 6, Registration target database: Rman>register db In this way, we have successfully created the catalog table space to hold the backup information. To enable users to warm up the Oracle tablespace, NBU provides a template script for the user:/usr/openv/netbackup/ext/db_ext/oracle/samples/rman/hot_tablespace_ Backup.sh. Users need to modify the content, in addition to the above database-level hot backup required parameters, but also requires the following parameters: Rcvcat_tns: Is the catalog table space in the database name; RCVCAT_CONNECT_STR: is the connection Rcvcat_ The Rman account information required by the TNS database, in this case, is "Rcvcat_connect_str=rman/rman". In addition, in the template script, it is just a hot backup of the user's system table space, and the user can modify the script so that other tablespaces can be hot backed up. First we need to find all the table spaces in the database, see figure three: Figure three: View the table space of the database after you find the table space that requires hot backup, the user needs to modify the fields in the hot_tablespace_backup.sh script, see figure Four: Figure four: Modify table space name by Figure Four, We modify the name of the yellow circle within the script to any existing table space name. In this way, the table space level backup script has been modified, the user can try to run the script, and through the input file Hot_tablespace_backup.sh.out to solve the possible errors (to step by step, there should be no mistake!), if the script can run properly, Then you need to add it to the NBU backup strategy and set up a schedule for both full and differential backups. Through the introduction of this article, users can modify the NBU from the backup script, the Oracle system to do database level or table space levelHot back up. It is hoped that this article can deepen users ' understanding of Oracle databases and NBU in the process of using NBU Oracle proxies.

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.