Enable MySQL server query logging

  1. View current state of variables:
    SHOW VARIABLES LIKE "general_log%";
  2. Set log location:
    SET GLOBAL general_log_file = 'C:/Temp/QueryLog.log';
  3. Enable logging:
    SET GLOBAL general_log = 'ON';
  4. Disable logging again (for improved database performance and disk usage):
    SET GLOBAL general_log = 'OFF';
Advertisements

ORM

  • ORM stands for Object-Relational Mapping
  • It is a methodology for relating and translating OOP objects to and from relational database schemas
  • The fundamental issue is the incompatibility of the structures used to store data
  • OOP languages make comprehensive use of objects with complex and numerous relationships between objects of heterogeneous types
  • RDBMS do not make a distinction between the contents of the columns, only the basic relationships (primary key, foreign key) on and between columns
  • Hibernate (Java) and NHibernate (.NET) are two established frameworks that aim to provide auto generated interfaces into databases 
  • EF (Entity Framework) is the newer Microsoft ORM solution which aims to provide a simpler, developer friendly interface for use within data-oriented applications
  • Objects can also be stored directly to the filesystem for easy storage and retrieval without any translation at the cost of performance