shijiang1130 发表于 2015-02-15 15:04

【mnesia】动态转换表类型

本帖最后由 shijiang1130 于 2015-09-03 15:44 编辑

40> mnesia:dump_tables().
{aborted,{"Only allowed on ram_copies",mytest,""}}

shijiang1130 发表于 2015-02-15 15:05

42> mnesia:change_table_copy_type(mytest,node(),ram_copies).
{atomic,ok}

shijiang1130 发表于 2015-02-15 15:05

43> mnesia:dump_tables().                           
{atomic,ok}

shijiang1130 发表于 2015-02-15 15:06

Tables of type ram_copies are by definition stored in memory only. It is possible, however, to dump these tables to disc, either at regular intervals, or before the system is shutdown. The function mnesia:dump_tables(TabList) dumps all replicas of a set of RAM tables to disc. The tables can be accessed while being dumped to disc. To dump the tables to disc all replicas must have the storage type ram_copies.

The table content is placed in a .DCD file on the disc. When the Mnesia system is started, the RAM table will initially be loaded with data from its .DCD file.

shijiang1130 发表于 2015-02-15 15:13

mnesia:change_table_copy_type(mytest,node(),disc_only_copies).
页: [1]
查看完整版本: 【mnesia】动态转换表类型