Ms7 Search
Google 搜尋 翻譯
calendar
« 二月 2025 »
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28    
近期文章
文章分類
網站連結
Syndicate

« | »

PostgreSql 的備份還原

2013-03-02 @ 10:16 in 行政系統偷吃步

用 pgAdmin III 的備份還原一直無法成功,我是從另一台的備份檔拿到另一台還原,可是一直失敗,真不知那台備份是如何做的,有空應該研究一下

在網上找到一個方法,雖然是最基本的,但是可以成功,方法如下:

備份:
pg_dump -U[使用者] -c [DB名稱] > xxx.sql  

還原:
1. dropdb -U[使用者] [DB];    //刪除舊資料庫
2. createdb -U[使用者] [DB]; //建資料庫
3 .psql -U[使用者] [DB] < xxx.sql    //匯入資料

這樣就成功了,雖然是最基本的 sql 備分,可是竟然是最好用的

迴響

行政系統資料庫 pg_restore

pg_dump -i -h localhost -p 5432 -U postgres -F c -b -v -f school.backup" school

school 資料庫有資料
pg_restore -U postgres -F c -c -d school school.backup

school 資料庫不存在,先建立空資料庫 school
pg_restore -U postgres -F c -d school school.backup

作者 shyong @ 21:38, 2014-03-24

PostgreSql 的備份還原 | 豬窩

Hmm is anyone else encountering problems with the images
on this blog loading? I'm trying to determine
if its a problem on my end or if it's the blog. Any suggestions would be greatly appreciated.

作者 g there @ 13:10, 2020-06-20

PostgreSql 的備份還原 | 豬窩

Hi, this weekend is good designed for me, for the
reason that this point in time i am reading this enormous informative
post here at my home.

作者 g this @ 04:22, 2020-06-21

PostgreSql 的備份還原 | 豬窩

Wow that was odd. I just wrote an incredibly long comment but after I clicked submit my
comment didn't show up. Grrrr... well I'm not writing all that over again. Anyway, just wanted to
say great blog!

作者 can g @ 01:59, 2020-06-22

PostgreSql 的備份還原 | 豬窩

continuously i used to read smaller articles that as well clear their motive, and that is also
happening with this paragraph which I am reading here.

作者 g https://tinyurl.com/rsacwgxy @ 07:58, 2020-06-23
1 2 3 4 5 6  下一篇»
發表迴響
 authimage