1.1.1

Table Of Contents
Procedure
1. In a separate terminal window or GUI editor, examine the contents of the
create_persistent_schema.sql script. Notice that this script uses the PERSISTENT keyword in
each CREATE TABLE statement. For example:
CREATE TABLE COUNTRIES
(
COUNTRY VARCHAR(26) NOT NULL CONSTRAINT COUNTRIES_UNQ_NM Unique,
COUNTRY_ISO_CODE CHAR(2) NOT NULL CONSTRAINT COUNTRIES_PK PRIMARY
KEY,
REGION VARCHAR(26),
CONSTRAINT COUNTRIES_UC
CHECK (country_ISO_code = upper(country_ISO_code) )
) REPLICATE PERSISTENT;
2.
In the sqlf session, execute the create_persistent_schema.sql script, then load table data:
run 'create_persistent_schema.sql';
run 'loadTables.sql';
3.
Exit the sqlf session:
exit;
4. Now list the contents of each SQLFire server directory:
ls -l ../server1 ../server2
Notice that each SQLFire directory now contains several disk store les to manage the table data on disk.
For example:
BACKUPSQLF-DEFAULT-DISKSTORE.if
BACKUPSQLF-DEFAULT-DISKSTORE_1.crf
BACKUPSQLF-DEFAULT-DISKSTORE_1.drf
5. Because the data is persisted to disk, SQLFire will recover data from disk even if you shut down the data
stores. Use the shut-down-all command to shut down all data stores in the cluster, and then restart the
servers:
cd ~/vFabric_SQLFire_11_bNNNNN
sqlf shut-down-all -locators=ip_address[10101]
Connecting to distributed system: locators=ip_address[10101]
Successfully shut down 2 members
sqlf server start -dir=server1 -locators=ip_address[10101]
-client-bind-address=ip_address -client-port=1528 -sync=false
sqlf server start -dir=server2 -locators=ip_address[10101]
-client-bind-address=ip_address -client-port=1529 -sync=false
Note: The -sync=false option starts a server to a "waiting" state if that server depends on another
server or locator for disk store synchronization. This option is helpful for starting multiple SQLFire
members on the same machine, or when starting servers using a shell script or batch le, as the start
command returns immediately after the member reaches the waiting state. The server automatically
continues booting after any dependent servers or locators start. (Locators automatically boot using the
-sync=false option, but servers do not.)
When you restart the servers, you may notice messages similar to:
[info 2012/07/24 10:18:11.949 PDT <main> tid=0x1] Region
/_DDL_STMTS_META_REGION initialized with data from
vFabric SQLFire User's Guide44
Getting Started with vFabric SQLFire