Overview and Solutions of database creation based on the database name of multiple branches in the Database Data Summary

Source: Internet
Author: User

In the LAN, the main store summarizes the branch sales and other information by establishing a backup database for the Branch database in the general store database, and then collecting the required information in the database of the branch to be counted.

This tells us that the database name of each branch is unique and clear, otherwise the statistics will be inaccurate. The database name of each branch is recorded in the t_shop table.

However, when the backup file is transferred from the branch to the master store, its name can be changed. As a result, the program cannot directly determine the Database Name of the branch and create a database based on the name.

The solution is as follows:

Solution 1: Increase investment in backup and restoration of databases.

On the one hand, the store can clearly tell the store the name of the backup file when it transfers the database backup file; on the other hand, the store requires the total effort. Each time a database backup file of a branch is received, it is named as the unique database name corresponding to the branch.

Solution 2: increase programming intensity. Regardless of the name of the database backup file passed by the store, it is restored to the database under the corresponding database name of the store. This solution has two routes.

First, use the backup file to read the corresponding data name of the file, and then create a backup database by name;

The second is to indirectly read the corresponding database name of the file. The backup file is used to create a temporary database temp in the master store database. Then, restore the backup file to the temp database. Then you can operate the data table t_shop, read the Database Name of the branch, and use the name to create a backup database for the Branch database of the master store.

Now the problem and solution are cleared up. All things should end with discussion, thinking, and sorting.

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.