Server 'DB', Procedure 'sp_changedbowner', Line 97:
The proposed new db owner already is a user in the database or owns the database.
(return status = 1)
上面命令没有成功更改数据库属主,问题出在con应经是该数据库的用户了,所以应该首先在该库中删除con用户 1> sp_dropuser con 2> go
User has been dropped from current database. (return status = 0)
1> sp_changedbowner con 2> go
DBCC execution completed. If DBCC printed error messages, contact a user with System Administrator (SA) role. Database owner changed. (return status = 0) 1> sp_helpdb 2> go
name db_size owner dbid created
status ------------------------ ------------- ------------------------ ------ --------------
------------------------------------------------------------------------------------------------------ master 6.0 MB sa 1 May 08, 2008
mixed log and data model 2.0 MB sa 3 May 08, 2008
mixed log and data sicase 2000.0 MB con 4 May 08, 2008
select into/bulkcopy/pllsort, mixed log and data sybsystemdb 2.0 MB sa 31513 May 08, 2008
mixed log and data sybsystemprocs 120.0 MB sa 31514 May 08, 2008
trunc log on chkpt, mixed log and data tempdb 503.0 MB sa 2 May 08, 2008
select into/bulkcopy/pllsort, trunc log on chkpt, mixed log and data
(1 row affected)
(return status = 0)
解决不能telnet本机5000端口问题
正常运行情况下,应用程序必须能访问5000端口。但是本机的5000端口只有本地才能访问。
[root@db ~]# lsof -i :5000
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME dataserve 21221 sybase 13u IPv4 18952868 TCP db:5000 (LISTEN)
dataserve 21221 sybase 14u IPv4 18998135 TCP db:5000->db:45610 (ESTABLISHED)
isql 29121 sybase 6u IPv4 18998134 TCP db:45610->db:5000 (ESTABLISHED)
该命令显示5000端口已经打开,并且已有本地的访问连接,说明数据库的功能没有问题。
[sybase@db sybase]$ netstat -anv | grep 500*
tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:5001 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:5002 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:50008 0.0.0.0:* LISTEN
请注意上面标红的IP地址,表示服务器只监听127.0.0.1的5000端口,显然不对。 检查/etc/hosts表
root@db etc]# cat /etc/hosts
# Do not remove the following line, or various programs # that require network functionality will fail.
127.0.0.1 db localhost.localdomain localhost 172.16.9.85 app 172.16.9.86 db 172.16.9.245 app-ilo 172.16.9.84 app-srv 172.16.9.246 db-ilo 172.16.9.88 db-srv
# Interconnect RAC (Private Network) 172.16.9.95 app_rac 172.16.9.96 db_rac
172.16.9.18 erp.si-tech.com.cn
将上面标红的行中的db去掉,然后重启sybase数据库。 [root@db etc]# netstat -anv | grep 500*
tcp 0 0 172.16.9.86:5000 0.0.0.0:* LISTEN tcp 0 0 172.16.9.86:5002 0.0.0.0:* LISTEN