Last active
November 20, 2024 13:34
-
-
Save radityopw/9535a26ea4a9b2b2c028889d28436719 to your computer and use it in GitHub Desktop.
catatan postgresql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- copy dari c:\postgresql\12-backup\base ke c:\PostgreSQL\12-radit-test | |
-- ubah postgresql.conf | |
-- ganti port (saya ganti ke 5433) | |
-- matikan archive wal | |
-- comment tentang wal | |
restore_command = 'copy "C:\\PostgreSQL\\12-backup\\archive\\%f" "%p"' | |
--jika PITR (point in time recovery) isi recovery_target_time = '' misalnya 2023-02-23 14:32:00 | |
-- buat file yang bernama recovery.signal | |
-- running manual | |
pg_ctl start -D c:\PostgreSQL\12-radit-test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ini lokasi nya ke c:\PostgreSQL\12-backup\base | |
pg_basebackup.exe -h localhost -p 5432 -U postgres -D c:\PostgreSQL\12-backup\base -Fp -Xn -P |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- membuat cluster baru | |
initdb.exe -D c:\PostgreSQL\12-data-radit -W -U postgres -A md5 | |
-- ubah postgresql.conf | |
-- ganti port (saya ganti ke 5433) | |
-- running manual | |
-- kalau di ubuntu setting PATH=$PATH:/usr/lib/postgresql/{version}/bin | |
pg_ctl start -D c:\PostgreSQL\12-data-radit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wal_level = replica | |
archive_command = 'copy "%p" "C:\\PostgreSQL\\12-backup\\archive\\%f"' # ini di remote folder | |
archive_mode = on | |
archive_timeout = 900 # 15 menit -> mengacu pada RPO | |
-- untuk cek sekarang WAL file apa | |
SELECT pg_walfile_name(pg_current_wal_lsn()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- copy dari c:\postgresql\12-backup\base ke c:\PostgreSQL\12-radit-data2 | |
-- ubah postgresql.conf | |
-- ganti port (saya ganti ke 5434) | |
-- matikan archive wal | |
-- comment tentang wal | |
restore_command = 'copy "C:\\PostgreSQL\\12-backup\\archive\\%f" "%p"' | |
-- buat file yang bernama standby.signal | |
-- running manual | |
pg_ctl start -D c:\PostgreSQL\12-radit-data2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment