Use RMAN for recovery from different machine backups (WIN platform)

Source: Internet
Author: User
-- ========================================
-- Use RMAN for recovery from different machine backups (WIN platform)
-- ========================================

In some cases, if the database server is under disk space pressure or costs control, you need to back up the data files to a different machine, and RMAN can be used to complete this work. Based on Windows
The configuration required is relatively simple. It is only necessary to add an account and use the newly added account to start the database service and set the sharing path.
The following is a detailed description.

1. Configure the database server and backup target host
1. Account configuration (assume that host a and host B are used as the database server, and host B is used as the backup destination and can ping each other)
If host a and host B use the same administrator password, and oracleservicedbname and oracleorahome92tnslistener services on host a both use
Local System Account Login"
If host a and host B use different administrator passwords and are not considered to be the same in terms of security, you can create a new user on host a and host B separately.
Set dba_oracle on host a and set the password to ora_pwd. This user is also created on host B (the user name can be different and the password must be the same). The password is also set to ora_pwd.
. Add the user on the host to the aministrators group.
2. Set the startup account for the oracleservicedbname service and oracleorahome92tnslistener service. Enter services. MSC at run. Set this account on host
User Login, that is, using the dba_oracle just created, enter the password to start, this setting needs to be effective after restart
3. Set the shared folder on host B, such as rman_shared, and set its permissions to full control (use \ IP \ rman_shared on host a to test whether files can be written)

Ii. Check RMAN configuration and database information

RMAN> show controlfile autobackup; </P> <p> The RMAN configuration parameter is: <br/> Configure controlfile autobackup on; --> automatic backup of control files, we recommend that you enable </P> <p> RMAN> show controlfile autobackup format; </P> <p> The RMAN configuration parameter is: <br/> Configure controlfile autobackup format for device type disk to '\ 192.168.1.151 \ rman_shared \ Control <br/> _ % F '; --> control the file backup location </P> <p> RMAN> show snapshot controlfile name; </P> <p> The RMAN configuration parameter is: <br/> Configure snapshot controlfile name to 'd: \ oracle \ ora92 \ database \ sncftesthh. ora '; # default --> snapshot Control File Location </P> <p> SQL> select * from V $ version; --> database version, the current demo environment is Oracle 9i </P> <p> banner <br/> release <br/> Oracle9i Enterprise Edition Release 9.2.0.1.0-production <br/> PL/SQL release 9.2.0.1.0- production <br/> core 9.2.0.1.0 production <br/> TNS for 32-bit windows: version 9.2.0.1.0-production <br/> nlsrtl version 9.2.0.1.0-production </P> <p> SQL> show parameter db_name </P> <p> name type value <br/> ------------------------------------ ----------- --------------- <br/> db_name string testhh <br/>

3. Back up and shut down the database and delete the system01.dbf File
Use the backup script to back up the database.

D: \> RMAN target Robinson/Robin @ testhh export file = D: \ oracle \ oradata \ testhh \ backup. RMAN log = D: \ oracle \ ora <br/> data \ testhh \ backup. log <br/>

4. Restore and restore data from different hosts
1. Shut down the database

SQL> shutdown immediate; <br/> the database has been disabled. <Br/> the database has been detached. <Br/> the Oracle routine is disabled. <Br/>

2. Delete the system01.dbf data file for test recovery.

SQL> Ho del D: \ oracle \ oradata \ testhh \ system01.dbf

3. Restart the instance and receive an error message.

SQL> startup <br/> the Oracle routine has been started. </P> <p> total system global area 126950220 bytes <br/> fixed size 453452 bytes <br/> variable size 109051904 bytes <br/> database buffers 16777216 bytes <br/> redo buffers 667648 bytes <br/> the database has been loaded. <Br/> ORA-01157: unable to identify/lock data file 1-see dbwr tracking file <br/> ORA-01110: Data File 1: 'd: \ oracle \ oradata \ testhh \ system01.dbf' <br/>

4. Restore and restore with RMAN

