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'
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
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

Choose: "1. Replication Server"
Choose: "2. Add a database to the replication system"In windows:

Replication Server Information



Choose: "RS SA password"Ctrl-a Accept and Continue
In windows:
Database Information
Add the primary database
Choose: "2. Database Information"
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) RS - rs_init - Could not connect to ID Server Unable to execute query create connection
The case:
Error when adding a new connection using rs_init:
Could not connect to ID Server Unable to execute query create connection.
Error message:
WARNING: "Could not connect to ID Server 'ID_RS_NAME'."
Press <return> to continue.
SQL Server message: msg 45, level 12, state 0
WARNING: "Could not connect to ID Server 'ID_RS_NAME'."
Press <return> to continue.
Unable to execute query 'create connection to "ASENAME"."DBNAME" s
et error class rs_sqlserver_error_class set function string class rs_sqlserver_
function_class set username "DBNAME_maint" set password *** with log tr
ansfer on' against server 'RS_NAME'.
Press <return> to continue.
Solution:
The ID Server RS is not available:
- The RS service is down - start it.
- Network or connections problems.
- Any other reason
SAP (sybase) RS - Displays connection data for the Replication Server
In order to displays connection data for the Replication Server,
connect SRS, and run:
admin show_connections
go
SAP (sybase) RS - some basic and useful scripts and queries
SAP (sybase) RS: Permission error while using rs_init
SAP (sybase) RS: RSI USER become Inactive
Enabling Password Encryption for SAP (Sybase) RS
- RS that it's RSSD is set with encrypted password.
- RS that is itself set with encrypted password (Encrypted password RS).
RS that its RSSD is set with encrypted password
- The RS that itself is not set with encrypted password.
- The RSSD of the RS is set with encrypted password (more correct: the ASE instance where the RSSD is stored is set with encrypted password).
- login RS.
- configure “replication server set send_enc_password"
- Restart RS
- Set the configuration parameter "RS_send_enc_pw" to “on” in the rs_name.cfg file.
- Restart RS.
Encrypted password RS
- Set password_encryption to '0'
- Change existing passwords in the RSSD tables to clear text
- Change in rs_users and rs_maintusers tables.
- There is no way to decrypt the passwords listed in the rs_users and rs_maintusers.
- Changing passwords with the alter user SRS command for SRS users, or the alter connection command for the maintenance users.
- Once you change the password on a connection for a maintenance user, you will need to change it at the replicate dataserver and resume the connection.
- Change existing passwords in the Replication Server configuration file: manually reenter, in clear text, passwords that are currently encrypted.
- Restart RS.
Enabling Password Encryption for SAP ASE (Sybase)
- Set 'net password encryption reqd' = 1 (or 2, check the values on SAP site)
- Restart ASE.
In order to connect this ASE, you need an encryption of the login password.
For example, in isql you need to add the "-X", that Initiates the login connection to the server with client-side password encryption.
Also for connections from RSs, Replications to this server can’t be replicated until we set the connection to it from the other RS (“send_enc_password” parameter, see here).
SAP RS - RSI USER become Inactive
SAP Replication Server Routing
- Two replication servers are installed and started.
- All target databases must have the same columns and Primary key.
- No identity in the target table (or subscription that know to update identity column).
- The passwords to all RSs in the process should be the same.
- The RepAgent has to use a known servers names (in the ini files).
- Source and target tables must have a primary keys.
- Edit the ini file in the new server with:
- Current (new) RS.
- ASE instance of the RSSD.
- ASE instance of the replicatec(=target) database.
- First (=source) RS.
- Edit the ini of the first (=source) RS with:
- New RS.
- ASE instance of the source RSSD.
- Run rs_init:
- Two ways to do that:
- run rs_init
- create <SAP_RS_FOLSER>/REP-16_0/init/rs/RS2.rs (copied and edited from install.rs) and run it
- ./rs_init -r ../init/rs/RS2.rs
- In rs_init we define the servers, databases, RSSDs, users, etc.
- Two ways to do that:
- Check that RS is up:
- isql64 -S RSFOG2 -Usa -P<password>
- admin version
go - admin who
go
|
# |
RS1 (source
RS) |
RSSD
of RS1 (RS1_RSSD) |
RS2 (second
RS) |
Target
replicated database |
|
|
1 |
Create route |
alter
connection to SERVERNAME.RS1_RSSD set log transfer ON |
|
|
|
|
1.a |
Monitor the
new route until it became active |
|
1>
rs_helproute |
|
|
|
2 |
add
connection RS2 (second RS) → target database |
|
Use rs_init |
|
|
|
3 |
Configure
a rep_agent to the RSSD |
|
1> use
RS1_RSSD |
|
|
|
4 |
Grant
permissions in the target database |
|
|
|
1> grant
all on FirstTable to <target
database name>_maint |
|
5 |
create a
subscription to the replicate connection in the second RS |
|
|
1> create
subscription subTest3 for repdefTest with primary at
PRIMARYDBSERVERNAME.PRIMARYDB with replicate at TARGETDBSERVER.TARGETDBNAME
without materialization |
|






