1

Temat: Błąd bazy po wyłączeniu prądu

Witam Wszystkich!
Potrzebuję pomocy może, ktoś z Was spotkał się z czymś takim:
Po wyłączeniu zasilania komputera przy działającej bazie ona się wysypała nie wiem jak ją przywrócić by nie stracić tam wprowadzonych danych.
Log:
2009-04-21 16:19:47 LOG:  database system was shut down at 2009-04-21 16:19:33 Środkowoeuropejski czas stand.
2009-04-21 16:19:47 LOG:  checkpoint record is at 1/10405828
2009-04-21 16:19:47 LOG:  redo record is at 1/10405828; undo record is at 0/0; shutdown TRUE
2009-04-21 16:19:47 LOG:  next transaction ID: 0/4250497; next OID: 30607
2009-04-21 16:19:47 LOG:  next MultiXactId: 11; next MultiXactOffset: 21
2009-04-21 16:19:47 LOG:  database system is ready
2009-04-21 16:21:19 LOG:  received fast shutdown request
2009-04-21 16:21:19 LOG:  shutting down
2009-04-21 16:21:19 LOG:  database system is shut down
2009-04-21 16:21:21 LOG:  logger shutting down

Wydaje mi się, że gdzieś jest otwarty jakiś proces ale nie wiem jak go zamknąć i nie można wykonać z tego kopii ani zalogować się do panelu pgAdmin

Proszę o odpowiedź
pozdrawiam

2

Odp: Błąd bazy po wyłączeniu prądu

A co dostajesz przy próbie uruchomienia bazy? To co zamieściłeś to chyba nie jest log ze startu?

3

Odp: Błąd bazy po wyłączeniu prądu

błąd przy łączeniu z bazą danych

4

Odp: Błąd bazy po wyłączeniu prądu

jeszcze wcześniejszy log

2009-04-21 11:45:41 LOG:  database system was interrupted at 2009-04-21 09:02:40 Środkowoeuropejski czas stand.
2009-04-21 11:45:41 LOG:  checkpoint record is at 1/10405648
2009-04-21 11:45:41 LOG:  redo record is at 1/10405648; undo record is at 0/0; shutdown FALSE
2009-04-21 11:45:41 LOG:  next transaction ID: 0/4250497; next OID: 30607
2009-04-21 11:45:41 LOG:  next MultiXactId: 11; next MultiXactOffset: 21
2009-04-21 11:45:41 LOG:  database system was not properly shut down; automatic recovery in progress
2009-04-21 11:45:41 LOG:  record with zero length at 1/10405698
2009-04-21 11:45:41 LOG:  redo is not required
2009-04-21 11:45:41 LOG:  database system is ready
2009-04-21 12:15:32 LOG:  received fast shutdown request
2009-04-21 12:15:33 LOG:  shutting down
2009-04-21 12:15:33 LOG:  database system is shut down
2009-04-21 12:15:34 LOG:  logger shutting down

5

Odp: Błąd bazy po wyłączeniu prądu

Ale co to znaczy 'błąd przy łączeniu z bazą'? Jakiś konkretny wpis z logów postgresa przy próbie uruchomienia bazy?

6

Odp: Błąd bazy po wyłączeniu prądu

A gdzie tego szukać logi już przesłałem są gdzieś jeszcze jakieś zapisane?

7

Odp: Błąd bazy po wyłączeniu prądu

A jak masz skonfigurowanego postgresa. Logi ktore przyslales sa z 11:45 i 16:19. jesli teraz uruchamiasz baze to raczej nie dotycza one tej operacji. Odszukaj w pliku postgresql.conf 'sekcji' ERROR REPORTING AND LOGGING. Ponizej bedziesz mial ustawienia logów. Sprawdz jak masz ustawione opcje

log_destination
redirect_stderr
log_directory
log_filename

Plik postgresql.conf jest pewnie w klastrze

8

Odp: Błąd bazy po wyłączeniu prądu

Ustawienia:

# - Where to Log -

log_destination = 'stderr'        # Valid values are combinations of
                    # stderr, syslog and eventlog,
                    # depending on platform.

