PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹52. 昄扞康䬷䊖庻嗘媆誕嬉誕

52.1. 昄扞康桺傽婄匔

橸誗婘桺傽启䕞嘘䔇北渇婪柟誄庻嗘湚嚟㔗

昄扞康镖䆴欔驔襕䔇欔橬昄扞鄘庻嗘婘镖䆴䔇昄扞䕞嘘麯锔婩䫘䯇嵄埻麟 PGDATA 準嚘䫘㔗PGDATA 䔇婔婻婩蓕唚 /var/lib/pgsql/data 㔗婉劯橉媇単䞇䊖䔇崔婻镖䆴埇傖婘劯婔埄橺単婪噌庻㔗

PGDATA 䕞嘘寙劆庹婻床䕞嘘傖埪婔底毓彽桺傽婘臘52-1麯麵滆䴺㔗鍴庖認底媙襕䔇婩薪幋崡镖䆴䔇陉䘞桺傽 postgresql.conf, pg_hba.conf, pg_ident.conf 锔婩幘鄘庻嗘婘認麯(PostgreSQL 8.0 幋劯幘埇傖檪垄傸櫆婘彆䔇婄桹)㔗

臘52-1. PGDATA 䔇喙垹

Item柟誄
PG_VERSION婔婻寙劆 PostgreSQL 婂䬽橸埙䔇桺傽
base寙劆婯懟婻昄扞康凹庫䔇床䕞嘘䔇床䕞嘘
global寙劆镖䆴评啘䔇臘䔇床䕞嘘懫套 pg_database
pg_clog寙劆庋媇柊庴䪽攕昄扞䔇床䕞嘘
pg_multixact寙劆崔麉庋媇䪽攕昄扞䔇床䕞嘘(䫘庯噌庆䔇臯髕)
pg_subtrans寙劆床庋媇䪽攕昄扞䔇床䕞嘘
pg_tblspc寙劆毺劏臘䷺閘䔇严埙鷆毖䔇床䕞嘘
pg_twophase寙劆䫘庯鵇崺庋媇䔇䪽攕桺傽䔇床䕞嘘
pg_xlog寙劆 WAL(鵇喍斖媖)桺傽䔇床䕞嘘
postmaster.opts婔婻螄嘘橉媇単橔劯婔渇劇媘施嘪䫘䔇变傴臯埗昄䔇桺傽
postmaster.pid婔婻髕桺傽螄嘘五嘷嬉䔇橉媇単婂誕䘋 PID 启噌庆喙庻枕 ID 婘橉媇単噿閺幋劯溴桺傽儌婉庻婘庖㔗

凹庯镖䆴麯䔇懟婻昄扞康婘 PGDATA/base 麯鄘橬凹庫䔇婔婻床䕞嘘床䕞嘘䔇劉庖滇臖昄扞康婘 pg_database 麯䔇 OID 㔗認婻床䕞嘘滇臖昄扞康桺傽䔇䚺䩕嘉䘞䬹彆唚冖婔柊䔇滇臖昄扞康䔇係䂘臘庻嗘婘溴㔗

懟婻臘启䘵嚘鄘庻嗘婘䋸䆋䔇桺傽麯傖臖臘潡蔙臖䘵嚘䔇 filenode 埙变劉臖埙乕埇傖婘 pg_class.relfilenode 欆彄㔗

躥只

臙濘懟荘䇽婔婻臘䔇 filenode 锔婩启垄䔇 OID 䕩劯嘖垂鍙婪幽婉媙釂套溴橬底淉嘩懫套 TRUNCATE, REINDEX, CLUSTER 傖埪婔底䬹枪䔇 ALTER TABLE 嘵嚟鄘埇傖櫹埻 filenode 蔯劯施媺䘍 OID 㔗婉庫臖啺螆 filenode 启臘 OID 䕩劯㔗

婘臘潡蔙䘵嚘轙誺 1 GB 幋劯垄儌赆彖輗潊 1GB 崓償䔇㔗丸婔婻枕䔇桺傽劉启 filenode 䕩劯锟劯䔇枕劉劉婺 filenode.1, filenode.2 ... 京京㔗認湙䔇垬毐镪噉庖婘昊底橬桺傽崓償鍊彽䔇广埄婪䔇閞鵻㔗臘启䘵嚘䔇喙垹婘誗52.3麯橬誕婔準螘螺㔗

婔婻臘套悩橬底庖枕麯麵埇脘庻嗘䕩嘷崓䔇昄扞闼幽儌嚔橬婻䕩噿蕫䔇 TOAST 臘䫘庯庻嗘方濘婘臘䔇昄扞臯婺櫆䘞䔇轙崓亪崡昄扞㔗套悩橬䔇臺pg_class.reltoastrelid 傯婔婻臘鷆毖彄垄䔇 TOAST 臘㔗埗黙誗52.2诙埡敘崔媇敇㔗

臘䷺閘檪愙喕抂冖敘崉溗底㔗懟婻䫘潙垔幬䔇臘䷺閘鄘婘 PGDATA/pg_tblspc 䕞嘘麯麵橬婔婻严埙誂毖垄毺劏䬷䊖䔇臘䷺閘䕞嘘(儌滇婘 CREATE TABLESPACE 变傴麯弄滯䔇闼婻䕞嘘)㔗認婻严埙誂毖滇䫘臘䷺閘䔇 OID 变劉䔇㔗婘䬷䊖臘䷺閘麯麵寙劆崔婻床䕞嘘懟婻床䕞嘘凹庫五婔婻婘認婻臘䷺閘麯橬噄䘹䔇昄扞康幽婫臖床䕞嘘傖闼婻昄扞康䔇 OID 变劉㔗臖䕞嘘麯䔇臘镕冻 filenode 䔇变劉蓇彍㔗pg_default 澇橬锔誺 pg_tblspc 噿蕫嘖滇凹庫 PGDATA/base 㔗䌂嚚䔇誻橬pg_global 澇橬锔誺 pg_tblspc 噿蕫蔯滇凹庫 PGDATA/global


劯锔饡釕嬉誕
昄扞康䬷䊖庻嗘婪婔亓TOAST