The tag has no usage guidance.

learn more… | top users | synonyms

9
votes
3answers
19k views

How to Log All mysql queries into log file?

I am using Mysql 5.6.12 under Wamp server environment. Now I want to log All queries into ".log" file, the queries which are running by PHP or from PHPMyAdmin, I want to log them...
9
votes
1answer
1k views

“truncate log on checkpoint” option in SQL Server

Long story but our long term consultants (former employees) wrote a custom script years back (2006 or so) to interface with Tivoli Storage Manager and it appears to be checking for a SQL Server DB ...
7
votes
1answer
181 views

Is it possible to exclude specific users in log activity of PostgreSQL?

I need to monitor the activity of users in our databases. I have set the following parameters in postgresql.conf: log_min_duration_statement = 0 log_connections = on log_disconnections = on ...
7
votes
1answer
4k views

SQL Server distribution database log file grows uncontrollably after full database backup

We have a merge replication environment that is pushing to 8 subscribers. This is working fine. Our distribution database is setup in Simple recovery mode. We have a maintenance plan that will backup ...
5
votes
2answers
5k views

MySQL “Statement may not be safe to log in statement format” warning

What is the meaning of the following MySQL warning: Statement may not be safe to log in statement format. I have some tens of thousands of these statements every day in my mysqld.err file, and I'm ...
5
votes
1answer
181 views

PostgreSQL doesn't log

I'm using ArchLinux and PostgreSQL 9.4.4 and have enabled the logging in the config file: $ sudo egrep -v "^[[:blank:]]*($|#|//|/\*| \*|\*/)" /var/lib/postgres/data/postgresql.conf max_connections = ...
4
votes
1answer
1k views

Truncate log file mirrored database

In SQL Server 2008, I have a mirrored database with a log file that has increased to 80GB, which is not normal and I have serious problem. I would like to decrease the log file size by truncating it. ...
4
votes
2answers
690 views

How to log custom messages from inside a PostgreSQL transaction?

I have a software that generates transactions and executes them. I would like to asynchronously inspect about the transaction progress in term of the simple proportion of queries executed over total ...
4
votes
1answer
2k views

What is default MySQL binlog retention in AWS RDS?

I tried to retrieve my MySQL RDS binlogs in order to run manual "rollback" for some SQLs. Unfortunately, I noticed that only 2 binlogs for the last 30 minutes are available. "call ...
3
votes
2answers
16k views

How to Fix log_reuse_wait_desc=LOG_BACKUP? LOG Backup not possible

I checked sys.databases to find out which databases need LOG backups. It surprised me that I had quite a few where log_reuse_wait_desc=LOG_BACKUP meaning, the JOB I have set up to run LOG backups on ...
3
votes
1answer
2k views

Normalized Table Structure for Logging

How can I normalize a table that has four columns for logging the latest activity for a single row: Created On Created By Modified On Modified By We have dozens of tables, all with these 4 ...
3
votes
1answer
6k views

Logging to a file in PostgreSQL windows service

I need an alternative for running the following command: C:\xxx\pgsql\bin\pg_ctl" -D "C:\xxx\pgsql\data" -l "C:\yyy\log\pgsql.log" start. This way the server starts and logs to C:\yyy\log\pgsql.log. ...
3
votes
1answer
142 views

How to log all SQL queries for a single connection or user or client host?

Is there a way to log all SQL queries in Postgres 9.3.9 for a single connection or user or client host? In other words, I want log_statement = all but only for a certain username or client hostname ...
3
votes
1answer
2k views

SET extra_float_digits = 3

I'm using PostgreSQL 9.2 with my web application that has three servlets with three selects. I turn on the log. When I send my first query: select * from "Nomi" limit 4 before it the log shows me ...
3
votes
2answers
4k views

How to enable queries logs in MariaDB

I'm running mysql Ver 15.1 Distrib 5.5.46-MariaDB in CentOS 6.7 server. I'm trying to get queries logged and I'm doing by redirecting log to files as shown below: #/etc/my.cnf.d/server.cnf # this is ...
3
votes
1answer
3k views

What is log sequence number ? How it is used in MySQL?

Can anybody give an example or scenario of log sequence number(LSN) used in MySQL
3
votes
0answers
268 views

