Loading
20, Mar 2022
Reviewing Sections Related to Sharding – Introduction to Oracle Sharding

Reviewing Sections Related to Sharding

When sharding targets are added to EM, the following sections will contain links to specific objects. To view sharding architecture–related sections, from the EM console, click Targets and then All Targets.

You’ll see Shard Director, Sharded Database, Shardgroup, and Shardspace sections (Figure 3-8).

Figure 3-8.  All targets

Click the Sharded Database link, and choose Target Name (Figure 3-9).

Figure 3-9.  Sharded database

On the Sharded Database tab, you will see several management tools, such as Add Primary Shards, Add Standby Shards, Deploy Shards, etc. (Figure 3-10).

Figure 3-10.  Sharded database control

Managing Chunks

You are able to manage chunks and more in an Oracle Sharding deployment with Oracle Enterprise Manager Cloud.

To perform a chunk movement operation, select Targets ➤ All Targets. Enter shardspace in Search Target Name field (Figure 3-11).

Figure 3-11.  Selecting a shardspace

Click a value under Target Name. On the Shardspace tab, select Manage Shardgroups (Figure 3-12).

Figure 3-12.  Managing the shardgroups

Connect to the catalog database and create a new user with the necessary privileges.

[oracle@gsmcat ~]$ sqlplus / as sysdba

SQL> alter session enable shard ddl;

SQL> create user shardsys identified by shardsys;

SQL> grant connect, create session, gsmadmin_role to shardsys; SQL> grant all privileges to shardsys;

SQL> grant select any dictionary to shardsys;

Return to the EM console, add the new credentials, and fill in the following fields:

•\   Username: shardsys

•\   Password: shardsys

•\   Confirm Password: shardsys

•\    Role: NORMAL

Test the connection.

In the section shown in Figure 3-13, browse to Shard Director and click OK.

Figure 3-13.  Selecting a shard director

Click Login. Then select the shardgroup in the list, and click Move Chunk (Figure 3-14).

Figure 3-14.  Moving a chunk

Choose the source and destination shards and fill in the necessary values; click OK when you’re done.

•\   Source Shard: sh1

•\   Destination Shard: sh2

•\   Select ID From Table: 1

•\   Start: Immediately

Click the link in the Information box at the top of the page to view the provisioning status of the chunk movement (Figure 3-15).

Figure 3-15.  Information box

If we click gsmcat.mycompany.mydomain and select “Execute GDSCTL script,” we will see that EM has run the command shown in Figure 3-16 in the background.

Figure 3-16.  GDSCTL command log

If you connect to the catalog database and see the chunk distribution, you will find out that chunk 1 moved to the sh2 shard, which was also synchronized with its standby database sh4.

GDSCTL> config chunks

Chunks

————————

Catalog connection is established

Leave a Reply

Your email address will not be published. Required fields are marked *