D: \> RMAN target/--> connect to the default target database </P> <p> recovery MANAGER: Version 9.2.0.8.0-production <br/> copyright (c) 1995,200 2, oracle Corporation. all rights reserved. <br/> connect to the target database: testhh (dbid = 3955637780) </P> <p> RMAN> Restore database; --> restore the database </P> <p> Start restore from month 25 to month 11 <br/> the target database control file is being used to replace the recovery directory <br/> allocated channel: ora_disk_1 <br/> channel ora_disk_1: SID = 14 devtype = disk <br/> channel ora_disk_1: Recovering data file backup set <br/> channel ora_disk_1: specifying a data file to be restored from the backup set <br/> restoring data file 00002 to D: \ oracle \ oradata \ testhh \ undotbs01.dbf <br/> restoring data file 00003 to D: \ oracle \ oradata \ testhh \ cwmlite01.dbf <br/> restoring data file 00005 to D: \ oracle \ oradata \ testhh \ example01.dbf <br/> restoring data file 00006 to D: \ oracle \ oradata \ testhh \ indx01.dbf <br/> restoring data file 00010 to D: \ oracle \ oradata \ testhh \ xdb01.dbf <br/> channel ora_disk_1: recovered backup segment 1 <br/> segment handle = \ 192.168.1.151 \ rman_shared \ full_testhh_15mibdka_1_1 tag = full_bak Params = NULL <br/> channel ora_disk_1: recovery completed <br/> channel ora_disk_1: Recovering data file backup set <br/> channel ora_disk_1: specifying a data file to be restored from the backup set <br/> restoring data file 00001 to D: \ oracle \ oradata \ testhh \ system01.dbf <br/> restoring data file 00004 to D: \ oracle \ oradata \ testhh \ drsys01.dbf <br/> restoring data file 00007 to D: \ oracle \ oradata \ testhh \ odm01.dbf <br/> restoring data file 00008 to D: \ oracle \ oradata \ testhh \ tools01.dbf <br/> restoring data file 00009 to D: \ oracle \ oradata \ testhh \ users01.dbf <br/> channel ora_disk_1: recovered backup segment 1 <br/> segment handle = \ 192.168.1.151 \ rman_shared \ full_testhh_16mibdmb_1_1 tag = full_bak Params = NULL <br/> channel ora_disk_1: recovery completed <br/> restore completed in month 25-7-11 </P> <p> RMAN> recover database; --> restore the database </P> <p> Start recover on month 25-7-11 <br/> Use channel ora_disk_1 <br/> media recovery is starting <br/> <br/> complete the recover on month 25-7-11 </P> <p> SQL> alter database open; </P> <p> SQL> select name, open_mode from V $ database; </P> <p> name open_mode <br/> --------- ---------- <br/> testhh read write <br/>

5. Conclusion
From the above backup and recovery, there is no much difference between the use of backup and recovery from different machines and the use of local server backup and recovery operations, but the database performance is subject to a certain
. That is, the backup and recovery speed is lower than the backup and recovery speed on the local server. In a large production environment with extremely high real-time requirements, try to avoid exceptions
Backup and recovery. However, backup to recovery from different machines is still an optional solution.

V. RMAN backup script

Run {<br/> allocate channel specified device type disk; <br/> allocate channel CH2 device type disk; <br/> backup database format = '\ 192.168.1.151 \ rman_shared \ full _ % d _ % U' --> note the format \ IP \ shared_folder \ <br/> tag = 'full _ Bak '; <br/> SQL "alter system archive log current"; <br/> crosscheck archivelog all; <br/> Delete noprompt expired archivelog all; <br/> Backup archivelog all format = '\ 192.168.1.151 \ rman_shared \ log _ % d _ % U' Delete input --> note the format \ IP \ shared_folder \ <br /> tag = 'Log _ Bak '; <br/> release channel success; <br/> release channel CH2;} <br/>

Vi. Quick Reference

For performance optimization, see

Oracle hard parsing and soft Parsing

Sharedpool Tuning)

Buffercache adjustment and optimization (1)

Use of Oracle table cache (cachingtable)

 

For the Oracle architecture, see

