Data export:
1 completely export database test, user Name System Password Manager exported to D:/daochu.dmp
Exp System/manager@test file=d:/daochu.dmp full=y
2 Exporting a table from the system user in the database to the SYS user
Exp system/manager@test file=d:/daochu.dmp owner= (System,sys)
3 Export the table inner_notify, Notify_staff_relat in the database
Exp AICHANNEL/AICHANNEL@TESTDB2 file= d:/data/newsmgnt.dmp tables= (Inner_notify,notify_staff_relat)
4 Export the fields in the table table1 in the database filed1 with the data beginning with "00"
Exp system/manager@test file=d:/daochu.dmp tables= (table1) query=/"where filed1 like ' 0% '/"
Data import:
1 Import the data from D:/DAOCHU.DMP into the test database.
Imp system/manager@test file=d:/daochu.dmp
Imp aichannel/aichannel@hust full=y file=file= d:/data/newsmgnt.dmp ignore=y
There may be something wrong with it, because some tables already exist, and then it complains, and the table is not imported.
Just add ignore=y to the back.
2 Import the table table1 in D:/daochu.dmp
Imp system/manager@test file=d:/daochu.dmp tables= (table1)
Basically, the import export above is sufficient. In many cases, you should first delete the table completely and then import it. Attention:
The operator must have sufficient permissions, and the permission is not sufficient for it to prompt.
Import Export utility to implement logical backup and recovery of a database
Export utility to back up the object definitions and data in a database into an operating system binary file
Import uses programs to read binary export files and load objects and data into the database
The Export Amount Import utility features:
1. Can save table structure and data by time
2. Allows you to export the specified table and re-import it into a new database
3. The database can be migrated to another heterogeneous server
4. Transfer data between two different versions of Oracle databases
5. Backup and recovery in the online state
6. Can rearrange the storage structure of the table, reduce links and disk fragmentation
Invoke three methods of importing exports:
Parameters and parameter values in the command execution program
Interactively prompts the user to enter the value of the parameter individually
Allows the user to store run parameters and parameter values in a parameter file so that the parameters are reused
Four modes of importing exported database objects: Full database, table, user, tablespace
Import all objects that export the entire database
Import export one or more specified tables or tablespaces
Import export all objects in a user mode
Import export all objects in one or more specified table spaces
The export use program has the following commonly used command parameters
Parameter description
USERID determine the user name and password to execute the Export utility
Buffer determines the size of the buffers used when exporting data, in bytes
file specifies the name of the exported binary file, and the default extension is. dmp
Full specifies whether to export in all databases, only authorized users can use this parameter
OWNER List of database users to export
Help specifies whether to display a helpful message and parameter descriptions
ROWS determines whether the data in the table is to be exported
When tables are exported as a table, specify the names of the tables and partitions that you want to export
PARFILE Specifies the name of the parameter to pass to the export utility
tablespaces Specifies the name of the tablespace to export when exporting by table space
Export Utility
Export Data by user
Exp gmd/gmd@oracle file=d:/1.dmp OWNER=GMD
Export data as a table
Exp gmd/gmd@oracle tables= (grp_province,grp_city,grp_area) file=d:/2.dmp
Export Data by Table space
Exp system/oracle@oracle tablespaces= (GMD) file=d:/3.dmp
Export data using a parameter file
Exp system/oracle@oracle parfile= ' d:/parameters.txt '
The import Use program has the following commonly used command parameters
Parameter description
USERID Specifies the user name and password to perform the import
buffer specifies the size of the buffers used to read data, in bytes
COMMIT Specifies whether to commit after each array (whose size is set by the buffer parameter) is inserted
file specifies the binary file name to import
FROMUSER Specifies the user mode to import from the export dump file
TOUSER Specifies the name of the user to import the object into. Fromuser and Touser can be different
Full Specifies whether you want to import the entire export dump file
tables specifies the list of tables to import
ROWS Specifies whether you want to import rows from the table
PARFILE Specifies the name of the parameter to pass to the import utility, which can contain all the parameters listed here
IGNORE the errors encountered when importing, the default is n
Tablespaces Import by Table space, listing table space names to import
Import Utility
Import a database by an entire file
Imp gmd/gmd@oracle file=d:1.dmp ignore=y full=y
Import to fantasy user by halibut User's Table
Imp gmd/gmd@oracle file=2.dmp fromuser=halibut touser=fantasy tables= (t_user,role)
Importing data using parameter files
Imp system/oracle@oracle parfile= ' D:/paramenters.txt '