How to connect to the database

Source: Internet
Author: User
Tags postgresql client
ArcGIS10.1 how to connect to the database recently used the database of ArcGIS10.1, and found that it is not the same as before, here, I will share my experiences and ideas with you (using Postgresql). Based on the usage process, I will divide the content into two parts (these two parts, after I use it, I split it out and reorganize it,

How to connect to a database in ArcGIS 10.1 recently used a database in ArcGIS 10.1, and found that it is not the same as before, here, I will share my experiences and ideas with you (using Postgresql). Based on the usage process, I will divide the content into two parts (these two parts, after I use it, I split it out and reorganize it,

How to connect to a database in ArcGIS 10.1

Recently, when using the ArcGIS 10.1 database, I found that it is not the same as before. Here I will share my experiences and ideas with you (using Postgresql ), based on the usage process, I divide the content into two parts (these two parts are divided out after I use them and reorganized, interspersed with my own ideas, welcome to join us .), 10.1 you no longer need to install arcgis sde. You can use tools to directly create a spatial database on Oracle and directly connect to it.

How to connect to a database through direct connection

1. ArcGIS 10.1 unifies database connections, that is, it does not distinguish whether it is a spatial database connection or a relational database connection through OLEDB.

The picture on the left is under 10.1, and the picture on the right is under 10.0

2. You can only use direct connection in Catalog;

3. In ArcGIS 10.1, the installation media provided by Esri does not contain Postgresql (previously included );

4. When Postgresql is installed, the official software requirements are 64-bit, and all enterprise-level databases are 64-bit (this should be related to the Server, because Server 10.1 is pure 64-bit, several dll files in the DatabaseSupport directory of the desktop software are 64-bit, which will be used later. The official software requirements are as follows:

Database

Supported Operating Systems

Minimum OS Version

Maximum OS Version

PostgreSQL 9.0.5 (64-bit)

Red Hat Enterprise Linux Server 5 (64-bit)

Update 7

Red Hat Enterprise Linux Server 6 (64-bit)

SUSE Linux Enterprise Server 11 (64-bit)

SP1

Windows Server 2003 Standard, Enterprise, and Datacenter (64-bit [EM64T])

SP2

SP2

Windows Server 2008 R2 Standard, Enterprise, and Datacenter (64-bit [EM64T])

SP1

5. Configure the PostgreSQL client. Because the direct connection method requires that the client of ArcSDE must install the database client class library, you must first obtain the PostgreSQL client. ArcGIS Desktop is a 32-bit software and requires a 32-bit PostgreSQL class library. Find the PostgreSQL client, or copy the 32-bit libeay32.dll, libiconv-2.dll, libintl-8.dll, libpq. dll, and ssleay32.dll files to the bin directory of the Desktop installation directory on another machine;

6. Copy st_geometry.dll, copy the st_geometry.dll file to the lib directory of PostgreSQL in the DatabaseSupport/PostgreSQL/Windows64 directory under the Desktop installation directory (see 64. This type of database must be used when creating a Geodatabase in PostgreSQL;

7. Configure pg_cmd.conf, modify the pg_cmd.conf file of ipvsq, and add "host all 0.0.0.0/0 md5" (for details about the file configuration, refer to relevant materials );

8. After SDE is installed, no post interface is found. In 10.1, tools provided in the toolbox are used to create an enterprise-level Geodatabase. In other words, the previous post was replaced by a bunch of tools in the Toolbox;

9. Create a geographical database

10.1 when creating a geographical database, we provide three types of data: Oracle, SQL Server, and Postgresql. We use this tool to create a geographical database. This process is equivalent to the POST process, create a database and write a bunch of system tables. The creation interface is as follows:

After the database is successfully created, you can see the sde database in pgAdmin and many system tables, such:

10. Connect to geographic data (direct connection );

As mentioned above, ArcGIS 10.1 unifies database connections. How can we determine whether it is a relational database or a spatial database? In fact, this is not difficult, because when we create a space database, we also create a user name and password, then use this user name to connect and select the created database, the database is a space database. The connection interface is as follows:

After the connection is successful, I created a feature dataset in the database and added several pieces of data to perform a topology analysis (this is not for topology purposes, but for topology analysis purposes, so we will not discuss the topology analysis results). The results are as follows:

Similarly, a geometric network is created, and the effect is as follows:

Now, let's look at a question: we use direct connection to access the database. Do you think there is anything missing? We will think about how to use the database before, first installed the relational database (Postgresql), this step we have, and then installed ArcGIS SDE for postgresql, we do not have this step, then create a database and connect to the database. From the whole process, we have not installed SDE. Why can we also create a spatial database?

This is also one I found myself. At the beginning, I did install SDE, but I found that this installation does not require ArcGIS 10 or the previous pop-up post interface, after the installation, I did not respond. I went to the installation directory and looked at it. I found that the installation actually decompressed some things, and my spatial database has not yet been created? Later I found that there was no such service option when connecting to the database. At the beginning, I felt that this installation had nothing to do with connecting to the database, so I uninstalled it according: container 10.1 does not need to install any SDE components. A new problem arises. We know that in previous versions, SDE also has a way of connecting services. How can we use service connections?

If you are careful, we can find that when installing SDE, there are two components for us to install:

According to the description on the right of the component, we know that this installation is for service connection. That is to say, if you want to connect using the service method, you need to install SDE and create a service, how to use the service connection (we obviously see that the root of the connection does not have the service option) is the question we will discuss.

How to connect to a database using services

Additional steps for service connection

  1. Install ArcSDE for PostgreSQL 10.1;
  2. Modify the services. sde file in the installation directory of ArcSDE and the hosts file in Windows, and add "esri_sde 5151/tcp" records respectively;
  3. Create an ArcSDE service. Enter the following commands to create a service in the registry:
    Sdeservice-o create-d POSTGRESQL, postgresql-x64-9.0
    Sdeservice-o register-d POSTGRESQL, postgresql-x64-9.0-r ADMIN_DATABASE-v sde
  4. Start the service. You can use the "sdemon-o start" command or start the ArcSDE service from the Windows service panel;


  1. Create a connection. You can only Create a direct Connection server in the catalog. Therefore, you must use the new Create ArcSDE Connection File GP Tool to Create the ArcSDE service Connection File. After the connection is created, double-click the connection in catalog.

Through this tool, if our database is ArcGIS 10 or earlier and adopts the service method, we should use this tool when using 10.1 (no test, based on backward compatibility, I guess)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.