How to port a master device

Source: Internet
Author: User
Tags sybase

The following steps demonstrate how to port the master device to a different disk. While executing this task, please refer to SYBASE's related documentation Technical Documents #1324 entitled "Segment Remapping with Load database When Moving a Database ").

Note that you must stop SQL Server applications before executing buildmaster.

The key to success is that the contents of each row in the new sysusages system table are consistent with those in the old sysusages system table.

  1. Perform dbcc checks on the master database and back up the master database.
  2. Run the select * from table_name command and keep the output content. Table_name includes sysdevices, sysusages, and sysdatabases. Similarly, you can use the bcp command.
  3. Execute the sp_configure command and keep the output content.
  4. Copy the $ SYBASE/server_name.cfg file for retention.
  5. Shut down SQL/ASE Server.
  6. Run the following command to create a new master device:
    UNIX: buildmaster-d <master_device>-ssize
    VMS: buildmaster/disk = <master_device>/size = size
    (Size is in the unit of page, 1 page = 2 K)
  7. Edit the RUN_server_name file. The-d (UNIX) or/device (VMS) parameter points to the new setting.
    Backup name.
  8. Start SQL/ASE Server in single-user mode:
    UNIX: startserver-f RUN_sever_name-m
    VMS: startserver/server = server_name/masterrecover
  9. Run the select * from sysdevices command and keep the output content.
  10. Make sure that the contents of each row in the new sysusages system table are consistent with those in the old sysusages system table, and that the system table sysusages is correct if no alter database is performed after the Server is configured. If you have performed alter database, you need to execute these scripts in the original order. If there is no script, you need to find the alter database parameter in the information of the stored sysusages system table.
  11. Shutdown SQL/ASE Server and start the Server in single-user mode to check whether the contents of the sysusages system table are correct.
  12. If the configured Backup Server name is not SYB_BACKUP, run the following command:
    1> sp_configure "allow updates", 1
    2> go
    1> update sysservers set srvnetname = "name in interfaces file"
    Where srvname = "SYB_BACKUP"
    2> go
  13. Load the master database. If the size of the new master device is different from that of the old one, the Server will Shut down. Note that the new system table will be overwritten, and you need to adjust the size of the master device in the Sysdevices system table. Perform the following two steps:
  14. Start the Server in single-user mode.
  15. If the size of the new device is different from that of the old one, run the following command:
    1> sp_configure "allow updates", 1
    2> go
    1> update sysdevices set high = nnnn where name = "master"
    2> go
    The nnnn is the size of the master device in the unit of page 2 K). This value can be found from the information in the reserved sysdevices system table. If the created device is larger than the old one, execute: 1) Create a database that is about the same size as the master device. The purpose of this operation is to reinitialize the allocation page so that the entire master device is available. 2) Delete the database.
  16. Restart the Server.
  17. Backup master database.

Note:

  1. Before loading the master database, make sure that the character set and language module of SQL Server are the same as the character set and language module of the backup master database.
  2. Use sp_helpsort to check whether the character set is the same as that of the language module before and after the task is executed.
(

Related Article

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.