Restoring in the multiplex environment

Confirm with Technical Support that a restore operation is needed. If you have trouble opening your database on a secondary server, synchronize the server. For details, see “Synchronizing secondary servers”. Note that it is never necessary to restore a coordinator node due to secondary node problems.

You must perform read-write restore operations against a server running the utility database. Restore returns an error if run against a secondary server.

StepsRestoring IQ store data when restoring database in same location

  1. Confirm that database home directories for each server still exist. If not, create them or restore them from file system backups:

  2. Shut down every server in the multiplex (coordinator and all secondary servers) using the Stop Multiplex command in Sybase Central.

    NoteIf automatic startup is enabled in your ODBC configuration, users on the same machine as the server may be able to start the server automatically and you will need to prevent this from happening while you are restoring the database.

  3. After stopping all servers, verify that the database shut down successfully. If you see an active iqsrv15 process with the server name of a server in the multiplex (in a startup parameter), stop the process.

    To verify on a UNIX system, use the ps command. For example:

    % ps -ef | grep iqsrv15 
    
    fiona 434     1  1   May 19 ?? 0:05 start_iq 
    -n myhost_myserver 
    -c 32MB -x tcpip(port=1234) mpxdb.db    
    fiona 4751   442  1 16:42:14 pts/5    
    0:00 grep start_iq
    

    To verify on a Windows system, use Task Manager. Look on the Processes tab for iqsrv15.exe or find the IQ Server icon in the system tray and stop it using right-click and Shutdown.

  4. Move files required for debugging and reconfiguring the multiplex.

    • Make a file system copy of the .iqmsg file. If you have message log archiving configured, see “Backing up the right files,” in System Administration Guide: Volume 1.

    • On each server, preserve any files that were added to IQ_SYSTEM_TEMP for that server. These files will be of the form dbname.iqtmp if you used an OS file, or they could be raw devices. If the IQ Temporary store is damaged, start the server with the -iqnotemp switch to drop and recreate the temporary store dbspaces. For more information, see Release Bulletin.

      Either drop the database or delete the following files from the coordinator:

      <database_home>/<dbname>.db
      
      <database_home>/<dbname>.log
      

      If a query server is damaged, however, drop it and re-add it after RESTORE. Then follow the instructions in “Restoring IQ store data when restoring database in a different location.”

  5. Start the utility database from the coordinator server directory using the coordinator server’s server name:

    % start_iq -n thoreau_Server01 -c 32MB 
    -x tcpip(port=1234) 
    
  6. Connect to the utility database (utility_db).

    % dbisql -c "eng=thoreau_Server01;uid=DBA;pwd=SQL;
    dbn=utility_db"
    
  7. Run the RESTORE command. If you need to restore certain dbspace files to a different path, specify a RENAME clause. For details, see the RESTORE statement in Reference: Statements and Options.

  8. Shut down the utility database.

  9. Make sure that the temporary dbspaces exist as before, on raw devices or as files of the correct length. See “Backing up the right files,” in Chapter 12, “Data Backup, Recovery, and Archiving,” in System Administration Guide: Volume 1. For information on starting without the IQ Temporary Store, see the Release Bulletin.

  10. Start the coordinator server and, if restoring to the same location, synchronize the secondary servers. For more information, see “Synchronizing secondary servers”.

  11. Start the secondary servers.

StepsRestoring IQ store data when restoring database in different location

  1. Confirm that database home directories for each server still exist. If not, create them or restore them from file system backups:

  2. If this is not the first time restoring to the new location, shut down all multiplex servers running at the destination location (coordinator and secondary servers) using the Stop Multiplex command in Sybase Central. It is not necessary to stop the multiplex running at the original location where the backup was taken.

    NoteIf automatic startup is enabled in your ODBC configuration, users on the same machine as the server may be able to start the server automatically and you will need to prevent this from happening while you are restoring the database.

  3. After stopping all servers, verify that the database shut down successfully. If you see an active iqsrv15 process with the server name of a server in the multiplex (in a startup parameter) you should stop it.

    To verify on a UNIX system, use the ps command. For example:

    % ps -ef | grep iqsrv15 
    
    fiona 434     1  1   May 19 ?? 0:05 start_iq 
    -n myhost_myserver 
    -c 32MB -x tcpip(port=1234) mpxdb.db    
    fiona 4751   442  1 16:42:14 pts/5    
    0:00 grep start_iq
    

    To verify on a Windows system, use Task Manager. Look on the Processes tab for iqsrv15.exe or find the IQ Server icon in the system tray and stop it using right-click and Shutdown.

  4. Move files required for debugging and reconfiguring the multiplex.

    • Make a file system copy of the .iqmsg file. If you have message log archiving configured, see “Backing up the right files,” in System Administration Guide: Volume 1.

  5. Start the utility database from the coordinator server directory using the new coordinator server’s server name:

    % start_iq -n thoreau_Server01 -c 32MB 
    -x tcpip(port=1234) 
    
  6. Connect to the utility database (utility_db).

    % dbisql -c "eng=thoreau_Server01;uid=DBA;pwd=SQL;
    dbn=utility_db"
    
  7. Run the RESTORE command with a new location path for the database. If you need to restore certain dbspace files to a different path, specify a RENAME clause. For details, see the RESTORE statement in Reference: Statements and Options.

  8. Start the restored database either by reconnecting to the utility_db server and specifying the restored database filename or by stopping the server and restarting it with the restored database. If you restart the server you will need to use the single node and override flags (-iqmpx_sn 1 -iqmpx_ov 1).

  9. Drop all the secondary nodes, using DROP MULTIPLEX SERVER statement (for example, DROP MULTIPLEX SERVER node_w3_skm)

  10. Once you drop the last secondary node, the coordinator shuts down automatically, signifying conversion to simplex.

  11. Restart the coordinator without the single node or override switch.

  12. Recreate all the secondary nodes with the correct location path. For example:

    CREATE MULTIPLEX SERVER node_r2_skm DATABASE
    '/sunx3005/mpx_simdb.db'
    HOST 'localhost' PORT 8998
    ROLE READER STATUS INCLUDED
    

    After you create the first secondary node, the server automatically shuts down, signifying conversion to multiplex.

    NoteIn the preceding command, you must provide the database file extension .DB.

  13. When you restart the coordinator, you will see a warning in server log about multiplex environment being invalid. This warning is thrown when IQ_SYSTEM_TEMP dbspace does not contain any file. This is true for all the secondary nodes created in last step. Ignore this warning for now.

  14. Synchronize the secondary servers. For more information, see “Synchronizing secondary servers”.

  15. Start the secondary servers.

  16. Connect to each secondary server and add files in IQ_SYSTEM_TEMP.

  17. Run sp_iqmpxvalidate on the coordinator. It should report no error detected.

If the purpose of the restore is to restore an exact copy of the multiplex to a different location, and if copies of all of the server's temporary files exist at the new location, you may replace steps 9 through 17 with the following step 9:

9 Alter the server name, host, port and database path of each server using the ALTER MULTIPLEX SERVER command.