Limiting PostgreSQL logging

I have a table that can contain reasonably large BYTEA values (the same could apply to large TEXT values). It looks like this: CREATE TABLE testtable ( id SERIAL PRIMARY KEY, name TEXT UNIQUE ...
2
votes
3answers
2k views

How to log DML statements executed by a pl/pgsql function?

I have a pl/pgsql function (see below) that lists some fields and clears their contents using dynamically constructed UPDATE commands. When I set log_statement = 'mod', I can see nothing on the log ...
2
votes
1answer
2k views

How to Log IP Address for Inbound Connections in MySQL

Is there a way in MySQL 5.5 (on Redhat 6.x) to log the IP address from where a particular query has been run? And have that appear in the general log or even relay and bin logs? I am trying to track ...
2
votes
1answer
91 views

Investigating specific SELECT queries

For a particular row in a table how can I determine the number of reads done to it such as SELECT * FROM MyTable WHERE ID = <something> and when and where the read query executed? I'm ...
2
votes
1answer
449 views

MySQL with slow queries

I have a website running on Wordpress Multisite + Woocommerce with over 5700 users on a Nginx + Apache server. I recently experienced some down time but didn’t get any errors, just a blank page. I ...
2
votes
1answer
162 views

Audit tables in different databases

I am studying ways to implement audit tables to my PostgreSQL database and would like to know if it is possible to make a trigger for the data to be written to a table in a database other than the ...
2
votes
1answer
380 views

SQL Server Log Shipping Randomly Stops Copying and Restoring

I'm fairly new to Log Shipping but have configured a few with no issues, however I have a server sitting on SQL 2008 R2 with 6 databases on there, all 6 of these are supposed to be log shipping. The ...
2
votes
0answers
357 views

SSMS causing Event ID 4674: SeTakeOwnershipPrivilege

Somewhat of a strange one. Recently my user id's been showing up in a number of Audit Success records in the Security event log of one of our production database servers with the below content (or ...
1
vote
1answer
84 views

How I compact WAL files?

I like compact WAL files. Actually I do: archive_command = 'cp "%p"C:\\%f"' What is the best way to do it?
1
vote
1answer
5k views

The InnoDB log sequence number is in the future

Our site was getting intermittent database errors and I asked my webhost to check what's happening. After some inspection they found that the database has few issues and tried repairing it. Finally I ...
1
vote
1answer
3k views

MySQL General log not working on Mac OS X [duplicate]

I want to log all queries to the database running on my MacBook Pro (Mac OS X 10.8.1). I created a file /etc/my.cnf with the following content: [mysqld] general_log=1 ...
1
vote
1answer
37 views

Report rollbacks to log file

There are several reasons for SQL transactions to rollback. I want to log all of them to the SQL Server Log File so that I can find information about them at a later time in the SQL Server Log File ...
1
vote
1answer
121 views

PostgreSQL bug(?) - logging with a minimum log level

I am using the log_min_error_statement - Setting in the PostgreSQL configuration file, but the logger does not react on the setting, either if I turn it on, or off, or set it to another level, the ...
1
vote
1answer
66 views

Why is logging “slow”?

On an empty transient table, inserting a single row took 50ms before changing it to UNLOGGED, 1ms afterwards. Why is this exactly? If the table structure is necessary, I'll post it, but it's only ...
1
vote
1answer
1k views

DB2 - Archive Mode - on what values to set LOGPRIMARY,LOGSECOND,LOGFILSIZ?

we must set our database from CIRCULAR to ARCHIVE mode in order to enable ONLINE backups. Backups will be done every 1 day. Database is now almost 30GB. Database grows approximately 1GB per month. ...
1
vote
1answer
82 views

Is it possible to convert .trn (transaction log) file to human readable form

I have used below SQL statement to get the transaction information done on 2015-10-26, but the information not in human readable form. ** SELECT * FROM fn_dump_dblog ...
1
vote
1answer
25 views

Configure MariaDB to log row deletion ONLY

I'm investigating some rows/tables that intermittently go missing on a Magento site, and of course there's no entries in the error log. (I suspect Magento queries/rules or human error might be the ...
1
vote
1answer
73 views

Why is my transaction file growing when db is in simple mode and there are no waiting transactions

I noticed that my database log file has reached 160GBs. My database is in simple recovery mode and I used the following query to see if there are any waiting transactions. SELECT ...
1
vote
1answer
207 views

Using file .log.3.gz

I have a file which I need to look at for errors, I got it from someone its extension is mysql.log.3.gz and when I uncompressed it, it has mysql.log.3, It is a log file? And if I open it in text ...
1
vote
1answer
1k views

Data lost in MySQL InnoDB after crash

I found a 6-days rollback in a MySQL 5.6 community edition server installation. It seems that some logs were lost, and I cannot understand why. 2013-12-22 20:38:54 380 [Note] Plugin 'FEDERATED' is ...
1
vote
1answer
4k views

Analyse MySQL General Query Log in Real-time?

We want to use mysql general query log to do real-time monitoring and auditing. Currently our approach is: set general_log=on; sleep 15m; set general_log=off; scp & rm xxx.log; set ...
1
vote
0answers
27 views

How can I “buffered” mine Oracle logs using LogMiner with 'committed data only' option properly?

Using Oracle LogMiner with committed data only flag, According to the Oracle documentation, all the committed records with the same commit scn, will be joined together and will appear in a sequence. ...
1
vote
0answers
30 views

How to view phppgadmin as the application name in PostgreSQL's log files?

I am using PostgreSQL 9.2.2 (Windows) with phpPgAdmin 5.1. I need to monitor who connects to the server, and with which application. In the logging parameters of postgresql.conf, I use the following ...
1
vote
0answers
38 views

Trying to restore a db2 database but stops at roll-forward with error 'SQL1265N'

I'm trying to restore a backup that is older than the current database. The restore went ok, but the roll forward didn't giving the following error: SQL1265N The archive log file ".LOG" is not ...
1
vote
0answers
23 views

Logging within a procedure's transaction

I have an ETL process running inside a PostgreSQL 9.3 procedure on AWS RDS. The procedure normally takes about ten minutes to run, but I'm having a rare issue where it takes several hours and never ...
1
vote
0answers
174 views

best way to log large amounts of data

I'm building a new logging system for our company. I'm wondering about the best way to store about 50-100GB data each year. I'm looking at both MySQL and MongoDB. I'm considering MongoDB because it ...
1
vote
0answers
137 views

Which major database platforms support TTL?

I need to store some data in a database that will be hosted on Amazon Web Services, and I have complete freedom over choosing which database platform to install, based on what I think will best suit ...
1
vote
0answers
97 views

Postgres: Can't free space because I have no space

I have a Postgres DB that someone was brilliant enough to install in the log partition of my linux box. It has a serious index problem, with indexes ballooning up to 50GB per. As soon as I start ...
1
vote
0answers
215 views

Sql server 2012 log file growth of cdc enbled db

All, I have cdc enabled on a Sql Server 2012 database that is a primary db in transactional replication and the primary in a availability group. The log file is a little over 95 GB, a historic high. I ...
1
vote
1answer
41 views

different log file for master and beta mysql

Hi i am facing a problem while shipping my database log I have three database server dev, beta and master and i maintain log files for dev on github and every log file has a version given to it like ...
1
vote
0answers
219 views

mysql.sock missing

I started my MYSQL database this morning but failed. And I tried all means I can think of: chown -R mysql.mysql /var/lib/mysql chmod g+w /var/run/mysqld chgrp mysql /var/run/mysqld chmod -R 755 ...
1
vote
0answers
1k views

MySQL: Writing log entries from stored procedure

Is there a standard way to write log messages in MySQL stored procedures? I can write log messages to a designated log table, but I prefer the standard log mechanism where each message is coupled ...
0
votes
4answers
494 views

How to Identify the user who issued MySQL Shutdown command

We have had several situations when our production MySQL server suddenly became unavailable. The error log just shows "Normal shutdown" followed by the typical shutdown messages. How can I determine ...
0
votes
2answers
48 views

How to get when MySQL instance went down last

Is it possible to determine when a MySQL instance went down last? Is there a log file or literally anything at all that logs the server status in MySQL? I have trolled through countless articles ...