# This is used when logging to stderr:
redirect_stderr = on            # Enable capturing of stderr into log
                    # files
                    # (change requires restart)

# These are only used if redirect_stderr is on:
#log_directory = 'pg_log'        # Directory where log files are written
                    # Can be absolute or relative to PGDATA
#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # Log file name pattern.
                    # Can include strftime() escapes
#log_truncate_on_rotation = off # If on, any existing log file of the same
                    # name as the new log file will be
                    # truncated rather than appended to. But
                    # such truncation only occurs on
                    # time-driven rotation, not on restarts
                    # or size-driven rotation. Default is
                    # off, meaning append to existing files
                    # in all cases.
#log_rotation_age = 1d            # Automatic rotation of logfiles will
                    # happen after that time.  0 to
                    # disable.
#log_rotation_size = 10MB        # Automatic rotation of logfiles will
                    # happen after that much log
                    # output.  0 to disable.

# These are relevant when logging to syslog:
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'


# - When to Log -

#client_min_messages = notice        # Values, in order of decreasing detail:
                    #   debug5
                    #   debug4
                    #   debug3
                    #   debug2
                    #   debug1
                    #   log
                    #   notice
                    #   warning
                    #   error

#log_min_messages = notice        # Values, in order of decreasing detail:
                    #   debug5
                    #   debug4
                    #   debug3
                    #   debug2
                    #   debug1
                    #   info
                    #   notice
                    #   warning
                    #   error
                    #   log
                    #   fatal
                    #   panic

#log_error_verbosity = default        # terse, default, or verbose messages

#log_min_error_statement = error    # Values in order of increasing severity:
                     #   debug5
                    #   debug4
                    #   debug3
                    #   debug2
                    #   debug1
                     #   info
                    #   notice
                    #   warning
                    #   error
                    #   fatal
                    #   panic (effectively off)

#log_min_duration_statement = -1    # -1 is disabled, 0 logs all statements
                    # and their durations.

#silent_mode = off            # DO NOT USE without syslog or
                    # redirect_stderr
                    # (change requires restart)

# - What to Log -

#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = off
#log_connections = off
#log_disconnections = off
#log_duration = off
log_line_prefix = '%t '            # Special values:
                    #   %u = user name
                    #   %d = database name
                    #   %r = remote host and port
                    #   %h = remote host
                    #   %p = PID
                    #   %t = timestamp (no milliseconds)
                    #   %m = timestamp with milliseconds
                    #   %i = command tag
                    #   %c = session id
                    #   %l = session line number
                    #   %s = session start timestamp
                    #   %x = transaction id
                    #   %q = stop here in non-session
                    #        processes
                    #   % = '%'
                    # e.g. '<%u%d> '
#log_statement = 'none'            # none, ddl, mod, all
#log_hostname = off

9

Odp: Błąd bazy po wyłączeniu prądu

Nie wiem jaka masz sciezke do klastra (podawales ja pewnie podczas inicjalizacji bazy poleceniem initdb). Ale wlasnie w klastrze powinien byc katalog pg_log a w nim pliki z logami. Pliki w nazwie maja date i godzine. Spróbuj uruchomic serwer. Pownien pojawic sie nowy plik z logiem. Wklej na forum jego zawartosc.

10

Odp: Błąd bazy po wyłączeniu prądu

