DBASK-数据库管理员结构化知识体系-Structured knowledge system for DataBase Administrators

Home

Error: 3475, Severity: 21, State: 7




错误描述

There are times when error 3475 is reported. The error can mean that the free space accounting is off:

Error: 3475, Severity: 21, State: 7
There is no space available in SYSLOGS to log a record for which space has been reserved in database 'dbname' (id 35). This process will retry at intervals of one minute.
ERROR: Can't get a new log page in db 35. num_left=4 num_in_plc=4.
Rebuilt syslogs gam for dbid 35
ERROR: Can't get a new log page in db 35. num_left=4 num_in_plc=4.

问题处理

Running DBCC GAM with CHECK option will indicate the mismatched GAM bits. Running DBCC GAM with FIX option will correct them:

dbcc gam(database,0,0,'check')
go

dbcc gam (dbname, 0,0,'fix')
go

Tempdb filled up and did not release used space




错误描述

Error 1105 is reported in the ASE errorlog:
 
Error: 1105, Severity: 17, State: 12
Can't allocate space for object 'syslogs' in database 'tempdb' because 'logsegment' segment is full/has no free extents. If you ran out of space in syslogs, dump the transaction log. Otherwise, use ALTER DATABASE to increase the size of the segment.
Space available in segment 'logsegment' has fallen critically low in database 'tempdb'. All future modifications to this database will be suspended until the transaction log is successfully dumped and space becomes available.

故障处理

Fix the existing space utilization issue:
If this a user database, use REORG to reclaim space (logically deleted index pages) in the database.
If this a temporary database and ASE cannot be rebooted, use REORG to reclaim space (logically deleted index pages) in the database.
If this a temporary database and ASE can be rebooted, reboot ASE to rebuild the temporary database.

recover a user database after Error 1105 3475




错误描述

How to recover a user database when Error 1105 followed by Error 3475 was reported in the ASE errorlog?
From ASE errorlog you can see some messages like:
Space available in the log segment has fallen critically low in database 'database_name'. All future modifications to this database will be suspended until the log is successfully dumped and space becomes available.
...
Error: 1105, Severity: 17, State: 4
Can't allocate space for object 'syslogs' in database 'database_name' because 'logsegment' segment is full/has no free extents. If you ran out of space in syslogs, dump the transaction log. Otherwise, use ALTER DATABASE to increase the size of the segment.
...
Error: 3475, Severity: 21, State: 7
There is no space available in SYSLOGS to log a record for which space has been reserved in database 'database_name' (id x). This process will retry at intervals of one minute.

问题处理

use master
go
 
Get the status value for the impacted database and save if for future use:

select status from master..sysdatabases where name = 'impacted_dbname'
go
 
Set the status to allow the changes to system tables:
 
sp_configure 'allow updates to system tables', 1
go
 
Set the database status to "bypass recovery":
 
begin tran
update sysdatabases set status = -32768 where name = 'impacted_dbname'
commit tran
go

Issue a checkpoint command on the master database.

Shutdown ASE with nowait.

Start ASE.

After the ASE comes back check for the status of the impacted database. It should be -32768.

Log on to ASE where the impacted database resides:

use master
go
 
Extend the impacted database's log segment:
 
alter database suspected_dbname log on new_log_device = '1G' -- change 1G to needed value
go
 
Update sysdatabases and set status back to the old value saved in Step 2 above:
 
begin tran
update sysdatabases set status = original_value where name = ' impacted_dbname' 
commit tran
go

Log segment contains misplaced data extents




错误描述

The log segment in database 'DB_name' contains x misplaced data extents of which y of them do not belong to any object.

问题处理

dbcc traceon(3604)
go
use master
go
sp_dboption your_db, "single", "true"
go
checkpoint your_db
go
dbcc findstranded("your_db")
go
dbcc dbrepair(dbname,remap)
go

check/correct database free space accounting




问题描述

