Questions tagged [logs]

A sequential journal of database write operations that facilitates robust atomic write operations.

Transaction logs are a journalling mechanism employed by the database manager for atomic and consistent write functionality. They are written sequentially, indexed by a sequence number (Log Sequence number, or LSN) and contain a journal of database write operations. Depending on the implementation the logs may also contain rollback information.

The logs contain data about the changes to be made by pending transactions and markers for commit and checkpoint operations. Log information is always recorded before a transaction is committed, and commit entries are not recorded in the log until the changes have been persisted.

Database writes will typically generate entries that are immediately written to the logs and the write will also update entries in the buffer cache. Only one transaction can have a write lock on a record at any given point, so other processes will block on attempts to obtain a lock on that record. Periodic checkpoint operations flush dirty pages to disk.

Logs can be used for recovery and replication. A database is always backed up with respect to the log sequence number of the last committed transaction. If the data file is restored then logs can be rolled forward from the commit point to apply all transactions committed since that point. A similar mechanism is used for replication where log entries are copied and applied to the database on the replication target.

252 questions
117
votes
5 answers

How to safely change MySQL innodb variable 'innodb_log_file_size'?

So I'm fairly new to tuning InnoDB. I'm slowly changing tables (where necessary) from MyIsam to InnoDB. I've got about 100MB in innodb, so I increased the innodb_buffer_pool_size variable to 128MB: mysql> show variables like…
Derek Downey
  • 23,568
  • 11
  • 79
  • 104
79
votes
6 answers

Disable MySQL binary logging with log_bin variable

Default MySQL config file /etc/mysql/my.cnf installed by some debian package using APT often set log_bin variable, so binlog are enabled: log_bin = /var/log/mysql/mysql-bin.log When I want to disable binary logging on such installation, comment out…
Nicolas Payart
  • 2,508
  • 5
  • 28
  • 36
52
votes
6 answers

Can I see Historical Queries run on a SQL Server database?

Someone was running a query on our SQL Server database remotely and their system crashed. They have no backup of that query and want to see what was run on the server. Is it possible to find this query in a log or in a history somewhere?
user87094
  • 623
  • 1
  • 5
  • 4
24
votes
3 answers

MySQL InnoDB page_cleaner settings might not be optimal

Seeing this note in mysqld.log: [Note] InnoDB: page_cleaner: 1000ms intended loop took 15888ms. The settings might not be optimal. (flushed=200 and evicted=0, during the time.) There seems to be mention of something like this here: MySQL instance…
mcmacerson
  • 352
  • 1
  • 3
  • 9
23
votes
1 answer

log_min_duration_statement setting is ignored

I am running Postgresql 9.1 on Ubuntu. Exact Postgresql version is 9.1+129ubuntu1 as my package manager shows. I have 2 databases that are actively in use and they are used from a remote server. I wish to log queries that have a long execution time.…
22
votes
1 answer

What exactly are iblog files in mysql

I would like to understand these ibdata files as these play vital role in the crash recovery procedure. I could not find proper resources over the web for this.
Uday
  • 814
  • 3
  • 13
  • 27
18
votes
3 answers

Should a log table get an id field or primary key?

I have a log table that captures the datetime stamp of when certain files were exported to another system. The exportedLog table currently has three fields: id (primary key) messageId (int) exportedDateTime …
kacalapy
  • 2,062
  • 3
  • 27
  • 36
18
votes
3 answers

How to store 'n' days of web server logs in Sql Server?

For faster reporting and performance analysis, we want to insert our web server logs into Sql Server. This will allow us to see traffic patterns, issues, slowdowns in near real-time. We have a daemon that listens for request/response events from our…
Jarrod Dixon
  • 283
  • 3
  • 11
14
votes
3 answers

How do I output MySQL logs to syslog?

I want to use syslog for logging MySQL(5.1.41) on Ubuntu(10.04 LTS). I found information that output error log to syslog. [mysqld_safe] syslog But I want to use syslog for logging general logs and slow query logs. Please advise me how to write…
inohiro
  • 345
  • 2
  • 3
  • 9
13
votes
2 answers

How do I hide sensitive information like plaintext passwords from the logs?

I do not have access to a Postgres installation, so I cannot check. I am a security guy, and I'm seeing plaintext passwords in the logs: create user user1 with password 'PLAINTEXT PASSWORD' How can the DBAs change or create their passwords without…
schroeder
  • 232
  • 2
  • 9
13
votes
3 answers

How best to maintain SQL log file sizes

I'm somewhat of a new DBA and I'm managing a SQL Server 2012 instance that has a fair amount of activity. I'm running in Full Recovery mode because we need point in time recovery. Right now, I'm taking a full backup of the databases and logs every…
Elijah W. Gagne
  • 705
  • 2
  • 12
  • 22
12
votes
2 answers

MySQL binary logs - skip a table

Is there a way to skip a specific table in the binary logs? I've got binary logs configured as my incremental backup strategy between nightly backups. But we have one huge reference table that we're going to update nightly from a batch process (70GB…
David Parks
  • 551
  • 3
  • 6
  • 13
12
votes
1 answer

Performance impact of setting PostgreSQL to log all statements

PostgreSQL 9.2.2 on Windows 7 64-bit. The setting log_statement in the postgresql.conf file specifies what statements to log (none, DDL, data-modifying, or all). To what extent does setting log_statement = 'all' degrade performance? I've read that…
bwDraco
  • 223
  • 2
  • 8
11
votes
1 answer

mysql logging activity from specific user or ip

I have mysql server. The server is accessed by my application, and by external auditor (person using mysql workbench). The auditor has specific user and password and dedicated IP and it is granted only for select privileges. I need to log the…
darpet
  • 223
  • 1
  • 2
  • 5
10
votes
3 answers

Write to Error Log

Using SQL Server 2008 R2: How can I write to the SQL Server Error Log? I have a ROLLBACK statement that I'd like to couple with a statement written to the error log for external monitoring. Example: BEGIN TRAN INSERT INTO table1 SELECT * FROM…
Nick Vaccaro
  • 613
  • 3
  • 9
  • 16
1
2 3
16 17