Cannot connect to database because the database client software failed to load. Be sure the database client software is installed and configured correctly


Did you get this error after installed a new ArcGIS server and would like to register your data store in Server Manager?

“Cannot connect to database because the database client software failed to load. Be sure the database client software is installed and configured correctly.”

Yes, this error has related to your client database is not well configured. You can read from Esri 40409. But how about after installed and configured, you still get error?

Let me share, I am using Oracle client to connect from ArcGIS server to Oracle DB and in the same machine, I am using ArcGIS  desktop which using different client (32-bit while server is 64-bit). What you can do to solve the issue?

Check again your environment path, does it has your oracle client paths?

Does your oracle client folder has necessary files? such as ojdbc5.jar or ojdbc6.jar depends on your version?

I fixed the issue by copy over ojdbc6.jar into oracle client folder under \bin.

Hopefully this can give you idea on how to solve this error.

 

Good Luck!!!

 

Share on Upgrade ArcGIS Server to 10.3.1


Hello,

Finally, I have finished upgrade all servers, ArcGIS Server and Web Adapter 10.2.2 to 10.3.1. At least 20 + servers across production and non production. Since the upgrade was pretty smooth, specially for single server but for multiple servers environment, you need to be careful. Here are some notes that I can share with you all.

  1. When upgrade multiple servers environment, to make it fast, I removed all servers and left one in cluster and site. So the site was up and running.
  2. Upgraded all servers that outside the cluster/site.
  3. Run Validate All in Data Store to make sure that all Registered Databases and Folders are green.
  4. Upgrade the only server in the cluster/site. I saw that there are some minor changes in folder structures inside config-store and directory compare to 10.2.2.
  5. Added the rest servers into cluster/site.
  6. Make sure to delete all your ArcGIS server connection on ArcCatalog and create new one.

Feel free to share with me if you have something else.

 

Lycka Till!

New Theme


Folks,

It’s almost new year..it is time for me to change my blog theme to something else, something that more eye catching. I took the banner from a real data which I got from StatCounter where I monitor how many people visit my blog. It turned out, not bad, every week this blog has been accessed by at least 500 pageloads.

Thank you all for visiting my blog and hopefully it could answer your issue or at least give you idea on how to solve your issue.

Let me know if you have any questions or anything that could make this blog better in spreading information for ArcGIS users.

 

ERROR ORA-01455 AFTER UPGRADED ARCGIS SERVER TO 10.3.1


You just upgraded your ArcGIS Server and Desktop to 10.3.1 and when you tried to connect to Oracle DB from SDE connection, it threw error:

Underlying DBMS error[ORA-01455: converting column overflows integer datatypeNo extended error.]

Image 55

Actually this error is not related to your new ArcGIS 10.3.1. it is due to your Oracle client that does not meet the minimum requirement. Try update your Oracle client to latest one. It should solve the issue.

Good Luck!!!

 

FINDING GHOST ARCSOC


Many times in many occasions, I came across with “Ghost ArcSOC”. What is Ghost ArcSOC? This is my term, it is basically ArcSOC process which you can see from Windows Task Manager, that running, consuming your server resources BUT the server is not part of any cluster. How come it happens? for my case, I have multiple servers in cluster, sometimes when I removed a server from a cluster, the ArcSOC process would disappear eventually but for some reasons, it wouldn’t. OR in another case for Ghost ArcSOC, one of your servers in a cluster didn’t crank up a ArcSOC process and caused your system degrades.

I created below Python script to make me easier and faster to identify this kind of issue.

</pre>

#-------------------------------------------------------------------------------
# Name: Finding_GHOST.py
# Purpose: List All Started Services, minimum instances and compare them against
# ArcSOC running on all servers
# This script could be used to find GHOST ArcSOC.GHOST ArcSOC is ArcSOC process that running on server
# but the service status is not running on ArcGIS Manager/Admin.
# If column FOUND = NO means ArcSOC process is running BUT Service status is STOPPED = GHOST is found
# Author: Oey
#
# Created: 09/15/2015
# Copyright: (c) Oey 2015
# Licence: <your licence>
#-------------------------------------------------------------------------------

# For Http calls
import httplib, urllib,json,urllib2

# For system tools
import sys, datetime

# For reading passwords without echoing
import getpass
import wmi

#Get the current date
now = datetime.datetime.now()

# Defines the entry point into the script
def main(argv=None):

# ##########################################################################################################################
# Start of Variables
# ##########################################################################################################################

# Server name - Pick a server name that the script will use to login on Admin console
serverName = 'ArcGIS1'

# list of Servers in environment
servers = ["ArcGIS1", "ArcGIS2","ArcGIS3"]

# Status of the Service
startStop = 'STARTED'
##startStop = 'STOPPED'

# Admin/publisher user name and password
username = 'admin'
password = 'admin_123'

