The copy-pastes and explanations blog for SQL code, errors and daily cases! This blog is a 'list' of actions that always good to have available. The copy-paste concept here is short and clear explanations and descriptions (no long stories!) and - of course - the code to take (copy) and use (paste). The blog deals in the database (mostly) and software issues.
Labels
SAP RS - Sybase SSL error: Open Server error: Error: 16029, State: 0, Severity 20 -- 'Failed to start any network listeners'
SAP ASE - Sybase SSL error: kernel ninit: bind, Address already in use
00:0002:00000:00009:2020/07/21 13:10:26.85 kernel ninit: bind, Address already in use
00:0002:00000:00009:2020/07/21 13:10:26.85 kernel Cannot allocate resources for listener with protocol ssltcp, host asazrlnsap16, port 5000.
Solution:
Delete duplicate definitions for the server with the same port (edit the ini file).
SAP ASE - Sybase SSL error: Configuration parameter 'enable ssl' can not be enabled without license 'ASE_ASM'.
2. Click tile "License keys"
3. Click your current server id, i.e. L16
4. Right bottom click "Edit"
5. The info should already there, so "Continue"
6. In this page search "security"
From my side I see below, but you might have different license number, for an example:
Item Description
7011762 SAP Sybase ASE Enterprise Edition Security & Directo
-> If you can find such "security" license, then click the "Generate" and step by step fill out the system info, to download.
-> If you can NOT find such license, call SAP hotline(560499) for help, ask them to help involve the SAP sales for license purchase.
7. Put the downloaded license in folder:
/sybvol01/sap16/SYSAM-2_0/licenses/
8. Restart ASE server.
9. Check ASE error log see if SSL is enabled, if still license error raised please send me back the complete ASE error log.
SSL Configuration - SAP RS (Sybase RS)
- Create an ASE certificate.
- Enable SSL in ASE (if required).
- Edit the interfaces/sql.ini file - add SSL definition.
- Enable SSL in RS.
- Restart RS.
The certificates for the ASE on the server can be used also by the RS on this server.
cd /sybvol01/sap16/OCS-16_0/bin/
cat ASAZRLNSAP16.public ASAZRLNSAP16.key > /sybvol01/sap16rs/REP-16_0/certificates/ASAZRLNSAP16.crt
File created: /sybvol01/sap16rs/REP-16_0/certificates/ASAZRLNSAP16.crt
cp root.crt /sybvol01/sap16rs/REP-16_0/certificates/ASAZRLNSAP16.txt
cp ASAZRLNSAP16.csr /sybvol01/sap16rs/REP-16_0/certificates/ASAZRLNSAP16.csr
cp ASAZRLNSAP16.key /sybvol01/sap16rs/REP-16_0/certificates/ASAZRLNSAP16.key
cp ASAZRLNSAP16.public /sybvol01/sap16rs/REP-16_0/certificates/ASAZRLNSAP16.public
cp root.crt /sybvol01/sap16rs/REP-16_0/certificates/root.crt
cp root.csr /sybvol01/sap16rs/REP-16_0/certificates/root.csr
cp root.key /sybvol01/sap16rs/REP-16_0/certificates/root.key
→ if already done for the ASE (step 10) - skip it.
sp_configure "enable ssl", 1
ASAZRLNSAP16
master tcp ether ASAZRLNSAP16 5000 ssl="CN=ASAZRLNSAP16"
query tcp ether ASAZRLNSAP16 5000 ssl="CN=ASAZRLNSAP16"
RSFOG2
master tcp ether ASAZRLNSAP16 11753 ssl="CN=ASAZRLNSAP16"
query tcp ether ASAZRLNSAP16 11753 ssl="CN=ASAZRLNSAP16"
use sybsystemprocs
go
grant execute on sp_serverinfo to public
go
1> configure replication server set use_ssl to 'on'
2> go
Config parameter 'use_ssl' is modified. This change will not take effect until the Replication Server is restarted.
Stop RS:
1> shutdown
2> go
Start RS:
cd /sybvol01/sap16rs/REP-16_0/install/
startserver -f RUN_RSFOG2
- Windows: stop and start the service in Services.
2> go
1> select * from rs_config where optionname like "%ssl%"
2> go
optionname objid charvalue status comments
------------------------------ ------------------ -------------
ssl_protocol 0x0000000000000000 TLSv1 0 Indicated the SSL protocol value of Replication Server.
use_ssl 0x0000000000000000 on
should be:
1. ssl_protocol is not null
2. ssl_protocol is on
2> go
------------------------------
TLS_RSA_WITH_AES_256_CBC_SHA
SSL Configuration - SAP ASE (Sybase)
- Create an ASE certificate.
- Enable SSL in ASE.
- Edit the interfaces/sql.ini file - add SSL definition.
- Restart ASE.
- Copy the certificate files to C:\SAP\ini in the client.
- Edit sql.ini / interface file - add SSL definition.
- Restart ASE
The process based on https://launchpad.support.sap.com/#/notes/0001899365
openssl genrsa -passout pass:dba4ever -out root.key 4096
output:
Generating RSA private key, 4096 bit long modulus (2 primes)
.............................................................................++++
.................................++++
e is 65537 (0x010001)
File created: root.key
openssl req -new -key root.key -passin pass:dba4ever -out root.csr -subj "/C=XX/ST=XX/L=city/O=Org/CN=root"
File created root.csr
openssl x509 -req -days 3650 -in root.csr -signkey root.key -passin pass:dba4ever -out root.crt
output:
Signature ok
subject=C = XX, ST = XX, L = city, O = Org, CN = root
Getting Private key
openssl genrsa -des3 -passout pass:dba4ever -out ASAZRLNSAP16.key 2048
File created: ASAZRLNSAP16.key
openssl req -new -key ASAZRLNSAP16.key -passin pass:dba4ever -out ASAZRLNSAP16.csr -subj "/C=XX/ST=XX/L=city/O=Orig/CN=ASAZRLNSAP16"
File created: ASAZRLNSAP16.csr
openssl x509 -req -days 3650 -in ASAZRLNSAP16.csr -CA root.crt -CAkey root.key -passin pass:dba4ever -set_serial 1 -out ASAZRLNSAP16.public
output:
Signature ok
subject=C = XX, ST = XX, L = city, O = Orig, CN = ASAZRLNSAP16
Getting CA Private Key
File created: ASAZRLNSAP16.public
cat ASAZRLNSAP16.public ASAZRLNSAP16.key > $SYBASE/$SYBASE_ASE/certificates/ASAZRLNSAP16.crt
File created: ASAZRLNSAP16.crt
This is the root public certificate created in step 3. This is for all client side connections.
File created:
$SYBASE/$SYBASE_ASE/certificates/ASAZRLNSAP16.txt
$SYBASE/config/trusted.txt
-----BEGIN CERTIFICATE-----
MIIFEzCCAvsCFCi6ELH5OlZt96P56Zkz3r+DUeWJMA0GCSqGSIb3DQEBCwUAMEYx
CzAJBgNVBAYTAlhYMQswCQYDVQQIDAJYWDENMAsGA1UEBwwEY2l0eTEMMAoGA1UE
CgwDT3JnMQ0wCwYDVQQDDARyb290MB4XDTIwMDYxNjE0NTEwNFoXDTMwMDYxNDE0
NTEwNFowRjELMAkGA1UEBhMCWFgxCzAJBgNVBAgMAlhYMQ0wCwYDVQQHDARjaXR5
MQwwCgYDVQQKDANPcmcxDTALBgNVBAMMBHJvb3QwggIiMA0GCSqGSIb3DQEBAQUA
A4ICDwAwggIKAoICAQDD7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1
jjdGnZGsQSGMoPKfxpNq8sZUyhzEroJHpV7OxLikvpRSz/IUhLpyNWoHVKaAehkJ
Iwc9pDja4Fz2ArO5l5g7P60rwq2cCTS0zKXrRqaPGm11WIX6ovCpobOZwBDvRGiv
6KiTF2y5Ib9xL+9Q6E8R0kPWOsPzOLaeyN5pz4IHLbRPppCIAurWxD4bozJ5CWVP
W9l+LF3IIxoLLtK2+8lxHiqMiV9o9PJTBd0I83YjPJ+QrB6ARMIg2fJWAaVQH8CN
Mdlw0aVwiVo9X06Lb6FW4AC9a2b5iBVF+ncUPeVIZYyrHNmoA65sEy/hb2rwdS+w
FoueokT6Zg==
-----END CERTIFICATE-----
2. Enable SSL in ASE
sp_configure "enable ssl", 1;
Note: Use fully qualified path
interfaces (Unix)
-------------
ASEname
master tcp ether myhost myport ssl
query tcp ether myhost myport ssl
sql.ini (Windows)
-------
[ASEname]
master=tcp,myhost,myport,ssl
query=tcp,myhost,myport,ssl
for example:
ASAZRLNSAP16
master tcp ether asazrlnsap16 5000 ssl="CN=ASAZRLNSAP16"
query tcp ether asazrlnsap16 5000 ssl="CN=ASAZRLNSAP16"
16.0:
kernel Common Crypto Library SSL symbols loaded.
kernel Common Crypto Library SSL startup succeeded.
...
kernel network name host, interface IPv4, address ipaddress, type ssltcp, port port, filter ssl
15.7:
kernel Certificate load from file `$SYBASE/$SYBASE_ASE/certificates/ASEname.crt`: succeeded.
kernel Trusted root certificates loaded from file '$SYBASE/$SYBASE_ASE/certificates/ASEname.txt': succeeded.
For all versions:
kernel network name host, interface IPv4, address ipaddress, type ssltcp, port port, filter ssl
1> sp_ssladmin lscert
2> go
certificate_path
---------------------------------------------------------
/sybvol01/sap16/ASE-16_0/certificates/ASAZRLNSAP16.crt
1> select @@ssl_ciphersuite
2> go
----------------------------------
TLS_RSA_WITH_AES_256_CBC_SHA
On the clients:
SAP ASE (sybase) historical monitoring tables
Adaptive Server maintains context information for each client connection that accesses the historical tables, and on each successive query on the table returns only rows that the client has not previously received (read here).
The historical monitoring tables are:
- monErrorLog
- monDeadLock
- monSysStatement
- note: When executing a procedure from a procedure, monSysStatement return a record both to the two procedures.
- monSysSQLText
- monSysPlanText
The maximum number of statement statistics returned can be tuned with statement pipe max messages.
The historical monitoring tables require the enable monitoring, statement statistics active, per object statistics active, statement pipe max messages, and statement pipe active configuration parameters to be enabled.
Filter the result set with a where clause filters from the "statement pipe max messages" number.
SAP RS - The transaction log in database RSSD is almost full
Error when trying to start SAP Replication Server.
E. 2020/12/14 21:39:52. ERROR #11061 GLOBAL RS(GLOBAL RS) - generic\sts\stscol.c(2631)
I. 2020/12/14 21:39:52. Message from server: Message: 7415, State 1, Severity 10 -- 'The transaction log in database RS1_RSSD is almost full. Your transaction is being suspended until space is made available in the log.
Reason:
Cause of the error: The transaction lof of the RSSD database is (almost) full.
SAP RS - Create a new Replication
Before declaring a Replication
We should have:
- Primary database and Replicate database/s.
- Instances were set in sql.ini.
- RSSD database.
Create a primary database
Create a replicate database
Create a replicated table
- The replicated table must have a primary key!
Create connections to the primary and replicated server
Add a database to the replication system


