Logical and physical backup of databases-non-RMAN

Source: Internet
Author: User


Database backup and recovery are common and important. Logical backup in ideal state is restored. EXP backup is used to extract data from the database and write data to the operating system file. you can export a complete database. 2. you can also export a schema file or a specific table. it is called a dump file. The default extension is. dmp4. table or user mode: from a number of databases to another database, re-recognize the table 5. the program creates a storage specified table, instead of the database's logical backup www.2cto.com. Use iMP to import data into a program and import data from *. dmp data import and deletion or loss of data. You do not need to use other tools to back up physical backup that can be achieved by archiving logs and physical backup, whether cold backup or hot backup, physical backup is to copy the data files in the database, only cold backup refers to offline backup and Hot Backup refers to online backup. 1. cold backup and offline backup are to stop the database server (service) 1) SQL> shutdown immediate 2) after the database is stopped, the corresponding file and data files in the data directory oradata, log File, control file, copy to a local location 3) copy to the relevant path, such as c:/bak 4) if the database file (directory oradata) is lost or damaged, you can test all the physical files in the backup to overwrite the original files. This will cause loss of all new data from the date of the sub-Backup. 5) after the replication is complete, you can restart the database. Cold backup is a physical copy. 2. Hot Backup, normal Backup 1) No shutdown, online backup, and normal operation together. 2) place it in archive mode. view the archive log list Directory redo01.log, redo02.log, and redo03.log are called online logs, which are written in turn. Hot Backup must be archived for recovery. Two types of logs: Online logs and archived logs.
The path strength is USE_BD_RECOVERY_FILE_DEST 1. SQL> alter system set log_archiver_start = true scop = spfile 2. shutdown immediate to stop the database. 3. startup mount: start to a control file, but do not open the data file 4. alter database archive switch the database to archive mode 5. alter database open
In general, change the non-archive mode and automatic archive mode of the database to take effect 6. view the archive mode in archive log list www.2cto.com 7. The backup work can start to assume that the current database performs some backup work. SQL> alter tablespace tt begin backup; start to back up a table Tablespace alter physical operating system command can be tt. copy dbf to c:/temp. Physical BACKUP to a path SQL> alter tablespace tt END BACKUP; Tablespace altered. SQL> alter system archive log current; archive the current online log, system altered. SQL> alter system swich LOGFILE; SQL> shutdown immediate. SQL> select * from v $ recover_filel; you will find that the file number cannot be found, that is, the file you just deleted. SQL> alter database datafile 6 offline drop; SQL> alter database open copies the file backed up to c:/temp. SQL> select * from tt. deparment; no SQL> recover datafile 6; Specify auto SQL> alter database datafile 6 online; from the archive path.
Conclusion: Archive logs are effectively restored for hot backup. When a database encounters a problem, the number of customers is restored to the specified stage. Create a swich LOGFILE during archiving. Both cold backup and physical backup are valid, which is a physical copy. The difference is that one is offline and the other is online. When one or more control files are lost in the database, how can we make up for them? 1. Control File loss. Normally, control files can be backed up. Alter database backup controlfile to trace; you can view the trace path show parameter dest/dump ps: the latest file in/u01/app/oracle/diag/rdbms/www.2cto.com $ ORACLE_SID/trace tarce of 11g contains the backup information of our control file, where: 1. annotation information is not required. 2. It needs to start from startup nomount. 3. It includes alter database open. 4. It is saved to a special file, such as ctl. SQL 5. Delete control files. 6. After the database is started, run SQL> @ ctl. SQL to recreate the control file. 2. One or more log files are lost. 1. log files are lost. 2. SQL> recover database until cancel; cancel-based restoration database 3. SQL> alter database open resetlogs; Author: huzia

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.