迁移基于文件的数据

用户可以将数据文件(例如电子表格)上载到 Oracle Analytics Cloud 来创建数据集。迁移到新的 Oracle Analytics Cloud 环境时,可以迁移此基于文件的数据。有时,网络连接或存储访问问题可能会导致您无法迁移快照中的数据文件。对于此类情况,Oracle Analytics Cloud 提供了一个 CLI 实用程序(命令行界面),以便您能够将数据文件移至新位置。快照 CLI 实用程序还可移动用户可能为其数据可视化上载的任何地图相关插件和扩展文件。

尝试还原包含数据文件的快照时,如果看到消息 Restore succeeded with errors - data restore failed(还原已成功但有错误 - 数据还原失败)或类似消息,则运行数据迁移 CLI 实用程序。在以下情况下会显示此消息:
  • 从不同区域迁移内容。
  • 将内容从第 1 代上的 Oracle Analytics Cloud 或 Oracle Cloud Infrastructure Classic 迁移到第 2 代上的 Oracle Analytics Cloud。
  • 由于某个其他网络连接或存储访问问题,导致还原过程失败。

使用 CLI 实用程序,您可以通过一个步骤将数据文件直接从一个环境移至另一个环境。或者,如果您愿意,可以通过两个单独步骤进行,将基于文件的数据下载到 ZIP 文件,然后将数据文件上载到选择的环境。

  1. 检查您的环境详细信息。
    • 确认源和目标系统是否都使用 Oracle Analytics Cloud 5.3 或更高版本。CLI 实用程序在早期版本中不可用。

      如果您不确定,请咨询 Oracle 代表。

    • 检查源和目标系统是否都已启动且正在运行,以及是否为 Oracle Analytics Cloud 配置了有效的存储身份证明。

    • 检查您的本地环境。需要 Java 1.8 或更高版本来运行 CLI 实用程序。

    • 确保您可以从您计划运行 CLI 实用程序的本地环境访问源环境和目标 Oracle Analytics Cloud。

    • 确认以前下载并包含基于文件的数据的快照的名称和位置。例如 /tmp/20190307095216.bar
  2. 下载 CLI 实用程序。
    1. 在目标 Oracle Analytics Cloud 中,依次单击控制台快照
    2. 单击页菜单 页菜单,然后选择下载数据迁移实用程序
      按照说明操作,在本地保存 migrate-oac-data.zip 文件。
  3. 解压缩 migrate-oac-data.zip

    该 ZIP 文件包含三个文件:

    • migrate-oac-data.jar
    • config.properties
    • readme
  4. 如果要通过一个步骤将源环境中存储的数据文件直接迁移到目标,则配置 config.properties 中的 [MigrateData] 部分。
    [MigrateData]
    # Migrate data files from a source Oracle Analytics Cloud environment (OAC) to a target Oracle Analytics Cloud environment.
        # Specify the source environment as Oracle Analytics Cloud.
          SOURCE_ENVIRONMENT=OAC
        # Source Oracle Analytics Cloud URL. For example: https://sourcehost.com:443 or http://sourcehost.com:9704
          SOURCE_URL=http(s)://<Source Oracle Analytics Cloud Host>:<Source Port>
        # Name of a user with Administrator permissions in the source environment. For example: SourceAdmin
          SOURCE_USERNAME=<Source Administrator User Name>
        # Location of the source snapshot (.bar file). For example:  /tmp/20190307095216.bar
          BAR_PATH=<Path to Source Snapshot>
        # Target Oracle Analytics Cloud URL. For example: https://targethost.com:443 or http://targethost.com:9704
          TARGET_URL=http(s)://<Target Oracle Analytics Cloud Host>:<Target Port>
        # Name of a user with Administrator permissions in the target environment. For example: TargetAdmin
          TARGET_USERNAME=<Target Administrator User Name>
  5. 如果要先将数据文件从源 Oracle Analytics Cloud 下载到本地环境,然后将这些数据文件上载到目标 Oracle Analytics Cloud 环境,则配置 config.properties 中的 [DownloadDataFiles][UploadDataFiles] 部分。
    [DownloadDataFiles]
    #Download Data Files: Download data files from Oracle Analytics Cloud storage to a local repository
        # Specify the source environment as Oracle Analytics Cloud.
          SOURCE_ENVIRONMENT=OAC
        # Source Oracle Analytics Cloud URL. For example: https://sourcehost.com:443 or http://sourcehost.com:9704
          SOURCE_URL=http(s)://<Source Oracle Analytics Cloud Host>:<Source Port>
        # Name of a user with Administrator permissions in the source environment. For example: SourceAdmin
          SOURCE_USERNAME=<Source Administrator User Name>
        # Location of the source snapshot (.bar file). For example:  /tmp/20190307095216.bar
          BAR_PATH=<Path to Source Snapshot>
        # Local data file directory. Make sure you have enough space to download the data files to this directory. For example: /tmp/mydatafiledir 
          DATA_FRAGMENTS_DIRECTORY=<Data Files Directory>
         # Data fragment size. Data files are downloaded in fragments. Default fragment size is 500MB.
          MAX_DATA_FRAGMENT_SIZE_IN_MB=500
    [UploadDataFiles]
    #Upload data files: Upload data files to the target Oracle Analytics Cloud. 
        # Target Oracle Analytics Cloud URL. For example: https://targethost.com:443 or http://targethost.com:9704
          TARGET_URL=http(s)://<Target Oracle Analytics Cloud Host>:<Target Port>
        # Name of a user with Administrator permissions in the target environment. For example: TargetAdmin
          TARGET_USERNAME=<Target Administrator User Name>
        # Local directory containing the data files you want to upload. For example: /tmp/mydatafiledir
          DATA_FRAGMENTS_DIRECTORY=<Data Files Directory>
        # Location of the source snapshot (.bar file). For example:  /tmp/20190307095216.bar
          BAR_PATH=<Path to Source Snapshot>
  6. 在本地环境中运行 migrate-oac-data.jar 文件。

    语法:

    migrate-oac-data.jar [-config configfile] [-d] [-help] [-m]  [-u]

    其中:

    • -config configfileconfig.properties 文件的名称

    • -d:使用 config.properties 中的信息在本地下载数据

    • -help:显示帮助

    • -m:使用 config.properties 文件中的源和目标信息迁移数据

    • -u:使用 config.properties 文件中的信息上载数据

    例如,要通过一个步骤迁移数据文件:

    java -jar migrate-oac-data.jar -m -config config.properties

    例如,要在本地下载数据文件:

    java -jar migrate-oac-data.jar -d -config config.properties

    例如,要上载数据文件:

    java -jar migrate-oac-data.jar -u -config config.properties
  7. 登录到目标 Oracle Analytics Cloud。
  8. 要公开 Oracle Analytics Cloud 中的数据文件,必须再次还原用于迁移其余内容的快照。这一次,必须选择定制还原选项。
    1. 打开控制台,然后单击快照
    2. 选择包含数据文件的快照。
    3. 选择定制还原选项,然后选择选项基于文件的数据
      取消选择所有其他选项。
    4. 单击还原
  9. 确认数据文件是否可用。