NetBackup™ Commands Reference Guide
- Introduction
- Appendix A. NetBackup Commands
Name
nbsqlcmd — Configuration utility for Microsoft SQL Server assets
SYNOPSIS
list instances -format json [-S primary_server] [-limit limit] [-filter filter] [-sort sort]
list instances [-format csv] [-S primary_server] [-limit limit] [-name instance_name] [-hostname hostname] [-active | -inactive] [-registered | -unregistered]
list databases [-S primary_server] [-format csv|json] [-limit limit] [-filter filter] [-sort sort]
list availability_groups -format json [-S primary_server] [-limit limit] [-filter filter] [-sort sort]
list availability_groups [-format csv] [-S primary_server] [-limit limit] [-name name] [-cluster_name cluster_name] [-ag_id availability_group_id]
list credentials [-S primary_server] [-format csv|json] [-limit limit] [-filter filter] [-sort sort]
list replicas -ag_id ag_id [-S primary_server] [-format csv|json] [-limit limit] [-filter filter] [-sort sort]
add instance -name instance_name -hostname hostname [-S primary_server]
add replica -instance_id instance_asset_id -ag_id ag_asset_id [-S primary_server]
add availability_group -name ag_name { -cluster_name cluster_name | -guid ag_guid } [-S primary_server]
delete availability_group [-S primary_server] ASSET_ID
delete database [-S primary_server] ASSET_ID
delete instance [-S primary_server] ASSET_ID
delete replica [-S primary_server] ASSET_ID
discover availability_groups -instance_id instance_id [-S primary_server]
discover databases -instance_id instance_id [-S primary_server]
discover instances -hostname hostname [-S primary_server]
manage credentials -name credential_name [-S primary_server] ASSET_ID
modify instance [-state ACTIVE | INACTIVE] [-S primary_server] ASSET_ID
On UNIX systems, the directory path to this command is /usr/openv/netbackup/bin/
On Windows systems, the directory path to this command is install_path\NetBackup\bin\
DESCRIPTION
The nbsqlcmd command can add, list, modify, and delete SQL Server assets.
With the nbsqlcmd command, you can add a SQL Server instance asset or a SQL Server Availability Group asset. The command can associate an existing SQL Server instance asset with an Availability Group asset. The command lets you modify a given SQL Server instance asset with the given asset ID. You can use the command to discover instances on a specified host.
You can use the command to discover Availability Groups that are associated with a given SQL Server instance asset. You can also use the command to discover the databases that are associated with a given SQL Server instance asset.
The command lets you list SQL Server database and instance assets. You can also list SQL Server availability groups and SQL Server Availability Group replicas.
In addition to using nbsqlcmd to list NetBackup CMS SQL Server credentials you can also manage your credentials, and associate a given credential with an asset.
You can use the command to delete a SQL Server Availability Group asset, a SQL Server instance asset, or a SQL Server replica asset.
Before you run the nbsqlcmd command, you must run the bpnbat - login - loginType WEB command. The bpnbat command authenticates your web services logon. The user that is specified when you run bpnbat -login -loginType WEB should be a member of an RBAC role with Assets, SQL Server, View, and Recover permissions.
OPTIONS
- -active
Filters the list of instances to only those that are active. Can only be used with -format csv.
- -ag_id ag_id
The asset ID of an Availability group. Used as a filter for the list commands and input for the add replica command.
- -ASSET_ID
A positional argument that must be specified at the end of the command. The asset ID of the asset to be modified, deleted, or managed.
- -cluster_name cluster_name
The cluster name of an Availability Group. Used to filter on a specific cluster with the list command. Can only be used with -format csv. Used in add availability_group to set the cluster that is associated with the availability group.
- -filter filter
Filters the data in the list. The filter value must be in OData format. Can only be used with -format json.
- -format csv|json
Specifies the format to be used for the output. The default value is csv.
- -guid guid
The GUID of the Availability Group being added as an asset.
- -help
Prints the usage of the nbsqlcmd command.
- -hostname hostname
The host name of an asset. When this option is used in the list command, it can only be used with -format csv.When the option is used with the discover instance command, it is the SQL server host name on which the instances reside.
- -inactive
Filters the assets in list to only the assets that are inactive. Can only be used with -format csv.
- -instance_id instance_id
The asset ID of an Instance.
- -limit limit
The max number of items to be listed. Max of 100.
- -name name
The display name of an asset. When the option is used with add credentials, this option is the name of the CMS named credential.
- -registered
Filters the list of assets to only the assets that are registered. Can only be used with -format csv.
- -S primary_server
Specifies the primary server that contains the asset to be listed or modified.
- -sort sort
Sorts the data in the list. The sort value must be in OData format. Can only be used with -format json.
- -state ACTIVE|INACTIVE
Specifies the new state to be assigned to the given instance asset.
- -unregistered
Filters the list of assets to only the assets that are not registered. Can only be used with -format csv.
EXAMPLES
Example 1: List the instances and filter them based on the instance name.
nbsqlcmd list instances -format json -filter "commonAssetAttributes/ displayName eq 'MSSQLSERVER'"