Diskbased Mnesia Nodes

Ulf Wiger ulf.wiger@REDACTED
Tue Jun 15 09:51:09 CEST 1999


Elan wrote:
> 
> Hi,
> 
> what is the shortest instruction for implementing a diskbased mnesia table?
> 
> TIA,
> 
> Elan


mnesia:create_table(TableName, [{disc_copies, [node()]},
				{attributes, [...]}]).

will create a table which resides on disk and in RAM on the current
node.


mnesia:create_table(TableName, [{disc_only_copies, [node()]},
				{attributes, [...]}]).

will create a table which resides on disk only.


Typically, attributes are given with the following construct:

{attributes, record_info(fields, RecName)}


If you want the entire sequence of commands:

erl -sname foo
foo@REDACTED 1> mnesia:create_schema([node()]).
foo@REDACTED 2> mnesia:start().
foo@REDACTED 3> mnesia:create_table(...).

This will:
1. start an Erlang node with the "shortname" foo@<hostname>
2. create a mnesia schema under <CWD>/Mnesia.foo@<hostname>/
3. start mnesia
4. create a table as above

/Uffe
-- 
Ulf Wiger, Chief Designer AXD 301      <ulf.wiger@REDACTED>
Ericsson Telecom AB                          tfn: +46  8 719 81 95
Varuvägen 9, Älvsjö                          mob: +46 70 519 81 95
S-126 25 Stockholm, Sweden                   fax: +46  8 719 43 44



More information about the erlang-questions mailing list