Learn about how Replication Server works with in-memory databases.
The primary database must be a traditional, full-durability, disk-resident database. For convenience, this document refers to relaxed-durability databases with durability set to no_recovery as "relaxed-durability databases."
The dump source database can be another in-memory database, relaxed-durability database, or a traditional disk-resident database.
In-memory and relaxed-durability databases lose their object definition, data, and RepAgent configuration once the host data server shuts down or restarts. You must reinitialize the database from the template or database dump from a source database.
You can use the same disk-resident database as a template for multiple in-memory or relaxed-durability databases.
create database tokyo_db on publicdev=10 log on publicdevlog=10 go
On Replication Server, use rs_init to configure the replicate databases.
suspend connection to TOKYO_DS.ttokyo_db
use master go sp_dboption tokyo_db, single, true go sp_renamedb tokyo_db, template1 go sp_dboption template1, single, false go
create inmemory database tokyo_db use template1 as template on imdb_cache_dev = '50' log on imdb_cache_dev_log='50' with DURABILITY=NO_RECOVERY go
resume connection to TOKYO_DS.tokyo_db
After a shutdown or termination and subsequent restart of Adaptive Server, Adaptive Server automatically re-creates the in-memory or relaxed-durability database from the template, wherever this was specified. When Replication Server resumes the connection to the replicate in-memory or relaxed-durability database that you created, Replication Server may reapply commands, as the information used by Replication Server to detect the last command applied is lost when you restart Adaptive Server.
If you use a dump from another database to initialize the in-memory or relaxed-durability database as a replicate database, the replicate database inherits the configuration of the database from which you obtained the dump.
create inmemory database tokyo_db on imdb_cache_dev2 = '50' log on imdb_cache_dev_log2='50' with DURABILITY=NO_RECOVERY go
Create the objects such as tables and stored procedures, users, and permissions needed to receive replicated data; alternatively, you can load a database dump.
Use rs_init to create the Replication Server connection to the database.
suspend connection to RDS.imdb1 go
dump database imdb1 to '/databases/dump/tokyo_db.dump' go
resume connection to RDS.imdb1 go
Repopulate the re-created replicate in-memory or relaxed-durability database with a new dump from the dump source database or from any archived dumps taken on the replicate database.
use master go sp_dboption tokyo_db, single, true go load database tokyo_db from '/databases/dump/tokyo_db.dump' go online database tokyo_db go sp_dboption tokyo_db, single, false go
Enable autocorrection for the replication definitions used for subscriptions to the replicate in-memory or relaxed-durability database, to convert any update or insert into a delete and insert pair. You must set autocorrection before resuming a connection; this applies whether you used templates, or dump and load to create the replicate database. Enabling autocorrection allows Replication Server to continue replicating messages in Replication Server queues even if the Adaptive Server hosting a replicate in-memory or relaxed-durability database shuts down or terminates.
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 (DML) commands—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.
Replication Server does not support a replication environment with in-memory databases, or where database durability set to no_recovery is acting as the primary 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 the database level, or the 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.
Cannot set replication for database database_name as it is minimally logged. Use ALTER DATABASE to set full DML logging and try again.
Warning: database_name is using minimal logging. Replicated objects will continue to use full DML logging.
Cannot alter database database_name to set minimal logging because this database is marked for replication. Remove replication and try again.
Warning: Database database_name has objects marked for replication. Replicated objects will continue to use full logging.
Cannot set replication for table table_name because it is using minimal logging. Use ALTER TABLE to set full logging and try again.
Warning: Database database_name has tables that use minimal DML logging. These tables will not be replicated.
Cannot alter the table table_name to set minimal DML logging because this table is marked for replication. Remove replication and try again.