56 Sharded Database Deployment
Sharded database deployment includes the prerequisites and instructions for installing the required software components, creating the catalog, roles, and the sharded database, configuring replication for high availability, and creating the schema for the sharded database.
The following topics contain the concepts and tasks you need to deploy a sharded database:
- Introduction to SDB Deployment
Oracle Sharding provides the capability to automatically deploy the sharded database (SDB), which includes both the shards and the replicas. - Oracle Sharding Prerequisites
Before you install any software, review these hardware, network, and operating system requirements for Oracle Sharding. - Installing Oracle Database Software
Install Oracle Database on each system that will host the shard catalog or database shards. - Installing the Shard Director Software
Install the global service manager software on each system that you want to host a shard director. - Creating the Shard Catalog Database
Create a non-CDB Oracle Database using DBCA to host the shard catalog. - Setting Up the Oracle Sharding Management and Routing Tier
The shard catalog, shard directors and shards must be configured to communicate with each other. - Creating a System-Managed SDB
- Deploying a Composite SDB
To deploy a composite SDB you must install the required Oracle Sharding software components, configure the objects for a composite SDB, and create the schema.
56.1 Introduction to SDB Deployment
Oracle Sharding provides the capability to automatically deploy the sharded database (SDB), which includes both the shards and the replicas.
The SDB administrator defines the topology (regions, shard hosts, replication technology) and invokes the DEPLOY command with a declarative specification using the GDSCTL command-line interface.
At a high level, the deployment steps are:
-
Set up the components.
Note:
In Oracle Database 12c Release 1 (12.2.0.1) all shards and shard catalog must be non-CDB databases.-
Create a non-CDB database that hosts the shard catalog.
-
Install Oracle Database software on the shard nodes.
-
Install shard director (GSM) software on the shard director nodes.
Note:
For production deployments, it is highly recommended that you configure Data Guard for the shard catalog database. -
-
Specify the topology layout using the following commands.
-
CREATE SHARDCATALOG
-
ADD GSM
-
START GSM
-
ADD CREDENTIAL
(if usingCREATE SHARD
) -
ADD SHARDGROUP
-
ADD INVITEDNODE
-
CREATE SHARD
(orADD SHARD
) for each shard
-
-
Run
DEPLOY
and add the global service to access any shard in the SDB.-
DEPLOY
-
ADD SERVICE
-
In Oracle Database 12c Release 1 (12.2.0.1) two replication schemes are supported. The SDB administrator can select either Data Guard or Active Data Guard while specifying the topology.
Deployment Methods: CREATE SHARD
Oracle Sharding supports two deployment methods. The first method is with the CREATE SHARD
command, where the creation of shards and the replication configuration are automatically done by the Oracle Sharding management tier.
The DEPLOY
command creates the shards. This is done using the DBMS_SCHEDULER
package (executed on the shard catalog), which communicates with the Scheduler agents on the remote shard hosts.
Agents then invoke DBCA and NETCA to create the shards and the local listeners. After the primary shards are created the corresponding standby shards are built using the RMAN DUPLICATE
command. Once the primary and standby shards are built, the DEPLOY
command configures the Data Guard Broker with Fast-Start Failover (FSFO) enabled. The FSFO observers are automatically started on the regional shard director.
Note:
Archivelog and flashback are enabled for all of the shards. This is required for the FSFO observer to perform standby auto-reinstantiation upon failover.Deployment Methods: ADD SHARD
The second deployment method is with the ADD SHARD
command. If your database creation standards require that you deploy the SDB using your own pre-created databases, the ADD SHARD
deployment method supports this requirement by simply adding your prebuilt database shards.
When the ADD SHARD
command is used for deployment, the DEPLOY
command handles the configuration of the Data Guard, Broker, and Fast-start Failover. It also handles the scenario where you have pre-configured Data Guard for the shard that is being added.
56.2 Oracle Sharding Prerequisites
Before you install any software, review these hardware, network, and operating system requirements for Oracle Sharding.
-
Hardware and operating system requirements for the shards are the same as that on which Oracle Database 12c Release 2 is supported. See your Oracle Database installation documentation for these requirements.
-
Hardware, software, and operating system requirements for the shard catalog and shard directors are the same as for the Global Data Services catalog and global service manager. See Oracle Database Global Data Services Concepts and Administration Guide for these requirements.
-
Network requirements are Low Latency GigE
56.3 Installing Oracle Database Software
Install Oracle Database on each system that will host the shard catalog or database shards.
Before installing Oracle Database, create an operating system user on all of the systems where you will be hosting the sharded database, shard catalog, and shard directors, and assign them to the DBA group. Allow the user to run su
, and make note of the credentials so that you can use them in later procedures.
See Oracle Database Installation Guide for Linux, or your platform’s installation guide, for information about configuring operating system users.
- Download the Oracle Database installer on all of the systems that will host the shard catalog or the database shards.
- Install Oracle Database on all of the systems where you intend to host the shard catalog and sharded database.
See Also:
Oracle Database Installation Guide for Linux for more information about using the response file for silent installation of Oracle Database
56.4 Installing the Shard Director Software
Install the global service manager software on each system that you want to host a shard director.
56.5 Creating the Shard Catalog Database
Create a non-CDB Oracle Database using DBCA to host the shard catalog.
56.6 Setting Up the Oracle Sharding Management and Routing Tier
The shard catalog, shard directors and shards must be configured to communicate with each other.
56.7 Creating a System-Managed SDB
The following topics describe the tasks for creating a system-managed SDB.
- Deploying a System-Managed SDB
To deploy a system-managed SDB you create shardgroups and shards, create and configure the databases to be used as shards, execute theDEPLOY
command, and create role-based global services. - Creating a Schema for a System-Managed SDB
Create the schema user, tablespace set, sharded tables, and duplicated tables for the SDB. Verify that the DDLs are propagated to all of the shards, and, while connected to the shards, verify the automatic Data Guard Broker configuration with Fast-Start Failover. - System-Managed SDB Demo Application
The system-managed sharded database (SDB) demo application simulates the workload of an online retail store. Use it to validate the setup of any system-managed (automatic sharding) SDB configuration. The demo application also provides a practical example of sharding concepts for administrators and developers new to database sharding.
56.7.1 Deploying a System-Managed SDB
To deploy a system-managed SDB you create shardgroups and shards, create and configure the databases to be used as shards, execute the DEPLOY
command, and create role-based global services.
System-managed sharding does not require the user to map data to shards. Data is automatically distributed across shards using partitioning by consistent hash. The partitioning algorithm evenly and randomly distributes data across shards. For more conceptual information about the system-managed SDB, see System-Managed Sharding.
See Also:
Creating a Schema for a System-Managed SDB
Oracle Database Global Data Services Concepts and Administration Guide for more information about GDSCTL command usage
56.7.2 Creating a Schema for a System-Managed SDB
Create the schema user, tablespace set, sharded tables, and duplicated tables for the SDB. Verify that the DDLs are propagated to all of the shards, and, while connected to the shards, verify the automatic Data Guard Broker configuration with Fast-Start Failover.
See Also:
Oracle Database Global Data Services Concepts and Administration Guide for information about GDSCTL command usage
56.7.3 System-Managed SDB Demo Application
The system-managed sharded database (SDB) demo application simulates the workload of an online retail store. Use it to validate the setup of any system-managed (automatic sharding) SDB configuration. The demo application also provides a practical example of sharding concepts for administrators and developers new to database sharding.
The demo application assumes that a system-managed SDB environment was already created along with the CUSTOMER table-family. The environment may have any number of chunks and shards (database nodes). When run, the application will first populate the Products table and then start a one-hour workload that can be paused at any time by the administrator. The workload includes four types of transactions: create a customer order, lookup the list of orders, create a new product, and multi-shard query with report generation. All aspects of a sharded database configuration are exercised.
You can download the demo application, along with a README file that describes how to run and monitor it, from My Oracle Support Document 2184500.1.
56.8 Deploying a Composite SDB
To deploy a composite SDB you must install the required Oracle Sharding software components, configure the objects for a composite SDB, and create the schema.
The composite sharding method allows you to create multiple shardspaces for different subsets of data in a table partitioned by consistent hash. A shardspace is set of shards that store data that corresponds to a range or list of key values.
The following topics describe the tasks for deploying a composite SDB.
- Deploying a Composite SDB
To deploy a composite SDB you create shardgroups and shards, execute theDEPLOY
command, and create role-based global services. - Creating a Schema for a Composite SDB
Create the schema user, tablespace set, sharded tables, and duplicated tables for the SDB. Verify that the DDLs are propagated to all of the shards, and, while connected to the shards, verify the automatic Data Guard Broker configuration with Fast-Start Failover.
56.8.1 Deploying a Composite SDB
To deploy a composite SDB you create shardgroups and shards, execute the DEPLOY
command, and create role-based global services.
56.8.2 Creating a Schema for a Composite SDB
Create the schema user, tablespace set, sharded tables, and duplicated tables for the SDB. Verify that the DDLs are propagated to all of the shards, and, while connected to the shards, verify the automatic Data Guard Broker configuration with Fast-Start Failover.