Oracle tablespace and data files

Oracle Password File

Oracle parameter file

Oracle online redo log file)

Oracle Control File)

Oracle archiving logs

Oracle rollback and undo)

Oracle database instance startup and Shutdown Process

Automated Management of Oracle10g SGA

Oracle instances and Oracle databases (Oracle Architecture)

 

For more information about the flash back feature, see

Flashback Database)

Flashback drop & recyclebin)

Oracle flash back features (flashback query, flashbacktable)

Oracle flash back feature (flashback version, flashback transaction)

 

For more information about user-managed backup and recovery, see

Oracle cold backup

Oracle Hot Backup

Concept of Oracle backup recovery

Oracle instance recovery

Oracle recovery based on user management (describes media recovery and processing in detail)

System tablespace management and Backup Recovery

Sysaux tablespace management and recovery

 

For information on RMAN backup recovery and management, see

RMAN overview and architecture

RMAN configuration, Monitoring and Management

Detailed description of RMAN backup

RMAN restoration and recovery

Create and use RMAN catalog

Create RMAN storage script based on catalog

Catalog-based RMAN backup and recovery

Use RMAN to migrate a file system database to ASM

RMAN backup path confusion (when using plus archivelog)

 

For Oracle faults, see

Error Handling for ORA-32004

ORA-01658 error.

CRS-0215 error handling

ORA-00119, ORA-00132 error handling

Another spfile setting error causes the database to fail to start.

Misunderstanding and setting of the parameter fast_start_mttr_target = 0

Spfile error causing database startup failure (ORA-01565)

 

For more information about ASM, see

Create an ASM instance and an ASM Database

Management of ASM disks and directories

Use asmcmd to manage the ASM directory and files

 

For more information about SQL and PLSQL, see

Common sqlplus commands

Replace variables with SQL * Plus Environment Settings

SQL plus paging using uniread

SQL Basics--> SELECT query

SQL Basics--> Use of new_value

SQL Basics--> Set operation (Union and Union all)

SQL Basics--> Common functions

SQL Basics--> View (createview)

SQL Basics--> Create and manage tables

SQL Basics--> Multi-Table query

SQL Basics--> Filtering and sorting

SQL Basics--> Subquery

SQL Basics--> Grouping and grouping Functions

SQL Basics--> Hierarchical query (startby... connect by prior)

SQL Basics--> Rollup and cube operators implement data aggregation

PL/SQL--> Cursor

PL/SQL--> Exception Handling)

PL/SQL--> Language basics

PL/SQL--> Process Control

PL/SQL--> PL/SQL records

PL/SQL--> Create and manage packages

PL/SQL--> Implicit cursor (SQL % found)

PL/SQL--> Package overloading and initialization

PL/SQL--> Use of dbms_ddl package

PL/SQL--> DML triggers

PL/SQL--> Instead of trigger

PL/SQL--> Stored Procedure

PL/SQL--> Function

PL/SQL--> Dynamic SQL

PL/SQL--> Common Errors of dynamic SQL

 

Other Oracle features

Common Oracle directory structure (10 Gb)

Use OEM, SQL * Plus, and iSQL * Plus to manage Oracle instances

Logging mode (logging, force logging, nologging)

Logging and nologging on table and index segments

Oralceomf Functions

Oracle users, object permissions, and system Permissions

Oracle role and configuration file

Oracle Partition Table

Oracle External table

Use external tables to manage Oracle alarm logs (alaert _ $ Sid. Log)

Cluster table and cluster Table Management (index clustered tables)

Use of Data Pump expdp export tool

Use of Data Pump impdp import tool

Import and Export Oracle Partition Table Data

SQL * loader usage

Enable User Process Tracking

Configure dynamic service registration for non-default ports

Configure the Oracle client to connect to the database

Difference between systemsys and sysoper sysdba

Oracle_sid, db_name, instance_name, db_domian, global_name

Complete Oracle patches (Oracle 9i 10g 11g path)

Upgrade oracle10.2.0.1 to 10.2.0.4

Oracle kill session

 

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.