1 Introduction
ORACLEA database is a large-scale relational database that can be stored for storage.TBSo how to ensure the security of such data is particularly important.1991Use in yearsORACLEDatabase, we have developed a complete setORACLEDatabase backup system. Now we will introduce our backup system for your reference.
2Determine the database running mode based on actual needs
ORACLEThere are two ways to run databases: ArchiveARCHIVELOG), Archive aims to restore all submitted items to the maximum extent when the database fails. Second, archive is not implemented.(NOARCHIVELOG)To restore the database to the nearest recycling point. Based on the high availability of the database and the amount of workload that users can afford to lose, we archive the databases that we officially run, and archive the databases that are being developed and debugged.
3How to change the running mode of the database
3.1Set the running mode of the database when creating the database
When creating a database, as part of creating a database, it determines the initial archiving method of the database. GenerallyNOARCHIVELOGMethod. After the database is created, change the database to be run in the archive mode as needed.ARCHIVELOGMethod.
3.2Change the archive mode to archive
Close the database and back up existing data.Changing the running mode of the database is an important change to the database. Therefore, you must back up the database to protect possible problems.
StartInstance, MountThe archive mode is changed when the database is not opened.
Sqldba lmode = ySvrmgrl)
Sqldba> connect internal
Sqldba> startup mount
Sqldba> alter database archivelog;
Enable automatic archiving
In the initialization fileInit *. ora (Generally putORACLEUnderlying directory of the root directoryDbsLower)Add parameters:
Log_archive_start = true
Specify the redo login file name and storage location for the archive
Also in the initialization fileInit *. oraAdd the following parameters:
Log_archive_format = % S. arc
Log_archive_dest =/arch12/arch (arch12Is the directory where log files are stored)
Close the database, restart the database, and archive the data.
4Recycling System
4.1The database recovery system is determined based on the database operation mode and the workload that can be borne by the loss. What we use for non-archiving isORACLELogical backup of databasesExportThe recovery system is: one full backup every month(X01.dmp)Make a cumulative backup once a week(C *. dmp), Incremental backup once a day(I *. dmp)Specifically, Incremental backup is performed from Monday to Friday, and cumulative backup or full backup is performed on Saturday. After each backup is completed, it is automatically uploaded to other machines for storage. All these backups are automatically executed.,The program text is provided later.
For the archiving method, we useORCALEPhysical backup: After the database is created, a full physical backup is performed. Normally, the database is not closed, physical backup of online database data files for frequently-changed data files within one week. When the database structure changes, such as adding tablespaces and data files, such as shutdown allowed, close the database normally, and re-create a full backup of the database. Otherwise, back up the control file and back up the data file as usual. Online log files are written on the array without mirroring or backup.