在導出過程中報了ORA-04031: unable to allocate 168 bytes of shared memory 的錯誤。
之後調整了3個參數的值,shared_pool_size,shared_pool_size_reserved
爲什麼說3個呢,因爲shared_pool_size 在pdb和cdb中是倆個值,得分別設置、而shared_pool_size_reserved是CDB的
報錯信息如下:
RA-04031: unable to allocate 65240 bytes of shared memory ("shared pool","select s.inst_id,s.addr,s.in...","sga heap(1,0)","KJSC rnb slots")
Use ADRCI or Support Workbench to package the incident.
表面上是我的機器的共享內存不足。
之後我擴容了shared_pool_size,
alter system set shared_pool_size = 200m scope=both;
需要注意的是保留值這個參數不能動態調整,只能先修改spfile之後重啓生效,一般是共享內存的1/10
alter system set shared_pool_size_reserved=20m scope=spfile;
重啓job之後還是報錯。
突然發現在job裏報過這樣的一個錯誤:
ORA-39097: Data Pump job encountered unexpected error -4031
這個錯誤除了系統設置之外還有權限的錯誤。
有可能是這個用戶沒有權限執行某些過程從而報錯的。
之後增加導出用戶權限、
grant create session, create table, create procedure, exp_full_database, imp_full_database to dp;
之後attach了在去start_job;
通過了。
總結,有時候數據庫報錯,他只會報錯誤卡在了那裏、而不會報導致這個錯誤產生的那個設置在那裏。
所以,一定要按照導出導入的標準流程來做、省的出現這些問題,會讓你繞很大的彎子。