Troubleshooting Corrupted Registrations
After installing or updating Spok Mobile with Smart Suite, registrations for Spok Mobile configurations may be out of sync and corrupted. The SQL scripts below will allow you to identify which registrations are out of sync. Out of sync registrations can be caused by product changes involving the LocalDeviceID. These changes can cause synchronization problems if registrations exist in one server but not the other server(s).
In order to identify corrupted registrations, you must first collect a list of registrations on three servers: Smart Suite (Host), Premise (MCS), and Hosted (MCH).
To easily identify the registrations that are not in sync in the system, SQL scripts are provided for the 3.5, 4.0 and later versions of Spok Mobile.
The scripts return the following information:
SiteId
RegUserID
PhoneNumber
LDI
Email
Registration Status
AmcVendorDeviceId
RegistrationId
Spok Mobile 3.5
For version 3.5.x of Spok Mobile, the registrations_amcs_35.sql script can identify the out of sync registrations in the system.
registrations_amcs_35.sql |
This script is executed on the Premise (MCS) database. |
Sample output file name:
|
Spok Mobile 4.0+
For versions 4.x and later of Spok Mobile, the scripts below can identify the out of sync registrations in the system.
Hosted
registrations_amch_40.sql |
This script must be executed on the Hosted (MCH) database. | A member of the Hosted Operations team needs to run this query. The script produces a spreadsheet that lists all registrations for that customer across all sites. Save the relevant columns from the spreadsheet in their original order as a CSV file, then open the file with a text editor and replace ‘,’ with ‘|’ and rename the file to mch_registrations.txt . |
Services
registrations_amcs_40.sql |
This script must be executed on the (MCS) database. |
Sample output file name:
|
Smart Suite Systems
For versions 4.x and later of Spok Mobile, the scripts below can identify the out of sync registrations on systems that are using a Smart Suite host system.
registrations_ss.sql |
This script must be executed on the Smart Suite database as the “atms ” user. |
Sample output file name:
|
What to Do With the Results
You can compare the query results in various ways. The following process describes one option. Because it uses a Linux diff
command, all output files should be copied to a Linux server, such as the customer’s database server on which the Oracle script was executed.
Data in each file must be formatted the same way and sorted by telephone number. The format of the data should be phone#|LDI|EmailAddress|SiteID
.
Each query returns the current registrations sorted by telephone number. The results from the three queries can then be meaningfully compared. Specifically, for each site ID and telephone number, LocalDeviceID
must match. Please note that if two or more records with the same Site ID and telephone number are returned, these records must be inspected carefully.
Please note that while an outline of the process is included below, more detailed information on how to use the Smart Suite Database Server product can be found in Installing Smart Suite Database Server RHEL7.
To compare the results, perform the following steps:
-
Identify the customer’s Site ID(s).
-
Send a request to the Hosted Operations team, requesting the Hosted registrations for all sites, using queries found in the
registrations_mch_40.sql
script. You can reach the Hosted Operations team athosted.monitoring@spok.com
. -
Log into the Smart Suite Database server.
-
In the Smart Suite Database server, start up SqlPlus as “
atms
” user. -
Run the
registrations_ss.sql
script. -
Verify that the query produces a
ss_registrations.txt
file. -
Remove the extra entries from the output file.
-
Log into the Spok Mobile Enterprise server. For information on how to log into the Spok Mobile Enterprise environment, see the Spok Enterprise 4.6 Administrator's Guide.
-
Using the SQL Server Management studio, run the query from the
registrations_mcs.sql
script. -
Capture the output in a file called
mcs_registrations.txt
. -
Move the files to the Smart Suite database server.
- Sort the three files using Linux sort command such as the following:
sort ss_registrations.txt > ss_customer
sort mcs_registrations.txt > mcs_customer
sort mch_registrations.txt > mch_customer
-
Run the Linux
diff
commands on the output files. For example:- Compare the Smart Suite registrations to the Spok Mobile Enterprise (MCS) registrations.
diff -Bb ss_customer mcs_customer | grep ">" | awk ‘{ print $2 }’ > in_mcs_but_not_in_ss
diff -Bb ss_customer mcs_customer | grep "<" | awk ‘{ print $2 }’ > in_ss_but_not_in_mcs
- Compare the Spok Mobile Enterprise (MCS) registrations to the Hosted (MCH) registrations.
diff -Bb mcs_customer mch_customer | grep ">" | awk ‘{ print $2 }’ > in_mcs_but_not_in_mch
diff -Bb mcs_customer mch_customer | grep "<" | awk ‘{ print $2 }’ > in_mch_but_not_in_mcs
- Compare the Smart Suite registrations to the Spok Mobile Enterprise (MCS) registrations.
What to Do with the Comparison Results
-
Identify the items that are in MCS, but not Smart Suite and MCH. Delete these items from MCS.
-
Identify the items that are in MCS and MCH, but not Smart Suite. These items should either be deleted from MCS and MCH or added to Smart Suite (if missing from Smart Suite by mistake.)
-
Identify the items that are in Smart Suite and MCH, but not in MCS. Add these items into MCS by un-registering and registering the device. For detailed information on how to do this on the device, see the Spok Mobile documentation.
-
Identify the items that are in Smart Suite, but not in MCS and MCH. These items should either be added to MCS and MCH (un-register and register) if they are valid, or removed from the Smart Suite pager table if they are no longer valid/active.
- Identify the items that have inconsistent
LocalDeviceID
values in the different locations:- Identify the
LocalDeviceId
that is correct. - If incorrect
LocalDeviceId
values are identified, update the incorrectLocalDeviceId
values.
- Identify the