How to check database free space accounting
How to correct database free space accounting

方案

Dbcc usedextents will correct any miscalculated free space.

use master
go
sp_dboption database, "single user", true
go
dbcc traceon(3604)
go
dbcc usedextents(dbid, 0,1,1)  
go
dbcc traceoff(3604)
go
sp_dboption database, "single user", false
go

Error 17379 when trying to configure cache for tempdb




错误描述

sp_poolconfig tempdb_02_cache, '500.0M', '16K', '8K'
Server 信息: Number 17379, Severity 16
Server 'servername', Procedure 'sp_do_poolconfig', Line 813:
You cannot configure data caches and NV caches in the system temporary database.

问题处理

Not in master database when trying to configure the tempdb cache.

use master
go
sp_cacheconfig 'tempdb_cache', '100M'
go

使用跟踪标志启动 ASE




问题描述

SAP ASE 有许多跟踪标志。使用跟踪标志的主要原因包括:

· 更改或恢复 ASE 行为

· 用于故障排除和更正(严重)错误

· 启用其它诊断功能

某些跟踪标志仅在启动时启用时有效,因此必须将这些标志添加到 RUN 文件中。其他许多可以在运行时激活。但是,如果需要在重新启动时使用,即使在短时间内也是如此,则在启动时添加这些内容最容易,因此无需在每次重新启动后手动将其打开。

解决方案

dataserver (Unix) 和 sqlsrvr.exe (Windows) 可执行文件都使用 -T 开关在启动时启用跟踪标志。

为每个需要激活的跟踪标志使用一个 -T 开关。

可设置多个 -T 开关

跟踪标志被添加到 RUN_ASEname 文件中,其中 ASEname 是 ASE 的服务器名

缺省情况下,RUN 文件在这些位置(并显示示例文件名)中找到:

Unix        $SYBASE/$SYBASE_ASE/install -         RUN_ASE_LINUX
Windows %SYBASE%/%SYBASE_ASE%/install - RUN_ASE_WINDOWS.bat

对于仅短期使用跟踪标志(通常仅用于一个或几个启动)的情况,最佳实践是将原始 RUN_server 文件复制到名称明确表示 ASE 将使用跟踪标志的新文件中

这样可避免意外留下跟踪标志并可能影响生产 ASE 的情况

编辑此新文件,而不是原始(常规)RUN 文件。例如:

cp RUN_ASE_LINUX RUN_ASE_LINUX_TRACEFLAGS_ON

在 Unix 上向 RUN_server 文件添加跟踪标志

Unix 上的典型 RUN_server 文件包含如下启动行: 
/sybase/ASE-16_0/bin/dataserver \
-d/sybase/data/master.dat \
-e/sybase/ASE-16_0/install/ASE_LINUX.log \
-c/sybase/ASE-16_0/ASE_LINUX.cfg \
-M/sybase/ASE-16_0 \
-sASE_LINUX 

在 dataserver 和 -d master device 行之间添加一个或多个 -T 开关,而不是在参数列表的末尾添加。

这样可避免因行继续标记出错而导致跟踪标志最终无法激活的问题。

如果在 -d master device 参数之前行继续存在问题, 将导致服务器无法启动,因此明显存在问题

每行末尾的反斜线字符是连续字符,这意味着参数列表在下一行继续。

反斜杠必须是行的最后一个字符,不要在反斜杠后面键入空格或任何其他空格字符。

当参数列表末尾的 -T 开关出现问题时,可能意味着服务器在不激活跟踪标志的情况下启动,并且不会通知用户

新增跟踪标志的 RUN_ASE_LINUX_TRACEFLAGS_ON 示例:

/sybase/ASE-16_0/bin/dataserver \
-T888 -T999 \
-d/sybase/data/master.dat \
-e/sybase/ASE-16_0/install/ASE_LINUX.log \
-c/sybase/ASE-16_0/ASE_LINUX.cfg \
-M/sybase/ASE-16_0 \
-sASE_LINUX

