Basic Oracle Database Operations (6)-data export and import, basic oracle operations
1. log on to the specified user in the oracle database under cmd
Method 1: Log On Through command line plaintext connection
Method 2: log on through the command line ciphertext connection
Ii. Data Import and Export
(1) Use the cmd command to export and import the entire database
1. Full-Database Export
exp system/orcl full=y
You do not need to log on. Enter the command in the command line. system is the database administrator, orcl is the corresponding password (password), and the parameter "full = y" is added to indicate full Database Export.
After the command is executed, an EXPDAT. DPM file is generated in the current directory, which is a backup file.
If you want to specify the name and path of the backup file, add the parameter. The command is as follows:
exp system/orcl file=c:\oracle.dmp full=y
2. Full-Database Import
imp system/orcl full=y
If the file parameter is not specified, the backup file EXPDAT. DMP is used for import by default.
If the file parameter is specified, the backup file is restored according to the specified file.
imp system/orcl full=y file=c:\oracle.dmp
Before executing the import command, make sure that there are no objects to be imported in the oracle database. Otherwise, the following message is displayed:
(2) Use the cmd command to export and import data by user
Export by user
exp system/orcl owner=scott file=c:\scott.dmp
Import by user
imp system/orcl file=c:\scott.dmp fromuser=scott
(3) Use the cmd command to export and import data by table
Export by table
exp scott/tiger file = c:\scott.dmp tables = emp,dept
Use the tables parameter to specify the table to be exported. If multiple tables are separated by commas.
Import by table
imp scott/tiger file = c:\scott.dmp tables = emp,dept
3. If you use Navicat for backup, you can refer to Navicat official website related tutorials (http://www.formysql.com/navicat/jiqiao)