In windows:
Replication Server Information

Ctrl-a Accept and Continue
In windows:
Database Information
Add the primary database


For the primary database: set "5. Will the database be replicated" to "yes".
Ctrl-a Accept and Continue

Change RS user to sa.
Ctrl-a Accept and Continue
Execute the Replication Server tasks now? yRunning task: check the SQL Server.Task succeeded: check the SQL Server.Running task: verify users and their passwords.Verified that 'sa' can log into Replication Server 'RSFOG2'.Verified that 'sa' can log into Replication Server 'RSFOG2'.Task succeeded: verify users and their passwords.Running task: check the database.Verified that database 'RepL16TestPrimary' exists.Verified that SQL Server 'SERVERNAME' supports replication.Added maintenance user login 'RepL16TestPrimary_maint' to database 'RepL16TestPrimary'.Verified that maintenance user 'RepL16TestPrimary_maint' can log into SQL Server 'SERVERNAME'.Task succeeded: check the database.Running task: configure database for primary data.Loading script 'rs_install_primary.sql' into database 'RepL16TestPrimary'......DoneLoaded script 'rs_install_primary.sql' successfully.DoneGranting 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 userTask succeeded: configure database for primary data.Running task: configure the Replication Agent.Task succeeded: configure the Replication Agent.Running task: set connection to the database.Adding database 'RepL16TestPrimary' to the replication system.Successfully executed 'create connection'. Database 'RepL16TestPrimary' is nowmanaged by Replication Server 'RSFOG2'.Task succeeded: set connection to the database.Running task: start the Replication Agent.Task succeeded: start the Replication Agent.Configuration completed successfully.Press <return> to continue.
Add a replicate database
Do the same as for the primary database, with the following changes:
- For the replicate databases: set "5. Will the database be replicated" to "no".
- "Database Replication Agent" definition is not required.
Ctrl-a Accept and Continue, Approve to run the task.
Execute the Replication Server tasks now? yRunning task: check the SQL Server.Task succeeded: check the SQL Server.Running task: verify users and their passwords.Verified that 'sa' can log into Replication Server 'RSFOG2'.Task succeeded: verify users and their passwords.Running task: check the database.Verified that database 'RepL16TestReplicate' exists.Added maintenance user login 'RepL16TestReplicate_maint' to database 'RepL16TestReplicate'.Verified that maintenance user 'RepL16TestReplicate_maint' can log into SQL Server 'SERVERNAME'.Task succeeded: check the database.Running task: configure database for replicate data.Loading script 'rs_install_replicate.sql' into database 'RepL16TestReplicate'....DoneLoaded script 'rs_install_replicate.sql' successfully.DoneGranting permissions on the lastcommit functions.Granted maintenance user permissions on the lastcommit functions.Granted replication role to maintenance userTask succeeded: configure database for replicate data.Running task: set connection to the database.Adding database 'RepL16TestReplicate' to the replication system.Successfully executed 'create connection'. Database 'RepL16TestReplicate' is now managed by Replication Server 'RSFOG2'.Task succeeded: set connection to the database.Configuration completed successfully.Press <return> to continue.
In windows:
Create replication definition, publication and subscription
Create a replication definition
Create a publication
Create a subscription
Validation and checks for the connections and the definitions
- rs_helpdb can also be good: exec rs_helpdb.
Add database and table to replication
Grant permissions to maint user on replicated DB
Activate Rep Agent
View information about all definitions and declarations
In the primary database:
In the Replication Server:
In RSSD:
Check the replication
- Insert data to the primary table.
- Check if it was replicated in the replicate database.
SAP (sybase) ASE - The maximum number of configured devices has been reached
The case:
Creation of a new device.
Error message:
The maximum number <X> of configured devices has already been reached. Please reconfigure 'number of devices' to a larger value and retry disk initialization.
1> disk init name="DdeviceNameLog", physname="/sybvol01/sap16/data/DdeviceNameLog1.dat", size="100M"
2> go
Msg 5162, Level 16, State 1:
Server 'SRSSERVER', Line 1:
The maximum number 20 of configured devices has already been reached. Please reconfigure 'number of devices' to a larger value and retry disk initialization.
Solution:
sp_configure 'number of devices', 30
go