Sybase FAQ (update after a new problem occurs)

Source: Internet
Author: User
Tags sybase database
1.  SYBASE database logs are full
In this case, data can be queried, but data cannot be updated or started. Tracking in the Code shows that the connection can be opened, but the transaction cannot be opened. The error message "connection to Sybase server has been lost. All active transactions have been rollbacked" is usually displayed.
Solution:
If you are developing a database, clear the logs directly. If it is a formal database: We recommend that you back up the current log and then clear the log to expand the Log Device and log database. The log clearing statement is "Dump transaction database_name with no_log 』
2. Sybase Chinese garbled characters
This is because Sybase's server character set does not support Chinese characters or the client character set is inconsistent with the server character set. You can consider changing the default Character Set of Sybase. Supported Chinese character sets in sybase12.5 include cp936, eucgb, UTF-8, and gb18030. Here we provide a solution to the problem that the Sybase server character set does not support Chinese characters:
Solution (install cp936 Character Set):
Assume that the installation path of Sybase is "D: \ sybase ".
(1) D: \> CD \ Sybase \ charsets \ cp936
(2) D: \ Sybase \ charsets \ cp936> charset- USA -Psa_pass-sserver_name binary. srt cp936
(3) Execute "Select name, ID from syscharsets" in interactivesql. Note that you should select to execute the command in the "master" database. Step 4 is also required. Find the id named cp936, which is assumed to be 171.
(4) Execute "sp_configure 'default Character Set id', 171" in interactivesql 』
(5) restart the Sybase service twice. Because it will automatically end after the first start, you need to restart the second time.
3. Export and import the entire Sybase Database
Export: [declare @ filename varchar (30)
Select @ filename = 'e: \ BCP \ BF _ '+ convert (varchar (10), getdate (), 110) +'. dat'
Dump database examsysdb to @ filename
Go]
Import: [load database pubs2
From 'e: \ BCP \ bf_080101.dat ']
4. BCP import and export data
Import to the tb_user table of the examsysdb Database: [BCP examsysdb .. tb_user in c: \ BCP \ sqlserverout \ tb_user.bcp-USA-p-ssydevserver-jcp936-C]
Export the data in the tb_user table of the examsysdb Database: [BCP examsysdb .. tb_user out c: \ BCP \ sqlserverout \ tb_user.bcp-USA-p-ssydevserver-jcp936-C]
For details about batch data import, see SQL [set nocount on
Use examsysdb
Go
Select 'bcp examsysdb... '+ name +' in c: \ BCP \ sqlserverout \'
+ Name + '. BCP-USA-p-sdevserver-jcp936-C'
From sysobjects
Where type = 'U' and name like '% Tb _ %'
Go]
For details about how to export data in batches, see SQL [set nocount on
Use examsysdb
Go
Select 'bcp examsysdb... '+ name + 'out c: \ BCP \ sqlserverout \'
+ Name + '. BCP-USA-pdbadmin-sdevserver-C'
From sysobjects
Where type = 'U' and name like '% Tb _ %'
Go]

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.