Skip to main content

restoredatastore

该实用程序可用于所有 ArcGIS Data Store 类型。

如果您无法访问托管图层所使用的数据,请使用备份文件和 restoredatastore 实用程序来恢复数据存储。

如果无法恢复数据存储,请在新计算机上安装 ArcGIS Data Store,请勿配置数据存储,然后将上次完整备份恢复到新计算机。

如果您使用关系存储且要将托管要素图层数据回滚到过去的某个特定时间,请在现有关系存储的上方进行恢复。

注:

关系存储必须配置为支持时间点恢复,并且必须具备可用的对应备份文件,才能恢复到关系存储的先前状态。 例如,如果您只保留了五天的备份,则只能将数据存储恢复到这五天以内的某个时间点。

必须在主关系存储计算机上运行 restoredatastore 实用程序。 该实用程序可以在任何时空大数据存储、图存储或对象存储计算机上运行。

注:

要查找可用于恢复的备份文件,请运行 listbackups 实用程序。

语法

restoredatastore [options]

下表列出了支持的选项:

选项

描述

--store

指示要恢复的数据存储类型。

有效值为 relationalspatiotemporalgraphobject

--target

有效值为 most-recent<yyy-mm-dd-hh:mm:ss> 格式的备份文件时间戳或备份文件的名称。

所有数据存储类型均支持具有 target 选项的备份文件名称。 时间戳和 most-recent 仅适用于关系存储。

在发生故障后恢复关系存储或移动关系存储时,可指定 --target most-recent。 如果将关系存储恢复到某个时间点(这要求关系存储配置为允许时间点恢复),请指定要将数据存储恢复到的日期和时间(UTC 格式)。 如果您想要恢复某个特定的备份文件,请指定备份文件名。 如果您没有指定目标,系统会恢复最近的备份。

--source-loc

这是您要用于恢复数据存储的备份文件所在的顶级目录。 这将是文件共享位置的路径、备份位置名称或 Amazon S3 或 Azure Blob 存储备份位置。

提示:

要获取备份的源位置,可以运行 configurebackuplocation 实用程序,运行时需将 --operation 选项设置为 list。 如果无法运行 configurebackuplocation 实用程序(例如,如果数据存储计算机崩溃并且您正在恢复到新计算机以恢复数据存储),则可以通过名为 agsds_backup_sig 的文件来标识备份源位置。

--bound

有效值为 truefalse

--bound 选项仅适用于关系存储。

默认情况下,会假定您正在恢复关系存储,以使用创建备份时该存储注册到的 GIS Server 站点。 如要恢复数据存储但不保留与数据存储的 GIS Server 站点的关联,则可以仅指定 --bound false。 如果已将托管服务移动至其他 GIS Server,可以将 --bound 选项设置为 false,并在执行恢复时使用 --server-url 选项指定新 GIS Server 站点的 URL。

如果 GIS Server 站点丢失且无法恢复,那么取消绑定关系存储的 GIS Server 以进行恢复是最后的方法。您可以恢复取消绑定的数据存储再将其配置到新的联合 GIS Server 站点。 但是,使用数据存储中的数据的图层将不会存在。 您必须连接到数据存储数据库才能将数据提取为其他格式,并将其重新发布到 ArcGIS Enterprise。

--data-dir

这是要恢复数据库的计算机上的 ArcGIS Data Store 目录。 如果要在新计算机上恢复数据存储,则仅使用 --data-dir。 恢复到新计算机时,还必须指定 --source-loc 选项。

--server-url

如果指定 --bound true(或省略 --bound 选项)以使此数据存储与创建备份时的数据存储注册在同一 GIS Server 站点,请指定该 GIS Server 站点的 URL。 如果指定 --bound true 且已将服务移动至新的 GIS Server 站点,则使用 --server-url 选项指定新 GIS Server 站点的 URL。 如果您指定了新站点 URL,但并未将服务移动至该新服务器,则无法访问数据存储中的数据。

--server-admin

如果指定了 --bound true 或者未指定 --bound 选项,那么此选项为必填项。 提供 ArcGIS Server 管理员的用户名。

--server-password

如果指定了 --bound true 或者未指定 --bound 选项,那么此选项为必填项。 提供 ArcGIS Server 管理员的密码。

--loaddata

支持时空大数据存储、图存储和对象存储。

