set storage media
Set the storage media type
Syntax
set_storage_media: SET storage media [TO | =] {ONDISK | INMEMORY_VOLATILE | INMEMORY_KEEP | INMEMORY_PERSIST}
Description
The SET storage media statement is used to set the storage media type in which the database will be created or opened.
The ONDISK type allows this connection to create or open a database on disk.
The INMEMORY_VOLATILE type allows this connection to create or open an in-memory database that will remain accessible in memory until the last connection closes the database.
The INMEMORY_KEEP type allows this connection to create or open an in-memory database that will remain accessible in memory until the server the database resides on shuts down or until the database is explicitly dropped.
The INMEMORY_LOAD type allows this connection to open an on-disk database and load the content onto memory. The database will remain accessible in memory until the last connection closes the database. Updates to the database will not be saved on disk. A database created with the INMEMORY_LOAD type behaves the same way as a database created with the INMEMORY_VOLATILE type.
The INMEMORY_PERSIST type allows this connection to create or open an in-memory database whose updates will be saved on disk. A database created with the INMEMORY_PERSIST type will remain in memory until the last connection closes the database, at which time the content will be saved on disk (i.e. "persisted").
If the connection does not have any storage media type set, a new database will be created as an ONDISK database and an existing database will be opened in the following way:
- If a database is already opened by another connection, the storage media type associated with the database will be used. If the storage media type is INMEMORY_LOAD, this connection will load the content of the database in memory instead of the original content on disk.
- If an on-disk database is not opened by any other connection, the ONDISK type will be used.
- If an in-memory database is not opened by any other connection, the INMEMORY_KEEP type will be used.
Example
set storage media to inmemory_load; open database nsfawards;
See Also