Restore the asm database from the rman Database

Source: Internet
Author: User

1. Full database backup
 
Note: rman can back up the data files on asm to the file system or restore them.
 
RMAN> run {
Allocate channel c1 type disk maxpiecesize = 500 m;
Backup current controlfile format '+ dgasm/backup/ctl _ % d _ % s ';
Backup full database format' + dgasm/backup/db _ % d _ % s _ % p _ % T ';
SQL 'alter system archive log current ';
Release channel c1;
} 2> 3> 4> 5> 6> 7>
Allocated channel: c1
Channel c1: SID = 31 device type = DISK
Starting backup at 24-JUN-12
Channel c1: starting full datafile backup set
Channel c1: specifying datafile (s) in backup set
Including current control file in backup set
Channel c1: starting piece 1 at 24-JUN-12
Channel c1: finished piece 1 at 24-JUN-12
Piece handle = + DGASM/backup/ctl_ora11_19 tag = TAG20120624T172227 comment = NONE
Channel c1: backup set complete, elapsed time: 00:00:03
Finished backup at 24-JUN-12
Starting backup at 24-JUN-12
Channel c1: starting full datafile backup set
Channel c1: specifying datafile (s) in backup set
Input datafile file number = 00001 name = + DGASM/ora11/datafile/system.257.785186755
Input datafile file number = 00002 name = + DGASM/ora11/datafile/sysaux.258.785186845
Input datafile file number = 00003 name = + DGASM/ora11/datafile/undotbs1.259.785186901
Input datafile file number = 00004 name = + DGASM/ora11/datafile/users.261.785186921
Channel c1: starting piece 1 at 24-JUN-12
Channel c1: finished piece 1 at 24-JUN-12
Piece handle = + DGASM/backup/db_ora11_20_2017786820952 tag = TAG20120624T172232 comment = NONE
Channel c1: starting piece 2 at 24-JUN-12
Channel c1: finished piece 2 at 24-JUN-12
Piece handle = + DGASM/backup/db_ora11_20_2_786820952 tag = TAG20120624T172232 comment = NONE
Channel c1: backup set complete, elapsed time: 00:01:22
Channel c1: starting full datafile backup set
Channel c1: specifying datafile (s) in backup set
Including current control file in backup set
Including current SPFILE in backup set
Channel c1: starting piece 1 at 24-JUN-12
Channel c1: finished piece 1 at 24-JUN-12
Piece handle = + DGASM/backup/db_ora11_21_109786821034 tag = TAG20120624T172232 comment = NONE
Channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-JUN-12
SQL statement: alter system archive log current
Released channel: c1
RMAN>
2. shutdown immediate shut down the database, delete the user data file, and simulate data file corruption.
ASMCMD> ls
SYSAUX.258.785186845
SYSTEM.257.785186755
UNDOTBS1.259.785186901
USERS.261.785186921
ASMCMD>
ASMCMD>
ASMCMD> rm-f USERS.261.785186921
ASMCMD> ls
SYSAUX.258.785186845
SYSTEM.257.785186755
UNDOTBS1.259.785186901
ASMCMD>
3. Start the data to mount, and then open the following problem occurs:
SQL> alter database open;
Alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 4-see DBWR trace file
ORA-01110: data file 4: '+ DGASM/ora11/datafile/users.261.785186921'
4. Describe the problem with the data file. view the specific problem.
SQL> select * from v $ recover_file
2;
FILE # ONLINE _ ERROR
-----------------------------------------------------------------------------------------
CHANGE # TIME
----------------------
4 ONLINE FILE NOT FOUND
0
File not found indicates that the FILE is lost or damaged, and then the whole database is restored.

  • 1
  • 2
  • 3
  • Next Page

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.