Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 (中文) » SQL Anywhere 16 - 更改和升级 » 如何升级到 SQL Anywhere 16 » MobiLink 升级 » 统一数据库升级

 

升级统一数据库(10.0.0 版之前的 SQL Anywhere)

必须先运行安装新系统对象的升级脚本,然后才能将新的 MobiLink 服务器与现有的 10.0.0 版之前的 SQL Anywhere 统一数据库一起使用。

前提条件

如果已经建立了 SQL Anywhere 统一数据库,但一直未与其同步,则必须运行安装脚本(非升级脚本)。这一步仅适用于 SQL Anywhere 统一数据库。请参见SQL Anywhere 统一数据库

上下文和注释

  • 在 SQL Anywhere 10.0.0 版之前,MobiLink 系统表归 dbo 所有。要运行 SQL Anywhere 数据库的安装脚本,必须以 MobiLink 系统表所有者的身份登录至统一数据库。如果用户要运行这些脚本,仅具有更改表的权限是不够的。若要运行升级脚本,可以使用 SETUSER SQL 语句模拟 dbo。例如:

    SETUSER "dbo";

    若要在 Sybase Central 中升级统一数据库,应使用 GRANT CONNECT 语句创建 dbo 口令,然后以 dbo 身份连接。例如:

    GRANT CONNECT TO dbo IDENTIFIED BY password;

    在后一种情况中,升级后应使用 ALTER USER 删除 dbo 口令。例如:

    ALTER USER TO dbo IDENTIFIED BY "";
 任务
  1. 如果要升级版本 10.0.0 以前的 SQL Anywhere 统一数据库,必须首先将数据库升级到版本 16:

    1. 关闭数据库服务器。

    2. 将数据库升级到版本 16。

      有关说明,请参见:

    3. 启动数据库服务器,以 DBA 身份登录。

      以 DBA 身份登录进行升级。

  2. 对要进行升级的版本运行合适的升级脚本。

    升级脚本名为 upgrade_asa.sql。它位于 SQL Anywhere 安装目录的 MobiLink\upgrade\version 子目录中,其中 version 是要升级的 SQL Anywhere 原版本。

    要运行升级脚本,需使用 SETUSER SQL 语句模仿 dbo 用户。

    例如,要升级 SQL Anywhere 9.0.2 版统一数据库,可以在 Interactive SQL 中连接到数据库,然后执行以下语句:

    SETUSER "dbo";
    READ 'C:\Program Files\SQL Anywhere 16\MobiLink\upgrade\9.0.2\upgrade_asa.sql'
  3. 删除 dbo 口令。例如:

    GRANT CONNECT TO "dbo";
  4. 如果作为 DBA 以外的用户运行 MobiLink 服务器,则应向该用户授予对新的 MobiLink 系统对象的执行权限。哪些系统对象是新的取决于从哪个版本升级。以下代码授予所有 MobiLink 系统对象必要的权限。执行代码前,应将用户名 my_user 更改为正在运行 MobiLink 服务器的用户名。



    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_column to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_connection_script to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_database to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_device to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_device_address to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_listening to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_passthrough to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_passthrough_repair to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_passthrough_script to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_passthrough_status to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_primary_server to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_property to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_qa_delivery to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_qa_delivery_archive to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_qa_global_props to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_qa_notifications to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_qa_repository to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_qa_repository_archive to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_qa_repository_props to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_qa_repository_props_archive to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_qa_repository_staging to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_qa_status_history to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_qa_status_history_archive to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_qa_status_staging to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_ra_agent to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_ra_agent_property to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_ra_agent_staging to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_ra_deployed_task to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_ra_event to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_ra_event_staging to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_ra_managed_remote to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_ra_notify to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_ra_remote_db_class to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_ra_task to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_ra_task_command to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_ra_task_command_property to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_ra_task_property to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_script to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_script_version to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_scripts_modified to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_sis_sync_state to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_subscription to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_table to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_table_script to my_user;
    GRANT SELECT, INSERT, UPDATE, DELETE ON dbo.ml_user to my_user;
    GRANT EXECUTE ON dbo.ml_add_column to my_user;
    GRANT EXECUTE ON dbo.ml_add_connection_script to my_user;
    GRANT EXECUTE ON dbo.ml_add_dnet_connection_script to my_user;
    GRANT EXECUTE ON dbo.ml_add_dnet_table_script to my_user;
    GRANT EXECUTE ON dbo.ml_add_java_connection_script to my_user;
    GRANT EXECUTE ON dbo.ml_add_java_table_script to my_user;
    GRANT EXECUTE ON dbo.ml_add_lang_conn_script_chk to my_user;
    GRANT EXECUTE ON dbo.ml_add_lang_connection_script to my_user;
    GRANT EXECUTE ON dbo.ml_add_lang_table_script to my_user;
    GRANT EXECUTE ON dbo.ml_add_lang_table_script_chk to my_user;
    GRANT EXECUTE ON dbo.ml_add_missing_dnld_scripts;
    GRANT EXECUTE ON dbo.ml_add_passthrough to my_user;
    GRANT EXECUTE ON dbo.ml_add_passthrough_repair to my_user;
    GRANT EXECUTE ON dbo.ml_add_passthrough_script to my_user;
    GRANT EXECUTE ON dbo.ml_add_property to my_user;
    GRANT EXECUTE ON dbo.ml_add_table_script to my_user;
    GRANT EXECUTE ON dbo.ml_add_user to my_user;
    GRANT EXECUTE ON dbo.ml_delete_device to my_user;
    GRANT EXECUTE ON dbo.ml_delete_device_address to my_user;
    GRANT EXECUTE ON dbo.ml_delete_listening to my_user;
    GRANT EXECUTE ON dbo.ml_delete_passthrough to my_user;
    GRANT EXECUTE ON dbo.ml_delete_passthrough_repair to my_user;
    GRANT EXECUTE ON dbo.ml_delete_passthrough_script to my_user;
    GRANT EXECUTE ON dbo.ml_delete_remote_id to my_user;
    GRANT EXECUTE ON dbo.ml_delete_sync_state to my_user;
    GRANT EXECUTE ON dbo.ml_delete_sync_state_before to my_user;
    GRANT EXECUTE ON dbo.ml_delete_user to my_user;
    GRANT EXECUTE ON dbo.ml_delete_user_state to my_user;
    GRANT EXECUTE ON dbo.ml_lock_rid to my_user;
    GRANT EXECUTE ON dbo.ml_qa_add_delivery to my_user;
    GRANT EXECUTE ON dbo.ml_qa_add_message to my_user;
    GRANT EXECUTE ON dbo.ml_qa_handle_error to my_user;
    GRANT EXECUTE ON dbo.ml_qa_stage_status_from_client to my_user;
    GRANT EXECUTE ON dbo.ml_qa_staged_status_for_client to my_user;
    GRANT EXECUTE ON dbo.ml_qa_upsert_global_prop to my_user;
    GRANT EXECUTE ON dbo.ml_ra_add_agent_id to my_user;
    GRANT EXECUTE ON dbo.ml_ra_assign_task to my_user;
    GRANT EXECUTE ON dbo.ml_ra_cancel_notification to my_user;
    GRANT EXECUTE ON dbo.ml_ra_cancel_task_instance to my_user;
    GRANT EXECUTE ON dbo.ml_ra_clone_agent_properties to my_user;
    GRANT EXECUTE ON dbo.ml_ra_delete_agent_id to my_user;
    GRANT EXECUTE ON dbo.ml_ra_delete_events_before to my_user;
    GRANT EXECUTE ON dbo.ml_ra_delete_task to my_user;
    GRANT EXECUTE ON dbo.ml_ra_get_agent_events to my_user;
    GRANT EXECUTE ON dbo.ml_ra_get_agent_ids to my_user;
    GRANT EXECUTE ON dbo.ml_ra_get_agent_properties to my_user;
    GRANT EXECUTE ON dbo.ml_ra_get_latest_event_id to my_user;
    GRANT EXECUTE ON dbo.ml_ra_get_orphan_taskdbs to my_user;
    GRANT EXECUTE ON dbo.ml_ra_get_remote_ids to my_user;
    GRANT EXECUTE ON dbo.ml_ra_get_task_results to my_user;
    GRANT EXECUTE ON dbo.ml_ra_get_task_status to my_user;
    GRANT EXECUTE ON dbo.ml_ra_int_cancel_notification to my_user;
    GRANT EXECUTE ON dbo.ml_ra_int_move_events to my_user;
    GRANT EXECUTE ON dbo.ml_ra_manage_remote_db;
    GRANT EXECUTE ON dbo.ml_ra_notify_agent_sync to my_user;
    GRANT EXECUTE ON dbo.ml_ra_notify_task to my_user;
    GRANT EXECUTE ON dbo.ml_ra_reassign_taskdb to my_user;
    GRANT EXECUTE ON dbo.ml_ra_set_agent_property to my_user;
    GRANT EXECUTE ON dbo.ml_ra_ss_agent_auth_file_xfer to my_user;
    GRANT EXECUTE ON dbo.ml_ra_ss_download_ack to my_user;
    GRANT EXECUTE ON dbo.ml_ra_ss_download_prop to my_user;
    GRANT EXECUTE ON dbo.ml_ra_ss_download_remote_dbs to my_user;
    GRANT EXECUTE ON dbo.ml_ra_ss_download_task to my_user;
    GRANT EXECUTE ON dbo.ml_ra_ss_download_task2;
    GRANT EXECUTE ON dbo.ml_ra_ss_download_task_cmd to my_user;
    GRANT EXECUTE ON dbo.ml_ra_ss_end_upload to my_user;
    GRANT EXECUTE ON dbo.ml_ra_ss_upload_prop to my_user;
    GRANT EXECUTE ON dbo.ml_ra_unmanage_remote_id to my_user;
    GRANT EXECUTE ON dbo.ml_reset_sync_state to my_user;
    GRANT EXECUTE ON dbo.ml_set_device to my_user;
    GRANT EXECUTE ON dbo.ml_set_device_address to my_user;
    GRANT EXECUTE ON dbo.ml_set_listening to my_user;
    GRANT EXECUTE ON dbo.ml_set_sis_sync_state to my_user;
    GRANT EXECUTE ON dbo.ml_upload_update_device_address to my_user;
    GRANT EXECUTE ON dbo.ml_upload_update_listening to my_user;

结果

现在,统一数据库与新的 MobiLink 服务器便可一起使用。