Database Backup is one of the most important tasks in the whole project operation.
I. Data Export and Import
Data export and import are for a user's backup operations, which can be completed as follows:
1. Data Export
- Create a folder on the hard disk: C: \ backup;
- Enter the exp command;
- Enter the user name and password;
- Set the export file name: Export File: expdat. dmp;
2. Data Import
- Delete the table first;
- Go to the folder where the exported file is located: C: \ backup;
- Enter the IMP command;
- Enter the user name and password;
- Import the entire exported file (yes/no): No> Yes
However, the above operations are only used as a demonstration, because such backup operations are only suitable for small data volumes. If the data volume is large, such operations will consume performance, it will take a long time. To solve the problem of large data volumes, you can only operate on data partitions.
Ii. Cold backup of data tables
Some users may not commit transactions during data operations. In this case, full backup operations may fail, the so-called Cold backup refers to the implementation of database backup operations when the database instance is closed.
If you want to perform a cold backup, you need to back up some core contents in the database:
- The control file refers to the core file that controls the instance services of the entire Oracle database, which is directly found through "V $ controlfile;
- Redo log files for disaster recovery of data, which can be found directly through "V $ logfile;
- Data Files and tablespace files are found through "V $ datafile" and "V $ tablespace;
- The core operation configuration file (pfile) is found through "show parameter pfile;
In terms of actual oracle deployment, all files must be stored on different hard disks to achieve Io balancing.
After confirming the file to be backed up, follow these steps:
1. Log On As a super Administrator
Conn sys/Change_on_installAsSysdba;
2. Search for all control file directories
Select * FromV $ controlfile;
3. Backup and redo log files
Select * FromV $ logfile;
4. Search for tablespace files
Select * FromV $ tablespace;Select * FromV $ datafile;
5. Find the pfile file.
Show parameter pfile;
6. Shut down database instances
ShutdownImmediate;
7. Back up all the searched data to the disk;
8. Start a database instance
Startup;
generally, a professional DBA developer must be proficient in the above steps to perform timely recovery after a disaster occurs.