Minimal DML Logging and replication

To optimize the log records that are flushed to the transaction log on disk, Adaptive Server can perform minimal to no logging when executing some data manipulation language commands (DMLs)—insert, update, delete, and slow bcp—on all types of low-durability databases, such as in-memory databases and relaxed-durability databases set with durability of at_shutdown or no_recovery. You can perform minimal logging for DMLs on a per-database, per-table, and session-specific basis. See Chapter 3, “Minimally-logged DML” in the Adaptive Server Enterprise In-Memory Database Users Guide.

NoteMinimal DML logging session-level settings take precedence over database-level settings and table-level settings.


Replication Server support

Replication Server supports minimal DML logging in an in-memory or relaxed durability database acting as the replicate database.

As replication uses full logging, replication and the minimal data manipulation language (DML) logging feature in Adaptive Server 15.5 are incompatible at the same level, such as database-level or table-level. However, you can take advantage of the performance enhancements from minimal logging on some tables while allowing replication on others as minimal DML logging and replication can coexist at different levels.

For example, if you set replication and minimal DML logging at the same level, such as table-level, setting replication status fails and an error message appears as described in these scenarios:

  1. If you create a database to use minimal DML logging:

    • And if you mark the database for replication using sp_reptostandby, the attempt fails with this message appearing:

      Cannot set replication for database database_name
      as it is minimally logged. Use ALTER DATABASE to 
      set full DML logging and try again.
      
    • You can mark tables and stored procedures for replication to replicate a subset of tables. When you mark a table in a database using minimally DML logging, this warning appears:

      Warning: database_name is using minimal logging.
      Replicated objects will continue to use full DML
      logging.
      
  2. If a database is using full logging and you mark it for replication using sp_reptostandby, and you alter the database to set minimal DML logging, the attempt fails and this message appears:

    Cannot alter database database_name to set minimal 
    logging because this database is marked for 
    replication. Remove replication and try again.
    
  3. If a database is using full logging and has objects marked for replication, you can set minimal DML logging at the database-level but a message appears, warning you that objects marked for replication still use full logging:

    Warning: Database database_name has objects marked 
    for replication. Replicated objects will continue to 
    use full logging.
    
  4. A database using full DML logging can contain tables defined to use minimal logging. If you mark the database for replication, this warning appears:

    Warning: Database database_name has tables that use 
    minimal DML logging. These tables will not be 
    replicated.
    
  5. If you create a table using full logging and you mark the table for replication, and then you set minimal DML logging for the table, the attempt fails with this message displaying:

    Cannot alter the table table_name to set minimal DML
    logging because this table is marked for
    replication. Remove replication and try again.
    
  6. If you create a table using minimal DML logging, and if you mark the table for replication, the attempt fails with this message displaying:

    Cannot set replication for table table_name because 
    it is using minimal logging. Use ALTER TABLE to set 
    full logging and try again.