Oracle: RMAN backup and recovery instances

Source: Internet
Author: User
Command: connecttarget (connecttargetsystemoracle @ ora10g. If the database does not exist, you can directly start it with startup under the rman command.

Command: connect target/(connect target system/oracle @ ora10g. If the database does not exist, you can directly start it with startup under the rman command.

1. Check the database mode:
Sqlplus/nolog
Conn/as sysdba
Archive log list (check whether the database is in archive Mode)

If not, the database archive mode is modified.
Startup mount
Alter database archivelog
Alter database open

2. connect to the target database

Command: connect target/(connect target system/Oracle @ ora10g. If the database does not exist, run the rman command to start the database using startup)
You can connect to the target database. (rman connects to the target database, control file (nocatalog mode), and control file stores the backup information of rman)

3. Run the list backupset command to check whether there are any backup items.

4. Common backup commands:
Backup full database:
RMAN> backup database plus archivelog delete input; (back up full-database and control files, server parameter files, and all archived redo logs, and delete old archive logs)
Backup tablespace:
RMAN> backup tablespace system plus archivelog delete input; (backup the specified tablespace and archived redo logs, and delete the old archived logs )_
Back up archived logs:
RMAN> backup archivelog all delete input;


=============================================== Back up the entire database =====

1. full backup of the entire database ).

Just enter the command: backup database;

2. list backupset to view the specific backup information

List of Backup Sets
==============================

BS Key Type LV Size Device Type Elapsed Time Completion Time
-------------------------------------------------------------
1 Full 6.80 m disk 00:00:02 06-DEC-08
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20081206T201041
Piece Name:/home/oracle/flash_recovery_area/ORA10G/backupset/2008_12_06/o1_mf_ncsnf_TAG20081206T201041_4mntz78s _. bkp
Control File Included: Ckp SCN: 782019 Ckp time: 06-DEC-08
SPFILE encoded ded: Modification time: 06-DEC-08

BS (backupset), piece is a file, and a BS contains multiple piece.

3. The default parameters in rman can be shown all;
In the backup database command, we can replace these default values with fixed values.

4. we can copy the backup files to the tape directory, and then delete the backup files under the Backup Directory. If you need to recover the files next time, just copy the file back to the backup directory.
5. view the backup information in the control file (because the backup is in nocatalog mode), and the control file is in the/u01/oracle/oradata/ora10g directory, since the control file is a binary file, to view the content in the control file, use strings control03.ctl to find that control03.ctl contains the rman backup information.


=============================== 0-level Incremental Backup ========================

Concept: Full backup and zero-level Incremental backup.Full backup and zero-level Incremental Backup are almost the same. The only difference is that level 0 Incremental Backup can be used as the basis for Incremental backup, while full backup cannot be used as the basis for Incremental backup. Completely consistent with other aspects

1. backup incremental level = 0 (leve 0) database; (backup with an incremental value of 0)
2. backup incremental level 1 (level = 1) database; (incremental backup of 1)

In the preceding backup, we have backed up datafile, controlfile, and parameter file. archive logs exist for files not backed up, redo logs and password files are not backed up. password files do not need to be backed up. We use orapw to create

The new password file. rman cannot be backed up in nocatalog mode for redo log files.


=========================== Backup archivelog in nocatalog mode ===================== =

Command: backup database plus archivelog delete input (delete input means to delete the archivelog file after the backup is complete. This option is optional, this command can also be used to backup incremental level = 0 (1, 2 ...))


=========================================Backup tablespace =====

Backup tablespace tablespacename

If you do not know the name of tablespace, you can use the report schema command in rman to view the name of the tablespace.

MAN> report schema;
Report of database schema

List of Permanent Datafiles
======================================
File Size (MB) Tablespace RB segs Datafile Name
---------------------------------------------------------------
480 SYSTEM ***/home/oracle/oradata/ora10g/system01.dbf
2 25 UNDOTBS1 ***/home/oracle/oradata/ora10g/undotbs01.dbf
3 250 SYSAUX ***/home/oracle/oradata/ora10g/sysaux01.dbf
4 5 USERS ***/home/oracle/oradata/ora10g/users01.dbf
5 200 PERFSTAT ***/home/oracle/oradata/ora10g/perfstat. dbf

List of Temporary Files
======================================
File Size (MB) Tablespace Maxsize (MB) Tempfile Name
---------------------------------------------------------------
1 20 TEMP 32767/home/oracle/oradata/ora10g/temp01.dbf

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.