I. Logical backup and recovery of database (table)
1. International Backup is the process of exporting the structure and data of a data object to a file using a tool export, which refers to the process of importing a data object into a database using a backed-up file when the database object is damaged by mistake. Physical backups can be performed in the open state of the database or after the database is closed. However, logical backup and recovery can only be performed in open state.
2. Export
The export is divided into: Export table, export scheme, three ways of exporting the database
Export is done using the EXP command, and the options commonly used to change commands are:
UserID: Used to specify the user name, password, connection string to perform the export operation
Tables: Used to specify the table to perform the export operation
Owner: Specifies the scenario to perform the export operation
Full=y: Used to specify the increment type to perform the export operation
Rows: Used to specify whether the export operation is to export data from the table
File: Used to specify the export file name
3. Export the table
(1) Export your own table
Exp Userid=scott/[email protected] tables= (EMP) file=d:\el.dmp
(2) Export tables for other scenarios
If a user wants to export a table for another scenario, they need DBA authority or
Exp_full_database's permissions, such as system, can export Scott's tables.
Exp Usrid=system/[email protected] tables= (scott.emp) file =d:\e2.dmp
In particular, when importing and exporting, go to the bin directory under the Oracle directory
(3) Structure of the exported table
Exp userid =scott/[email protected] Tables (EMP) file=d:\e3.dmp rows=n
Exp Usrit=scott/[email protected] tables= (EMP) file=d:\e3.dmp direct=y
This is faster than the default normal way, and when the data is large, consider using this method
The character set of the database needs to be exactly the same as the client character set, otherwise it will error
4. Export Scenario
The export scenario is to export a scenario using the export tool or all objects in multiple scenarios (tables, indexes, constraints)
and data, and put it in a file
(1) Export your own solution
Exp Scott/[email protected] Owner=scott file=d:\\scott.dmp
(2) Export other programs
If the user wants to export other scenarios that require DBA authority or
Exp_full_database permissions, such as system users, can export any scenario
Exp System/[email Protected] Owner = (System,scott) file=d:\system.dmp
Logical backup and restore of databases (tables)