Run the exp and imp commands to back up 11 GB of data. When importing 10 Gb of data, an error is thrown: the exported file is not valid, and the header verification fails. The import is not terminated successfully.
Today, I encountered this situation. When I set up a test environment, a project used a database of 11 GB while the test machine was a database of 10 Gb. I followed the normal idea and reported an error: the import was not terminated. I searched the internet for a while. It turned out to be a different version;
Next, I will record the entire process of the import operation, and I have made a record of my own knowledge. I also hope that I can easily meet my needs!
1. Use the expdp command to back up data on the 11g Server
Expdp userid = 'sys/SYS @ daggis as sysdba 'schemas = oa directory = DATA_PUMP_DIR dumpfile = dag. dmp logfile = dag. log version = 10.2.0.1.0
(Screen: C: \ Documents ents and Settings \ Administrator> expdp userid = 'System/sys @ gis 'schemas
Directory = data_pump_dir dumpfile = dag. dmp logfile = dag. log version = 10.2.0.1.0)
The red text is rewritten as needed. For example, if my sys password is sys, the database sid is daggis, and the user name to be exported is oa, it is imported to the Oracle database of version 10.2.0.1.0. Aa. dmp and aa. log will be generated in the 11g dpdump directory. For example, if my 11g is mounted under the D disk, It is dag. dmp is generated in the Directory D:/app/Administrator/admin/cuc/dpdump.
2. Use the impdp command to restore data on a 10 Gb Server
Step: 1. Create a database 2. Create a tablespace 3. Create a user and authorize 4. Copy dag. dmp to the 10 Gb dpdump directory 5. Import impdp to the database
1. Create a database: directly create a database (instance) in database configuration assistant ).
2. create a tablespace: create tablespace OA datafile 'd: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ oa. dbf' size 400 m autoextend on next 20 m online;
3. User Creation:
Create user oa identified by oa;
Authorization:
Alter user OA default tablespace OA quota unlimited on OA;
Grant create session to oa;
Grant connect to oa;
Grant connect, resource, dba to oa;
Grant create table to oa;
Grant create view to oa;
Grant create trigger to oa;
Grant select any table to oa;
Grant create sequence to oa;
Grant create procedure to oa;
Grant create role to oa;
Grant create type to oa;
Grant grant any privilege to oa;
4. Import: first, 10 Gb of data is installed in the D:/root directory on the test machine. the dmp file is copied to the Directory D: \ oracle \ product \ 10.2.0 \ admin \ daggis \ udump.
Before importing data, you must create a directory before importing the data. Otherwise, an error is returned:
ORA-39001: Invalid parameter value
ORA-39000: dumped file description Error
ORA-31640: Unable to open the dump file to read "D: \ p \ dag. dmp"
ORA-27041: Unable to open file
OSD-04002: Unable to open file
O/S-Error: (OS 2) the system cannot find the specified file.
The command for creating a directory is as follows:
Sqlplus sys/sys @ daggis
SQL> create directory dump_dir as 'C: \ oracle \ product \ 10.2.0 \ admin \ daggis \ udump ';
Impdp userid = 'sys/SYS @ daggis as sysdba 'schemas = oa directory = DATA_PUMP_DIR dumpfile = dag. dmp logfile = dag. log version = 10.2.0.1.0
(Command screenshot: C: \ Documents ents and Settings \ Administrator> impdp userid = 'sys/sys @ daggis as sysdba's
Chemas = oa directory = data_pump_dir dumpfile = directed acyclic graph (dag). dmp logfile = directed acyclic graph (dag). log version = 10.2.
0.1.0)
So far, all the operations have been completed, and the message for a long time has finally been displayed: The operation is completed!
In the preceding command line, the red and blue parts are rewritten as needed. For example, if my sys password is sys and the database sid is daggis, You need to import the user name to oa and to the Oracle database of version 10.2.0.1.0. Dag. log is generated in the 10 Gb dpdump directory.
Finally, we have a command to check the total number of users of the original object. You can perform verification as needed. Run the command once on the machine that exports the database and once on the machine that imports the database to see if the result is the same:
SQL> select count (*) from dba_objects where owner in ('hangou', 'up', 'qishun ');
Well, the above is all my operations. If you have a better way to complete it, please remember to share it! Everyone learns from each other and makes progress together!