SQL> ho exp cyco/hummer2008 Export: Release 10.2.0.1.0- Production on Thu Mar 623:01:102008 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0- Produc tion With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engin e options Enter array fetch buffer size: 4096> Export file: EXPDAT.DMP > H:/Databases/oracle/Backup/init_cyco.dmp//优快云居然把/解释成了转义符 (2)U(sers), or (3)T(ables): (2)U > t Export table data (yes/no): yes > Compress extents (yes/no): yes > Export done in ZHS16GBK charactersetand AL16UTF16 NCHARcharacterset About to export specified tables via Conventional Path ... Table(T) or Partition(T:P) to be exported: (RETURNto quit) > users . . exporting table USERS 2 rows exported Table(T) or Partition(T:P) to be exported: (RETURNto quit) > Export terminated successfully without warnings.
再执行
SQL> ho imp cyco/hummer2008 Import: Release 10.2.0.1.0- Production on Thu Mar 621:55:392008 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0- Produc tion With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engin e options Import file: EXPDAT.DMP > H:/Databases/oracle/Backup/init_cyco.dmp Enter insert buffer size (minimum is8192) 30720> Export file created by EXPORT:V10.02.01 via conventional path import done in ZHS16GBK charactersetand AL16UTF16 NCHARcharacterset List contents of import fileonly (yes/no): no > Ignore create error due to object existence (yes/no): no > yes Import grants (yes/no): yes > Import table data (yes/no): yes > Import entire export file (yes/no): no > Username: cyco Enter table(T) or partition(T:P) names. Null list means all tables foruser Enter table(T) or partition(T:P) name or . if done: users Enter table(T) or partition(T:P) name or . if done: . importing CYCO's objects into CYCO . importing CYCO's objects into CYCO IMP-00017: following statement failed with ORACLE error 1031: "CREATETABLE "USERS" ("USERNAME" VARCHAR2(10) NOTNULL ENABLE) PCTFREE 10 " "PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELI" "ST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "ALASKA" LOGGING NOCOMPRESS" IMP-00003: ORACLE error 1031 encountered ORA-01031: insufficient privileges Import terminated successfully with warnings.
SQL> ho imp 'sys/hummer2008 as sysdba' Import: Release 10.2.0.1.0- Production on Thu Mar 621:58:072008 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0- Produc tion With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engin e options Import file: EXPDAT.DMP > H:/Databases/oracle/Backup/init_cyco.dmp Enter insert buffer size (minimum is8192) 30720> Export file created by EXPORT:V10.02.01 via conventional path Warning: the objects were exported by CYCO, notby you import done in ZHS16GBK charactersetand AL16UTF16 NCHARcharacterset List contents of import fileonly (yes/no): no > Ignore create error due to object existence (yes/no): no > yes Import grants (yes/no): yes > Import table data (yes/no): yes > Import entire export file (yes/no): no > Username: cyco Enter table(T) or partition(T:P) names. Null list means all tables foruser Enter table(T) or partition(T:P) name or . if done: users Enter table(T) or partition(T:P) name or . if done: . importing CYCO's objects into SYS . importing CYCO's objects into SYS . . importing table "USERS" 2 rows imported Import terminated successfully without warnings.
看来成功了,
SQL> select * from users;
no rows selected
怎么会没有记录呢?
细看上面的运行记录,importing CYCO's objects into SYS 原来,导入到sys用户下了。原来默认的touser参数就是运行imp的用户名,本例中是sys。
还有,网上找的一些命令中的 volsize=0 这个参数是不能用的,否则会提示 IMP-00022: failed to process parameters, type 'IMP HELP=Y' for help IMP-00000: Import terminated unsuccessfully