The solution to the garbled problem of Sybase database

Source: Internet
Author: User
Tags character set sybase sybase database

Build test database server, encountered a garbled problem, has not encountered before because the development of the database server is already installed and set up the character set, so some problems in the deployment test environment only appear when the database has been configured, and all the initialization scripts have been completed, The project has also been successfully deployed on WebLogic, open IE, run the program, but found all read from the database are garbled, after the relevant information on the Internet search, need to set the character set, but just started to find the information is basically a speech, not a systematic explanation of how to set character sets, Almost all of their methods have been tried, the result is not done, even the console and the SQL platform are garbled, really do not understand, went to ask Gao, he sent me a special interpretation of the character set of the document, said a very comprehensive, and through his help finally will solve the garbled problem.

Let me summarize the process of setting up the character set:

1, after the installation of Sybase, if you want to set the character set to CP936, you must first install the character set, because the Sybase default character set table does not have the character set, the installation steps are as follows: (here Sybase's installation path is c:\sybase)

1.c:\>;cd \sybase\charsets\cp936
2.c:\sybase\charsets\cp936>;
charset -Usa -Psa_pass -Sserver_name binary.srt cp936

The CP936 character set is successfully installed in Sybase's system character set table with the above command, but the Sybase service must be restarted two times to see the results, and you can view the success of the installation by looking at the Syscharsets table in the master database. We can see that it has been installed successfully: 1002,171,0,1, ' cp936 ', ' CP936 ' (Simplified Chinese).

2. See CP936 number 171, we need to set the system character set to this ID in Sybase's properties, as shown in the following figure:

If you end up with an error setting the character set, because the table space of the master database is allocated only hundreds of k space by default, there is not enough space after importing new data, so you need to set a larger table space for the master database, click on the properties of the master database, select the tab page of the table space, You can resolve the problem by reallocating the original table space edits to the size and allocating all of the table spaces in master.

3, set a good character set, you can execute the initialization script. There are a few minor episodes, because the second step of the table space error is not a document in the description, so I and Guo Liying at all do not know, all think Sybase was we broke up, no way can only reinstall, but after installation still have the problem, Then please high man to help us to see just know is the problem of table space, there is even though set a good character set, open IE or garbled, do not know why, and then rerun the script after the No, because the default character set for Cp850, Therefore, the script executed in this character set and then to the CP936 environment reading will be garbled, so in the CP936 environment to execute the script again no problem.

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.