Sample Commands for MS SQL Server
This topic covers the sample commands to perform various tasks using the pdbctl utility such as adding database connection, creating user mapping, setting encryption properties, and migrating data.
Set the environment variable (
PDB_MUTIL_PATH
).On Linux
export PDB_MUTIL_PATH=<PATH OF UTILITY>
On Windows
set PDB_MUTIL_PATH=<PATH OF UTILITY>
Add the database alias.
Command used: adddbpdbctl.exe adddb -a <databaseuseralias> -t <Database Type> -u <database user> -p <Database user password> -m <meta data password> -d <SID/databse name> -i <Host IP> -o <PORT> -b <nae user> -c <naepassword>
Add the user mapping to authorize an user.
Command used: addusermappdbctl.exe addusermap -a <databaseuseralias> -d <databaseuser> -p <naepassword> -u <naeuser>
Verify the user mapping.
Command used: listusermappdbctl.exe listusermap -a <databaseuseralias>
Set the encryption properties for a column.
Command used: setencinfopdbctl.exe setencinfo -d <database_alias> -a <algorithm> -c <column_name> -k <key_name> -m <mode> -t <table_name>
View the list of columns.
Command used: listcolumnspdbctl.exe listcolumns -a <database_alias> -t <table_name>
Migrate the table.
Command used: migratepdbctl.exe migrate -a <database_alias> -t <table_name> --verbose