# Log file location
filePath = r'\\ArcGIS1\d$\temp\Services_' + startStop + '_Services_' + str(now.year) + str(now.month) + str(now.day) + '.txt'
# ###########################################################################################################################
# End of Variables
# ###########################################################################################################################
doc = open(filePath, "w")
header = "Server,Service,Number of SOCs,Found\n"
doc.write(header)

# Print some info
print
print "This script detects " + startStop + " services in a folder."
print

serverPort = 6080
print

# Create a list to hold folder names
folderList = []

# Create a list to hold stopped/started services
targetList = []

# Get a token
token = getToken(username, password, serverName, serverPort,doc)
if token is None:
print "Could not generate a token with the username and password provided."
doc.write("\nCould not generate a token with the username and password provided." +"\n")
doc.close()
return

folderList = getCatalog(token,serverName,serverPort,doc)

for folder in folderList:
folderName = folder
print
print "Processing folder : " + folderName

# Construct URL to read folder
if folder == "ROOT":
folder = ""
else:
folder += "/"

folderURL = "/arcgis/admin/services/" + folder

# This request only needs the token and the response formatting parameter
params = urllib.urlencode({'token': token, 'f': 'json'})
headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}

# Connect to URL and post parameters
httpConn = httplib.HTTPConnection(serverName, serverPort)
httpConn.request("POST", folderURL, params, headers)

# Read response
response = httpConn.getresponse()
if (response.status != 200):
httpConn.close()
print "Could not read folder information."
doc.write("\n" + "Could not read folder information." +"\n")
return
else:
data = response.read()

# Check that data returned is not an error object
if not assertJsonSuccess(data,doc):
print "Error when reading folder information. " + str(data)
doc.write("\n" + "Error when reading folder information. " + str(data)+"\n")
else:
print "Processed folder information successfully. Now processing services..."
# Deserialize response into Python object
dataObj = json.loads(data)
httpConn.close()
counter = 0

# Loop through each service in the folder and stop or start it
for item in dataObj['services']:

fullSvcName = item['serviceName'] + "." + item['type']

# Construct URL to stop or start service, then make the request
statusURL = "/arcgis/admin/services/" + folder + fullSvcName + "/status"
httpConn.request("POST", statusURL, params, headers)

# Read status response
statusResponse = httpConn.getresponse()
if (statusResponse.status != 200):
httpConn.close()
print "Error while checking status for " + fullSvcName
doc.write("\n" + "Error while checking status for " + fullSvcName +"\n")
return
else:
statusData = statusResponse.read()

# Check that data returned is not an error object
if not assertJsonSuccess(statusData,doc):
print "Error returned when retrieving status information for " + fullSvcName + "."
doc.write("\n" + "Error returned when retrieving status information for " + fullSvcName + "." +"\n")
print str(statusData)
doc.write("\n" + str(statusData) +"\n")

else:
# Add the stopped/started service and the current time to a list
statusDataObj = json.loads(statusData)

if statusDataObj['realTimeState'] == startStop:

# Find MINIMUM INSTANCES PER NODE, IF 1 or more then count into it
minInstURL = "/arcgis/admin/services/" + folder + fullSvcName
httpConn.request("POST", minInstURL, params, headers)

# Read status response
minInstResponse = httpConn.getresponse()
minInstData = minInstResponse.read()
minInstDataObj = json.loads(minInstData)
if minInstDataObj['minInstancesPerNode'] >= 1:
fullSvcNames = folderName + "." + fullSvcName

# Append it into list
counter = counter + 1
targetList.append(fullSvcNames)
#targetList.append([fullSvcName + "(" + str(minInstDataObj['minInstancesPerNode']) + ")" ])

httpConn.close()

# Check number of stopped/started services found
if len(targetList) == 0:
print "No " + startStop + " services detected in folder " + str(folderName)
print
##doc.write("\n\t" + "No " + startStop + " services detected in folder " + str(folderName) +"\n")
##else:
# Write out all the stopped/started services found
# This could alternatively be written to an e-mail or a log file

# ##########################################################################################
# START OF - This portion is to extract ArcSOC process on each servers
# ##########################################################################################

for server in servers:

#Flush dictionary
hitDict = {}
c= wmi.WMI(server)
ArcSOC = 0
for process in c.Win32_Process ():
if process.Name == "ArcSOC.exe":
ArcSOC = ArcSOC + 1
strCmdLine = process.CommandLine

# The data is: "D:\Program Files\ArcGIS\Server\bin\ArcSOC.exe" -XX:-CreateMinidumpOnCrash -Xmx64M -Dservice=maps.AZR_TST.MapServer "-Djava.class.path=D:\Program Files\ArcGIS\
astrVerify = "-Dservice="
ostrVerify = "-Djava.class"
a = strCmdLine.find(astrVerify)
o = strCmdLine.find(ostrVerify)
keyCheck = strCmdLine[a+len(astrVerify):o]
if keyCheck in hitDict:
stats = hitDict[keyCheck]

# Add 1 to tally of hits
stats[0] += 1

else:
# Add key with one hit
hitDict[keyCheck] = [1]

# Read through dictionary
for key in sorted(hitDict):