Za każdym razem występuje to co z godz. 16 mam jeszcze log zaraz po wyłączeniu prądu:
2009-04-21 08:12:39 LOG:  database system was shut down at 2009-04-20 19:09:30 Środkowoeuropejski czas stand.
2009-04-21 08:12:39 LOG:  checkpoint record is at 1/FF6B298
2009-04-21 08:12:39 LOG:  redo record is at 1/FF6B298; undo record is at 0/0; shutdown TRUE
2009-04-21 08:12:39 LOG:  next transaction ID: 0/4246551; next OID: 30607
2009-04-21 08:12:39 LOG:  next MultiXactId: 11; next MultiXactOffset: 21
2009-04-21 08:12:39 LOG:  database system is ready
2009-04-21 08:45:32 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:45:32 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:45:32 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:45:32 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:45:32 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:45:32 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:45:32 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:45:32 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:45:32 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:45:32 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:45:32 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:45:32 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:45:32 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:45:32 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:45:32 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:45:32 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:45:35 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:45:35 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:45:35 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:45:35 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:46:28 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:46:28 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:46:29 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:46:29 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:47:14 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:47:14 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:47:15 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:47:15 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:47:56 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:47:56 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:47:56 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:47:56 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:50:38 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:50:38 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:50:38 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:50:38 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:51:50 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:51:50 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:51:51 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:51:51 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:51:56 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:51:56 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:51:56 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:51:56 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:51:56 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:51:56 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:51:56 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:51:56 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:51:56 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:51:56 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:53:18 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:53:18 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:53:19 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:53:19 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:54:55 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:54:55 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:54:56 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:54:56 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:55:59 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:55:59 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:55:59 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:55:59 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:57:07 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:57:07 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:57:08 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:57:08 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:58:21 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:58:21 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:58:21 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:58:21 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:58:21 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:58:21 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:58:21 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:58:21 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:58:21 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 08:58:21 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:58:26 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:58:26 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:58:27 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:58:27 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:59:32 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:59:32 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 08:59:33 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 08:59:33 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 09:00:21 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 09:00:21 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 09:00:21 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 09:00:21 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 09:01:17 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 09:01:17 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 09:01:17 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 09:01:17 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 09:01:17 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 09:01:17 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 09:01:17 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 09:01:17 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 09:01:18 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 09:01:18 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 09:01:21 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 09:01:21 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 09:01:21 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 09:01:21 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 09:01:21 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 09:01:21 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 09:01:38 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 09:01:38 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 09:01:56 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 09:01:56 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 09:01:56 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 09:01:56 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 10:47:41 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 10:47:41 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 11:20:25 WARNING:  nonstandard use of \\ in a string literal at character 64
2009-04-21 11:20:25 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 11:20:32 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 11:20:32 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
2009-04-21 11:20:32 WARNING:  nonstandard use of \\ in a string literal at character 117
2009-04-21 11:20:32 HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.

a teraz postgres nie robi już logów
spróbowalem przenieść bazę i postawić jeszcze raz skopiowałem data i zastąpiłem przy zamkniętym procesie ale nic nie dało

Nie dodałem najważniejszego postgres 8.2 wersja pod Win

Ostatnio edytowany przez yaro (2009-04-21 23:05:52)

11

Odp: Błąd bazy po wyłączeniu prądu

W jaki spobób uruchamiasz serwer: pg_ctl start, czy moze pgadminem albo czyms inszym

Spróbuj w pliku postgresql.conf ustawić opcje

standard_conforming_strings=on

i zrestartowac serwer? Działa?

Jeśli nie ustaw

escape_string_warning = off

i zrestartuj serwer.

No i jeszcze pytanie co sie dziala z baza przed awaria? Wykonywales moze jakies skomplikowane inserty albo jakies COPY z pliku?

Ostatnio edytowany przez rski (2009-04-21 23:10:59)

12

Odp: Błąd bazy po wyłączeniu prądu

Niestety cały czas to samo! Brak połączenia
Co do ostatniego pytania to cały czas baza była używana i dopisywane nowe rekordy kopi z pliku nie było robionej.
Uruchomienie serwera Start service opcja standardowa instalowana razem z postgres

Ostatnio edytowany przez yaro (2009-04-21 23:22:13)

13

Odp: Błąd bazy po wyłączeniu prądu

Jak mniemam masz postgresa pod winda. A mozesz go uruchomic poleceniem

pg_ctl start

I powiedz mi jeszcze czy masz cos w katalogu pg_xlog?

14

Odp: Błąd bazy po wyłączeniu prądu

niestety procedura wywołuje się lecz w procesach nie widać aby był aktywny postgres
tak mam jakieś pliki z logami ale one są po 16MB i nie da rady ich otworzyć ewentualnie może jakimś innym programem niż Notepad++ są zakodowane coś w stylu NULL NULL i tp...
Tak pod Win Vista