PROBLEM:
using a Sybase ASE 11.5.1. and whenever I try to start the backup server I get the following messages :
Dec 28 11:26:55 2004: Open Server Error: 16240.10.0: Net-Library routine
net_listen() failed in srv__start_net
Network error: status = 23 - Net-Lib protocol driver call to register a
listener failed..
Dec 28 11:26:55 2004: Open Server Server Fatal Error: 16029.20.0: Failed
to start any network listeners
SOLUTION:
this may be relevant or not, but try doing a netstat on the machine and
see if some other process is utilizing your backup server's port.
netstat -an | more
PROBLEM:
after restoring a database unable to retrieve data from database or login to that database using database user.
SOLUTION:
Drop that database user and recreate that user name under the existing group name.
PROBLEM:
unable 2 start sybase DB server after installing
SOLUTION:
increase shared memory value in system file /etc/system with root permission.
4. CAUSES OF ERROR WHILE REPLICATION
1. There may not be insert/update permission to user maint_user in TARGETDB database at DESTINATIONSERVER dataserver for target tables
a. So grant all permission to maint_user on all objects at destination DB
2. There may not be select permission to user rep_user in SOURCEDB database at SOURCESERVER dataserver for source tables
a. So grant select on all_reptables to rep_user
3. Permission may be denied to rs_update_lastcommit procedure in destination DB to user maint_user
a. So grant permission to execute all rs procedures in TARGETDB to user maint_user.
4. after all those above steps do, following steps
a. at Source SOURCEDB at SOURCESERVER
i. sp_stop_rep_agent
ii. sp_configure �rep agent threads�
iii. sp_config_rep_agent SOURCEDB,�enable�, REPSERVER, rep_user, password
iv. sp_start_rep_agent SOURCEDB
b. at REPSERVER
i. resume connection to
TARGETSERVER.TARGETDB
PROBLEM:
DSI THREAD to destination database is suspended
SOLUTION:
1. Check REP_SERVER log file. Error could
You may need to give insert/delete/update permission to maint_user orREP_SERVER log gives you the complete information about the error.
Primary key violation may be there in destination table or
Destination table structure may be different from source table structure or ....
Log into to REP_SERVER as user 'sa' and give command2. If you want immediate solution and can skip pervious transaction
resume connection to DestServer.destDB
admin who -> to know the status of DSI Thread now. Now it sud b active.
And data in source db n dest db sud also be same at this time.
resume connection to DestServer.DestDB skip transaction
PROBLEM:
Following error occurs when creating replication definition
Msg 2057, Level 12, State 0:
Server 'REP_SERVER':
Line 6, character 2: Incorrect syntax with the keyword 'Action'.
PROBLEM:
When I executed this command -- 'dump transaction db_name with
truncate_only', I got the following error:
Msg 692, Level 20, State 1:How can I fix it? The log file cannot be freed now.
Server LCLSB00D, Line 1:
Uninitialized logical page '542719' was read while accessing object '8' in database '22'. Please contact Sybase Technical Support.
SOLUTION:
You can run dbcc tablealloc on syslogs. If this runs cleanly, then the problem
is probably that the database thinks it is being replicated and the LTM truncation point
is set to an invalid page. If so, you can disable it with "dbcc settrunc(ltm, ignore)".
If this confirms the error, it is difficult to recover from, and you will probably have to
restore from your backups. However, as the message indicates, contact tech support to
discuss options.
PROBLEM:
-----Original Message-----
From: Kamran Mushtaq/ACP via sybase-l
Sent: Saturday, May 20, 2006 9:35 AM
To: Rudi Leibbrandt
Subject: [sybase-l] how to use Sybase sp_audit and see a result
Hi,
I want to observe changes in data (Sybase database). as a result i have to use Sybase audit option.
anyone can help me how to use it (full cycle)
Kamran
RE: how to use Sybase sp_audit and see a result
Posted by Rudi Leibbrandt on 5/22/2006 4:06:00 AM
Hi
There are quite a few options: You can set up Sybase auditing (all steps are in the administrators guide), which will allow you to pick the items you need audited, and will store the audit information in your sybsecurity database.
There is also a new solution, called Sybase Data Auditing, that uses the same internal mechanisms (sybsecurity, etc), but provides you with a report server with pre-configured reports set up, allowing you to report on DDL and DML changes.
Personally, I would go for the second option, because writing your own reports on sybsecurity is painful, and the Data Auditing solution has built in alerts and notifications that alert the compliance officer (or whoever has that role) of things which should not happen on the database (eg, dba recreates a table that he shouldn't)
With the normal built-in auditing, you have to (as I alluded to earlier) create your own audit reports, and built your own monitors and alerts, which definitely has a lower start up cost, but will end up needing to be maintained.
Also, you would probably want these reports to go to the business on a regular basis, so you're going to need a reporting tool (like Infomaker or Business Objects) to make this look "auditable"
Rudi
Ref: http://database.ittoolbox.com/groups/technical-functional/sybase-l/how-to-use-sybase-sp_audit-and-see-a-result-1026151
PROBLEM:
00:00000:00012:2006/06/30 12:16:45.17 server Started Rep Agent on database, 'cp2db' (dbid = 4).
00:00000:00012:2006/06/30 12:16:45.52 server RepAgent(4): Received the following error message from the Replication Server: Msg 37024. CONNECT SOURCE permission is required to execute command..
00:00000:00012:2006/06/30 12:16:45.52 server Error: 9261, Severity: 20, State: 0
00:00000:00012:2006/06/30 12:16:45.52 server RepAgent(4): This Rep Agent Thread is aborting due to an unrecoverable communications or Replication Server error.
00:00000:00012:2006/06/30 12:16:45.52 server Rep Agent Thread for database 'sourcedb' (dbid = 4) terminated abnormally with error. (major 92, minor 61)
SOLUTION:
:
login into replication server and grant permission to repliation agent user
ie grant connect source to rep_user
PROBLEM:
00:00000:00012:2006/06/30 12:19:01.14 server Started Rep Agent on database, 'cp2db' (dbid = 4).
00:00000:00012:2006/06/30 12:19:01.23 server RepAgent(4): Received the following error message from the Replication Server: Msg 14025. Replication Agent for 'SOURCESERVER.sourcedb' is not configured to connect..
00:00000:00012:2006/06/30 12:19:01.23 server Error: 9261, Severity: 20, State: 0
00:00000:00012:2006/06/30 12:19:01.23 server RepAgent(4): This Rep Agent Thread is aborting due to an unrecoverable communications or Replication Server error.
00:00000:00012:2006/06/30 12:19:01.23 server Rep Agent Thread for database 'sourcedb' (dbid = 4) terminated abnormally with error. (major 92, minor 61)
SOLUTION:
:
Login into replication server and enable log transfer to source database
alter connection to SOURCESERVER.sourcedb set log transfer on
PROBLEM:
The context allocation routine failed when it tried to load localization files!!
One or more following problems may caused the failure
Your sybase home directory is /dlrl/sybase. Check the environment variable SYBASE if it is not the one you want!
Using locale name "en_US.ISO8859-1" defined in environment variable LANG
Locale name "en_US.ISO8859-1" doesn't exist in your /dlrl/sybase/locales/locales.dat file
DBH: cs_ctx_alloc() failed
open conection Failed
SOLUTION:
set LANG=C
export LANG
PROBLEM:
when u create rep def, it gives errror, saying 'log transfer for SOURCESERVER.sourcedb is not On. so cannot create rep def.
SOLUTION:
login into to repserver
and alter connection to SOURCE set log transfer on
PROBLEM:
When you add a database which will be replicated ie source database to replication server using rs_init utility, you will get information about status.... like below. And if you get a error like replication agent cannot be configured because it is already configured, then the database wont be added to replication system. to avaoid this soln is given below
..............
Loaded script 'rs_install_primary.sql' successfully.
Granting permissions on the lastcommit functions and rs_marker.
Granting permissions on the lastcommit functions.
Granted maintenance user permissions on the lastcommit functions and rs_marker.
Granted replication role to maintenance user
Task succeeded: configure database for primary data.
Running task: configure the Replication Agent.
SQL Server message: msg 18382, level 16, state 1
INTERNAL ERROR: "Database 'cp2db' is already configured to use Replication
Agent. Request to enable Replication Agent has been ignored."
Press
SOLUTION:
to avoid this problem, login into the dataserver and do gives commands
use sourceDB
now replication agent configuration is removed. Now run rs_init tool and add the database.
go
exec sp_rep_agent_config "sourceDB", disable.
go
Dealing with a Corrupted Database
Hardware failures can result in databases that are corrupt and will not open
upon restart of the server. In some cases the database is marked suspect, and
then cannot be opened.
The best way to deal with a database in this state is to
nuke it and reload it from a backup. Here's a code snippet which will
force the drop to occur, when drop database fails.
SOLUTION:
/* note: X=the dbid of the database (from sysdatabases) */
use master
go
sp_configure "allow updates",1
go
begin tran
go
update sysdatabases set status = 320 where dbid = X
go
/* always make sure the status has been changed to 320 */
select dbid, status from sysdatabases where dbid = X
go
commit tran
go
sp_configure 'allow updates', 0
go
checkpoint
go
/* recycle the server */
dbcc dbrepair (database_name, dropdb)
go
/* now, recycle the server and rebuild the database */
Dealing with a Server Failure
There are rare instances when the server crashes down so hard that it cannot
be started again. In the synopsis that follows, the crash was due to extremely
high database activity after the transaction log filled up - making it impossbile to clear. The server was brought down, and could not be restarted. The trick here was to bring up the server in "non-recovery" mode, and then clear the transaction log using some tricks from the Sybase support team.
/* Note: dbname = the database name, X = the dbid */
/* In the runserver file, add the following flags: */
-m
-T3608 (recover master and nothing else)
-or-
-T3607 (no recovery)
/* Now, recycle the server */
Then, in isql:
sp_configure 'allow updates',1
go
update sysdatabases set status=-32768
where name = 'dbname'
go
select config_admin(1,102,1,0,null,null)
go
update sysdatabases set status=0 where dbid=X
go
/* recycle again, things should be OK */
Dealing with transactions
sp_transactions
dbcc complete_xact("xact_id","rollback|commit")
dbcc complete_xact("xact_id","rollback|commit", "1pc")
dbcc forget_xact("xact_id")
PROBLEM:
ERROR
ct_fetch(): user api layer: internal common library error: The bind of result set item 1 resulted in an overflow.
SOLUTION:
ie The value of a selected column size is bigger than the local/host variable. Make sure that both are on same data type and same size
Ex
>DECLARE CS_SMALLINT :EMPID
> SELECT EmpId into :EMPID FROM EMP WHERE ....
Say here EMP.EmpId is integer. So assigning INT to SMALLINT leads to overflow error.
msgnumber = 17039695;
msgstring = "ct_fetch(): user api layer: internal common library
error: The bind of result set item 5 resulted in an overflow.";
osnumber = 0;
severity = 1;
sqlstate = <32323030 33>;
status = 6;
PROBLEM:
ERROR
1> sp_start_rep_agent DB_Name1
2> go
Msg 9215, Level 16, State 0:
Server 'DB_Server1', Procedure 'sp_start_rep_agent', Line 182:
RepAgent(9): The Secondary Truncation Point is not valid. Please make sure that the Secondary Truncation Point is valid, and then restart the Rep Agent Thread for this database.
Msg 18421, Level 16, State 1:
Server 'DB_Server1', Procedure 'sp_start_rep_agent', Line 187:
Failed to start the Replication Agent thread for database 'DB_Name1'.
(return status = 1)
SOLUTION:
1> use DB_Name1
2> go
1> dbcc settrunc(ltm,ignore)
2> go
secondary trunc page secondary trunc state dbrepstat generation id database id database name ltl version
-------------------- --------------------- --------- ------------- ----------- ------------------------------ -----------
72564 0 166 0 9 DB_Name1 720
1> sp_stop_rep_agent DB_Name1
2> go
Msg 18422, Level 16, State 1:
Server 'DB_Server1', Procedure 'sp_stop_rep_agent', Line 171:
The Replication Agent thread for database 'DB_Name1' is not currently running.
(return status = 1)
1> dump tran DB_Name1 with truncate_only
2> go
1> dbcc settrunc(ltm,valid)
2> go
secondary trunc page secondary trunc state dbrepstat generation id database id database name ltl version
-------------------- --------------------- --------- ------------- ----------- ------------------------------ -----------
73000 1 167 0 9 DB_Name1 720
1>
1> use RSSD
2> go
1> rs_zeroltm DB_Server1, DB_Name1
2> go
Locater has been reset to zero.
(return status = 0)
1> use DB_Name1
2> go
1> sp_start_rep_agent DB_Name1
2> go
Replication Agent thread is started for database 'DB_Name1'.
(return status = 0)
Ref: http://www.dbforums.com/sybase/1643498-remove-secondary-truncation-point.html
Last updated on: 24 Nov 2011