# Compare each ArcSOC with List of STATUS that collected from Server Admin
if key in targetList:

# Calculate total hit
totalDraws = hitDict[key][0]

# Construct and write the comma-separated line
line = server +"," + key + "," + str(totalDraws) + ",YES" +"\n"
line2 = server +"," + key + "," + str(totalDraws) + ",YES"
print line2
doc.write(line)
else:

# Calculate total hit
totalDraws = hitDict[key][0]

# Construct and write the comma-separated line
line = server +"," + key + "," + str(totalDraws) +",NO" +"\n"
line2 = server +"," + key + "," + str(totalDraws) + ",NO"
print line2

doc.write(line)
# ##########################################################################################
# END OF - This portion is to extract ArcSOC process on each servers
# ##########################################################################################

doc.close()
return

def getCatalog(token,server,port,doc):
baseUrl = "http://{}:{}/arcgis/admin/services".format(server, port)
folderNameList = []
catalog = json.load(urllib2.urlopen(baseUrl + "/" + "?f=json&token=" + token))
print ' List of Folders :'
##doc.write(" List of Folders :" +"\n")
print '\tROOT'
##doc.write("\tROOT" +"\n")
folderNameList.append("ROOT")
if "error" in catalog: return
folders = catalog['folders']
for folderName in folders:
folderNameList.append(folderName)
print '\t'+folderName
##doc.write("\t"+folderName +"\n")
if "error" in catalog: return
else: return folderNameList
# A function to generate a token given username, password and the adminURL.
def getToken(username, password, serverName, serverPort,doc):
# Token URL is typically http://server[:port]/arcgis/admin/generateToken
tokenURL = "/arcgis/admin/generateToken"

params = urllib.urlencode({'username': username, 'password': password, 'client': 'requestip', 'f': 'json'})

headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}

# Connect to URL and post parameters
httpConn = httplib.HTTPConnection(serverName, serverPort)
httpConn.request("POST", tokenURL, params, headers)

# Read response
response = httpConn.getresponse()
if (response.status != 200):
httpConn.close()
print "Error while fetching tokens from admin URL. Please check the URL and try again."
doc.write("\n" + "Error while fetching tokens from admin URL. Please check the URL and try again." +"\n")
return
else:
data = response.read()
httpConn.close()

# Check that data returned is not an error object
if not assertJsonSuccess(data,doc):
return

# Extract the token from it
token = json.loads(data)
return token['token']
# A function that checks that the input JSON object
# is not an error object.
def assertJsonSuccess(data,doc):
obj = json.loads(data)
if 'status' in obj and obj['status'] == "error":
print "Error: JSON object returns an error. " + str(obj)
#doc.write("\n" + "Error: JSON object returns an error. " + str(obj) +"\n")
return False
else:
return True
# Script start
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
<pre>

CLONE ARCGIS SERVER


Yes, have you ever cloned your arcgis server? let say:

  • One day, for no reason, your server that hosting your ArcGIS server is down and the hardware is broken (RAM or hard drive or etc) but fortunately, so have backup its configuration file to different location.
  • One day, you want to create a new site that duplicate of your existing site.

All of those scenarios I mentioned above, you can do it by “cloning”. How is the cloning possibly? It is kind of simple, you only need is you can access to the server config-store and directory and able to get the files/folders. Do you want to know the detail? drop me a line. Disclaimer: Any negative side effects of cloning process is not my responsible. hahaha. PS: I know that there is an option for restoring, Backup & Restore

Update:

Here we go, the detail on how to clone:

1. As my previous information, you have to have access to your config-store and directory folders

2. Remove all files that have .rlock and .site from those folders. Make sure that nothing is locking the files (someone/system open/access), you also can stop ArcGIS server service if it is still running and using the files. Remove default folders such as \SampleWorldCities.Mapserver, \System and etc

3. Now you have “clean” config-store and directory folders.

4. Prepare the server – If you are using new ArcGIS server, you can “connect” it directly or if you are not using new ArcGIS server, you have to remove it from site or do back door by delete xml files from \server\framework\etc.

5. Create a new site and then stop ArcGIS server service.

6. Copy clean folder from number 3 to your new site and start ArcGIS server service.

7. Voila…you just cloned your server.

8. Good Luck

ArcGIS Sucks?


Hi Everyone!

If you search on Google and use keywords like: “ArcGIS Sucks”, “I hate ArcGIS”, “I hate Esri” or any negative word, you will get a lot of hits. One of the very popular sites is this one, http://www.gisdoctor.com/site/2011/03/10/arcgis-sucks/

Many people came to my blog when they had issue which the issue has happened again and again without being fixed by Esri. Some frustrated and some just accepted as they didn’t have choice.

For me, I created this blog part of my missions is to share with other and at least it helps a little bit.

So the next question is if ArcGIS sucks, what other alternatives do we have?

Cadcorp? SuperMap? GeoMedia? TatukGIS? Please add other more from you in the comment box and tell me what the benefit compare to ArcGIS besides it’s free.

Happy Friday!