注释:-T888 和 -T999 不是有效的跟踪标志,用于说明此示例。
 

在 Windows 上向 RUN_server.bat 文件添加跟踪标志

此示例显示如何向 .bat 文件添加跟踪标志,该文件用于手动启动 ASE。

Windows 上的典型 RUN_server.bat 文件包含如下启动行:

"C:\sybase\ASE-16_0\bin\sqlsrvr.exe" -d"C:\sybase\data\master.dat" -sASE_WINDOWS -e"C:\sybase\ASE-16_0\install\ASE_WINDOWS.log" -c"C:\sybase\ASE_WINDOWS.cfg" -i"C:\sybase\ini" -M"C:\sybase\ASE-16_0"

在文本编辑器中,打开 RUN_server.bat 文件并 另存为 RUN_ASE_WINDOWS_TRACEFLAGS_ON.bat

然后在命令末尾向 RUN_ASE_WINDOWS_TRACEFLAGS_ON.bat 填充添加一个或多个跟踪标志:

"C:\sybase\ASE-16_0\bin\sqlsrvr.exe" -d"C:\sybase\data\master.dat" -sASE_WINDOWS -e"C:\sybase\ASE-16_0\install\ASE_WINDOWS.log" -c"C:\sybase\ASE-WINDOWS.cfg" -i"C:\sybase\ini" -M"C:\sybase\16_T888"

注释:-T888 和 -T999 不是有效的跟踪标志,用于说明此示例。 

对于 Unix 和 Windows,通过检查错误日志来验证跟踪标志的激活情况

在启动序列中,现在应该有一行显示在启动时哪些跟踪标志处于活动状态

使用 -T3605 启动 ASE 的错误日志将显示:

服务器活动跟踪标志: 3605

ASE未设置任何跟踪标志的错误日志将显示:

服务器 无活动跟踪标志

ALTER DATABASE throws Error 1820




问题描述

Resized a database device using the 'disk resize' command.
Then running the 'alter database' command to add more space from the device, encountered the following error:

Msg 1820, Level 16, State 1
This command adds log space to disk 'DEVNAME', which previously contained only data. You must specify WITH OVERRIDE to force this allocation.

解决方案

Modifiy the 'alter database 'command to include the LOG ON clause.
The correct command should be:
alter database dbname LOG ON devname = "xxM

Index is marked as suspect after sort order has been changed




问题描述

One of the following messages is returned to the client and/or seen in the ASE error log:

Index id 1 on table id 12345678 cannot be used in the optimization of a query as it is SUSPECT. Please have the SA run DBCC REINDEX on the specified table.
Index id 1 cannot be used to access table id 12345678 as it is SUSPECT. Please have the SA run the DBCC REINDEX command on the specified table.
Table id 12345678 contains suspect indexes. This table is only available for read-only purposes until the DBCC REINDEX command has been run on the indicated table to rebuild its suspect indexes.

解决方案

Run procedure sp_indsuspect to list which indexes need to be rebuild:

use db_name
go
sp_indsuspect
go

Drop and recreate index(es) or run dbcc reindex

dbcc traceon(3604)
go
dbcc reindex(table_name)
go

Cannot reconfigure server to use sort order ID




问题描述

Error 5824 raised when running sp_configure to change 'default character set id'
The character set and sort order IDs can vary.
Msg 5824, Level 16, State 4:
Server 'ASE', Procedure 'sp_configure', Line 1310:
Cannot reconfigure server to use sort order ID 42, because the row for its underlying character set (ID 1) does not exist in syscharsets.

解决方案

sp_helpsort
go
Sort Order Description
------------------------------------------------------------------
Character Set = 2, cp850
Code Page 850 (Multilingual) character set.
Sort Order = 42, nocase_cp850
Case-insensitive dictionary sort order for use with several Western-European languages including ...

sp_configure 'default character set id', 1
go