iT邦幫忙

0

postgresql資料庫還原問題

  • 分享至 

  • xImage

請教大家
因為有拿到一個postgresql備份的data.backup資料庫檔案(postgresql為9.0版本,linux作業系統),而我還原到另外一台我自己架的postgresql,但卻出現下列的訊息

C:/Program Files/PostgreSQL/9.0/bin\pg_restore.exe --host 
localhost --port 5432 --username "postgres" --dbname 
"Confluence" --data-only --verbose "C:\confluence.backup"
abelableid, lab...
pg_restore: 還原資料表"content_perm"的資料
pg_restore: [壓縮器(db)] TOC記錄3731有錯誤;0 404949 TABLE DATA content_perm conf_admin
pg_rest料
pg_restore: [壓縮器(db)] TOC記錄3741有錯誤;0 405003 TABLE DATA cwd_directory_operation conf_admin
pg_restore: [壓縮器(db)] could not execute quyid, groupid) FROM stdin;

pg_restore: 還原資料表"extrnlnks"的資料
pg_restore: [壓縮器(db)] TOC記錄3753有錯誤;0 405060 TABLE DATA extrnlnks conf_admi;

pg_restore: 還原資料表"notifications"的資料
pg_restore: [壓縮器(db)] TOC記錄3763有錯誤;0 405105 TABLE DATA notifications conf_admin
pg_restore: [壓縮器(db怍M權限
pg_restore: 為 TABLE DATA cwd_application_address 設定擁有者和權限
pg_restore: 為 TABLE DATA cwd_application_attribute 設定擁有者和權限
pg_restore: 為 TABLE DATA local_members 設定擁有者和權限
................

警告,還原時忽略錯誤:65

進程遞回離開碼 1。

這可能是為什麼呢?及有否這部分的還原說明呢?感謝

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

2
James
iT邦大師 6 級 ‧ 2014-08-21 08:09:32
最佳解答

你還原的時候加了

--data-only

你確定有先把table schema開好嗎?

看更多先前的回應...收起先前的回應...
ektrontek iT邦研究生 1 級 ‧ 2014-08-21 12:34:06 檢舉

感謝
TABLE SCHEMA不是還原後會一起倒回去嗎?

James iT邦大師 6 級 ‧ 2014-08-21 14:16:26 檢舉

要先有SCHEMA才能倒資料,你加了--data-only參數,就不會還原SCHEMA

ektrontek iT邦研究生 1 級 ‧ 2014-08-21 19:32:29 檢舉

資料與SCMHME有匯入成功了,調整的方式如下

但有錯誤訊息產生,

<pre class="c" name="code">C:/Program Files/PostgreSQL/9.2/bin\pg_restore.exe --host localhost --port 5432 --username "postgres" --dbname "confluence" --no-password  --schema-only --verbose "C:\share\confluence.backup"

pg_restore: creating TABLE content_label

pg_restore: creating TABLE likes
pg_restore: [archiver (db)] Error from
    Command was: CREATE INDEX band_cont_key_idx ON bandana USING btree (bandanacontext, bandanakey);
.......................
pg_restore: setting owner and privileges for TRIGGER logininfo_audit
WARNING: errors ignored on restore: 309

進程遞回離開碼 1。

這可能是為什麼呢?煩請前輩在指點迷津

James iT邦大師 6 級 ‧ 2014-08-22 09:14:52 檢舉

不確定,也許bandana這個table還沒建起來就先建INDEX,如果是的話重建一次這個INDEX就好了。

我要發表回答

立即登入回答