Question: what are shm and wal files?
Answer: The shared-memory file, if it exists, is located in the same directory as the database file and has the same name as the database file except with the 4 characters "-shm" appended. ... The shared-memory file is created when the WAL file is created and is deleted when the WAL file is deleted.