Managing Regions

Learn to use the SQL statements to register regions with your local Oracle NoSQL Database and view them.

In a Multi-Region Oracle NoSQL Database setup, you must register all regions, local and remote regions with your local Oracle NoSQL Database. You use the CREATE REGION statement to register a region.

Use the following command to set your local region:

SET LOCAL REGION my_local_region;

The following CREATE REGION statements register remote regions named LON and FRA.

CREATE REGION LON;

CREATE REGION FRA;

You can use the SHOW REGIONS statement to view the list of regions present in Oracle NoSQL Database. The following statement fetches all the existing regions in a JSON format. The output shows the local and remote regions. The state field indicates if a region is active.

SHOW AS JSON REGIONS;

Output:

{"regions" : [{"name" : "my_local_region", "type" : "local", "state" : "active"},{"name" : "LON", "type" : "remote", "state" : "active"},{"name" : "FRA", "type" : "remote", "state" : "active"}]}

You can use the DROP REGION statement to remove the registration of a specified remote region from your local Oracle NoSQL Database. The following statement removes the FRA region. The output shows the state as dropped.

DROP REGION FRA;

Output:

{"regions" : [{"name" : "my_local_region", "type" : "local", "state" : "active"},{"name" : "LON", "type" : "remote", "state" : "active"},{"name" : "FRA", "type" : "remote", "state" : "dropped"}]}