首页 > Linux操作系统 > Linux操作系统 > imp_ccpt_db_full
表結構及某些物件(trigger,procedure)存在的情況下數據導入。
1. truncate channel用戶data之前,注意disable掉FK.
select 'alter table '||owner||'.'||table_name|| ' disable constraint '||constraint_name||' ;'
from all_constraints where wner='CHANNEL' and constraint_type='R' ;
2. disable channel用戶下的 job及trigger, 可以直接在toad中作業。
3. truncate channel用戶下的表數據 .
select ' truncate table channel.'||object_name||' ;' from dba_objects
where wner='CHANNEL' and object_type='TABLE' ;
4. 使用最新dmp導入數據
imp 'system/"xxxxxx"' fromuser=channel touser=channel file=xxxxx.dmp log=ccptimp.log ignore=y
. . importing table "SL_SI" 0 rows imported
IMP-00017: following statement failed with ORACLE error 904:
"COMMENT ON COLUMN "SL_SI"."PO_ID" IS '请è´å•id _add by huangw'"
IMP-00003: ORACLE error 904 encountered
ORA-00904: "PO_ID": invalid identifier
4115
imp 'system/"xxxxxx"' fromuser=channel touser=channel file=2010-12-26_cathy.dmp log=ccptimp_12_26.log ignore=y
imp 'system/"xxxxxx"' fromuser=channel touser=channel file=ccpt.dmp tables=BD_PROD log=ccptimp_12_26_2.log ignore=y
imp 'system/"xxxxxx"' fromuser=channel touser=channel file=ccpt.dmp tables=IC_STORE_PROD log=ccptimp_12_26_2.log ignore=y
imp 'system/"xxxxxx"@ccptdb' fromuser=channel touser=channel_test file=2010-12-26_cathy.dmp log=ccptimp_12_26.log ignore=y
5. enable FK 及job, triggers .
select 'alter table '||owner||'.'||table_name|| ' enable constraint '||constraint_name||' ;'
from all_constraints where wner='CHANNEL' and constraint_type='R' ;
alter table CHANNEL.PF_ACCESS_NODE enable constraint PF_ACCESS_NODE_R01
Error at line 339
ORA-02298: 無法驗證 (CHANNEL.PF_ACCESS_NODE_R01) - 找不到父項索引鍵
最好在toad中檢查一下FK是否有enable .
6. 檢查同義詞及權限(channel_ap,channel, channel_ap_role),角色。
7. 查看channel及channel_ap是否有execute及debug procedure及function等的權限。
8. 檢查sequence是否正常,檢查所有其他物件。
9. 導入的table 及列的注釋comment可能都是亂碼,需要重新執行腳本。
10. 以防丢失某些東西,可以在測試機上建立一個channel_test用戶,導入這個新的dmp文件,對比一下。
SQL> ALTER system set NLS_SORT = 'SCHINESE_PINYIN_M' scope=spfile ;
System altered.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25198367/viewspace-688916/,如需转载,请注明出处,否则将追究法律责任。