4.1 权限授予
C:\oracle\product\9.2.0\db_1\db_script\exp_imp>set nls_lang=american_america.zhs16gbk
C:\oracle\product\9.2.0\db_1\db_script\exp_imp>sqlplus "/ as sysdba
SQL*Plus: Release 9.0.1.0.1 - Production on Thu Aug 23 09:42:52 2012
(c) Copyright 2001 Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
With the Partitioning option
JServer Release 9.0.1.1.1 - Production
SQL> grant imp_full_database to scott;
Grant succeeded.
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
With the Partitioning option
JServer Release 9.0.1.1.1 - Production
C:\oracle\product\9.2.0\db_1\db_script\exp_imp>
4.2 创建imp_parameter_user.dat文件(略)
4.3 执行imp操作
C:\oracle\product\9.2.0\db_1\db_script\exp_imp>imp parfile=imp_parameter_user.dat
Import: Release 9.0.1.1.1 - Production on Thu Aug 23 09:43:40 2012
(c) Copyright 2001 Oracle Corporation. All rights reserved.
Password:
Connected to: Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
With the Partitioning option
JServer Release 9.0.1.1.1 - Production
Export file created by EXPORT:V09.00.01 via conventional path
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing HR's objects into SCOTT_TEST
. . importing table "DEPARTMENTS" 27 rows imported
. . importing table "EMPLOYEES" 107 rows imported
IMP-00017: following statement failed with ORACLE error 942:
"ALTER TABLE "DEPARTMENTS" ADD CONSTRAINT "DEPT_LOC_FK" FOREIGN KEY ("LOCATI"
"ON_ID") REFERENCES "LOCATIONS" ("LOCATION_ID") ENABLE NOVALIDATE"
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"ALTER TABLE "EMPLOYEES" ADD CONSTRAINT "EMP_JOB_FK" FOREIGN KEY ("JOB_ID") "
"REFERENCES "JOBS" ("JOB_ID") ENABLE NOVALIDATE"
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00041: Warning: object created with compilation warnings
"CREATE TRIGGER "SCOTT_TEST".secure_employees"
" BEFORE INSERT OR UPDATE OR DELETE ON employees"
""
"BEGIN"
" secure_dml;"
"END secure_employees;"
IMP-00041: Warning: object created with compilation warnings
"CREATE TRIGGER "SCOTT_TEST".update_job_history"
" AFTER UPDATE OF job_id, department_id ON employees"
" FOR EACH ROW"
""
"BEGIN"
" add_job_history(:old.employee_id, :old.hire_date, sysdate,"
" :old.job_id, :old.department_id);"
"END;"
About to enable constraints...
IMP-00017: following statement failed with ORACLE error 2430:
"ALTER TABLE "DEPARTMENTS" ENABLE CONSTRAINT "DEPT_LOC_FK""
IMP-00017: following statement failed with ORACLE error 2430:
"ALTER TABLE "EMPLOYEES" ENABLE CONSTRAINT "EMP_JOB_FK""
Import terminated successfully with warnings.
C:\oracle\product\9.2.0\db_1\db_script\exp_imp>
(注:imp departments与employees两个张已经导入数据,但后续启用约束及其他类型定义时报相关表不存在错误,因为我们没有导入其他相关表,所以人为忽略此处错误吧.)
从某个用户或某几个用户的导出文件中取某些表导入到其他用户,同样需要执行导入操作的用户具有imp_full_database的权限.注意导入参数文件的书写内容.
Oracle9iDatabase Utilities
Release 1 (9.0.1)
Part Number A90192-01
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/11780477/viewspace-741676/ ,如需转载,请注明出处,否则将追究法律责任。