Sharding Advisor Usage and Options

Sharding Advisor is a client command-line tool that connects to an existing non-distributed database and provides distributed database configuration recommendations.

Syntax

gwsadv
 [-n nodeName[:portnum]]
 [-s serviceName]
  -u username
  -p password
 [-c]
 [-awr_snap_begin timestamp] 
 [-awr_snap_end timestamp]
  –w
 [sch=(schema1, schema2, …)]
 [-tab importantTabsFile]
 [-pr numpreds:n]
 [-t trace_file]

Options

Note that each option must be prefixed with a minus sign (-) except for the sch argument.

Option Description Required (Y/N)
-awr_snap_begin timestamp

Specify the beginning timestamp, in the format 'YYYY-MM-DD HH24:MI:SS', to specify the AWR snapshots to capture the workload from.

N
-awr_snap_end timestamp

Specify the end timestamp, in the format 'YYYY-MM-DD HH24:MI:SS', to specify the AWR snapshots to capture the workload from.

N
-c

Capture a new or changed workload.

Use -pr to limitthe number of predicates to be captured

Required on first run of Sharding Advisor on a new or changed workload.

Not required on subsequent runs on the same workload.

By default, the workload is captured from the V$SQL_PLAN_STATISTICS_ALL table.

Alternatively, the workload can be captured from Automatic Workload Repository (AWR) snapshots by using the -awr_snap_begin and -awr_snap_end options with the -c option to specify the beginning and ending time stamps of the AWR snapshots.

N
-n nodeName[:portnum]

Node name and port number, if connecting to a database on another host

N
-p password

Oracle password

Y
-pr numpreds:n

Limits the number of predicates to be captured when using -c to capture a new or changed workload.

N
-s serviceName

Service name, if connecting to a database on another host

N
sch

The sch option specifies the list of schemas to run Sharding Advisor against, if you want to run as a different user.

N
-t trace_file

Enables tracing of all activities performed by sharding advisor. Specify an output file name.

N
-tab importantTabsFile

Name of file that consists of table names, one per line, in the format schemaname.tablename, to restrict the number of tables that the Sharding Advisor needs to analyze.

N
-u username

Oracle user name

Y
-w

Directs Sharding Advisor to use the query workload for sharding configuration generation and ranking.

Y

Usage Notes

The normal usage of the sharding advisor is to not specify the –pr option. The query workload capture should be faster now even without the –pr option. If however, the you want to speed it up further, the –pr option can be used. If it is used, it has to be used in conjunction with the –c option. If unspecified, the number of predicates to be captured is not limited.

For procedures describing how to run the Sharding Advisor with example commands see Run Sharding Advisor and Run Sharding Advisor on a Non-Production System.