Many application scenarios, in order to prevent the occurrence of disasters, to protect against the loss of important data, remote disaster recovery solution level is not poor. Then the database will undoubtedly become the focus of the protection of the object, then come together to learn about Oracle backup mechanism.
Oracle provisioning can be divided into logical export/import and physical backup/restore
Logical backup: It is actually using the Exp/imp command to implement the data information of the table library
Export:
CMD command mode exp-? See Help for a brief description of two parameters and usage formats
1) Owner users to Export:format are ' (User1, User2,.., UserN) ' Specify the export of those users ' tables if a user does not exist and the warning will not affect another user table export
The format is as follows: Exp System/system owner= (user1,user2) file=d:/path------->file to save the path------------>owner equals multiple arguments enclose in parentheses
2) Tables tables to Export:format are ' (table1, table2, ..., Tablen) ' Specify to export those tables, with the flexibility to select multiple table backups at one time
The format is as follows: Exp System/system tables= (tables1,tables2) file=d:/path.dmp
Basic format much the same I hope you see a lot of help manual (reference must)
Import:
Sql*plus the DOS command is invoked through the host directive, note that the Oracle 9i command increment export inctype is deprecated and imported using IMP command IMP-? Sql*plus, you need to hit host first.
Import format: Imp system/system file=d:/path.dmp with parameter tables= (user1,user2) This command imports only the two tables User1,user2.
Sql>host imp system/system file=d:/path.dmp tables= (user1,user2); How to use in Sql*plus
The ORACLE_SID default environment variable library is used regardless of whether the import or export is not specified, and SID knowledge is already involved.
Physical Backup/Restore
Divided into two main categories: cold and hot backup
What is cold backup, simple rough to close the database, copy the library files, these files have data files, control files, log files, online bedolog and init.org (optional).
Cold Backup Steps
1) Close the database shutdown normal (graceful shutdown)
2) sql>host copy D:\oracle\product\...\oradata\test (path of original library) E:\Backup (Path of backup location) currently in Sql*plus environment
Parsing: The fact is that the files (blocks) stored in the disk database are copied to another folder to save
Recovery is easier, as long as the database is closed, copy the backup library to the old library location
What is hot backup: Someone also called smooth upgrade, database backup under the startup state of the database, because many scenario scenarios will never allow you to shut down a database, except for highly available clusters, so it is necessary to master hot backup (database must be archive mode)
What is the archive mode: When we start the database, there will be a lot of initialization information, which will have redo buffer size, then we have online redo log database, this log is record additions and deletions and other operations records, an Oracle database has at least two archive redo logs , in non-archive mode, then switch to the second online redo log when the first archive log is full, then switch to write the first online redo log after the second archive log is full, and the new content will overwrite the old log record, causing the content to be lost. In archive mode, when an online redo log is full, the switch is archived and copied to a different directory, which avoids data loss.
Hot Backup steps
1) First we put the database into the Mount stage, modify the archive mode, the command is as follows
Sql>alter Database Mount
Sql>alter database Archivelog;
2) Then we open the data to facilitate the operation of the database
Sql>alter database open;
3) Check to see if archive mode is turned on
Sql>archive log list;
4) Turn on table space Backup mode
Sql>alter tablespace users begin backup;
5) Back Up table space
Sql>host Copy D:\app\....\oradate\xx.dbf D:\Backup
6) Turn off table space backup
Sql>alter tablespace users end backup;
7) Backup control file
Sql>alter database backup controlfile to ' reuse;
8) Backup control File script
Sql>alter database backup controllfile to trace;
In the Oracle_home\intsance_name\udump control of the trace files, copy files to the backup directory, the hot backup is complete, the detailed knowledge points will continue to improve.
Oracle Save As ~