有效值为 truefalse

当您需要将数据存储恢复到一组新的计算机,且第一台计算机无法容纳所有的这些数据时,请将此选项设置为 false。 这样可以恢复数据存储的方案,将更多的计算机添加至数据存储以容纳所有数据,然后再次运行 restoredatastore 实用程序并将 --loaddata 设置为 true 以恢复数据。 默认情况下,此选项设置为 true

--mode

有效值为 singleInstancecluster

当您将图存储或对象存储恢复到新计算机时,可以指定 cluster 将数据存储从单实例更改为集群模式,或指定 singleInstance 将数据存储从集群模式更改为单实例模式。

--prompt

有效值为 yesno

您运行该实用程序时,系统将提示您确认指定的操作。 如果自动使用此实用程序,可将 --prompt 选项设置为 no,否则必须要回应提示消息,脚本才会继续。

示例

在本示例中,最新备份位于名为 rdsbackups 的备份位置,并将恢复到现有数据存储中。 由于默认存储类型为关系存储,且在默认情况下该数据存储仍会与所注册的 GIS Server 站点保持绑定,因此您无需指定 --store relational--bound true。 但是,必须指定 GIS Server URL 和管理员凭据。

./restoredatastore.sh --target most-recent --source-loc rdsbackups --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password SAup.4s

restoredatastore --target most-recent --source-loc rdsbackups --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password $Aup.4s

You are attempting to restore the data store from a data store backup. This process could take a long time,
depending on the size of your data. Please do not interrupt the process once it has started.
Do you want to continue (Yes or No)?Yes

在本示例中,已启用时间点恢复的关系存储将从网络共享上的关系存储备份位置恢复至 2014 年 7 月 17 日下午 2:30 (UTC) 时的状态。

./restoredatastore.sh --target 2014-07-17-14:30:00 --source-loc /net/sharedserver/entbackups/relds --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password SAup.4s

restoredatastore --target 2014-07-17-14:30:00 --source-loc \\sharedserver\entbackups\relds --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password $Aup.4s

You are attempting to restore the data store from a data store backup. This process could take a long time,
depending on the size of your data. Please do not interrupt the process once it has started.
Do you want to continue (Yes or No)?Yes

在本示例中,可以使用名为 movedatastore 的备份文件将关系存储恢复到新计算机。 恢复到新计算机时,必须指定备份文件的位置和新 ArcGIS Data Store 内容目录的位置。 由于托管要素服务仍运行在关系存储所注册的同一 GIS Server 站点,因此不需要 --bound true,但是需要 GIS Server URL 和管理员凭据。

./restoredatastore.sh --target movedatastore --source-loc /net/buserver/data/backups --data-dir /usr/datastore --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password SAup.4s

restoredatastore --target movedatastore --source-loc \\buserver\data\backups --data-dir C:\datastore --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password $Aup.4s

You are attempting to restore the data store from a data store backup. This process could take a long time,
depending on the size of your data. Please do not interrupt the process once it has started.
Do you want to continue (Yes or No)?Yes

在以下示例中,将时空大数据存储备份文件 (bds1) 从指定名称 (awsloc) 的备份位置中恢复。

./restoredatastore.sh --target bds1 --store spatiotemporal --source-loc 'name=awsloc' --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password SAup.4s

restoredatastore --target bds1 --store spatiotemporal --source-loc name=awsloc --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password $Aup.4s

You are attempting to restore the data store from a data store backup. This process could take a long time,
depending on the size of your data. Please do not interrupt the process once it has started.
Do you want to continue (Yes or No)?Yes

有关硬件故障后恢复时空大数据存储的步骤和示例,请参阅恢复数据存储

在此示例中,可将图数据存储恢复到新计算机。 恢复到新计算机时,必须指定备份文件的位置和新 ArcGIS Data Store 内容目录的位置。 由于知识图谱图层仍运行在图存储所注册的同一 GIS Server 站点,因此不需要 --bound true,但是需要 GIS Server URL 和管理员凭据。

./restoredatastore.sh --store graph --source-loc /net/buserver/kgdata/backups --data-dir /usr/datastore --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password SAup.4s

restoredatastore --store graph --source-loc \\buserver\kgdata\backups --data-dir C:\datastore --server-url https://gisserver.example.com:6443 --server-admin siteadmin --server-password $SAup.4s