Labels

admin (1) aix (1) alert (1) always-on (2) Architecture (1) aws (3) Azure (1) backup (3) BI-DWH (10) Binary (3) Boolean (1) C# (1) cache (1) casting (3) cdc (1) certificate (1) checks (1) cloud (3) cluster (1) cmd (7) collation (1) columns (1) compilation (1) configurations (7) Connection-String (2) connections (6) constraint (6) copypaste (2) cpu (2) csv (3) CTE (1) data-types (1) datetime (23) db (547) DB2 (1) deadlock (2) Denali (7) device (6) dotNet (5) dynamicSQL (11) email (5) encoding (1) encryption (4) errors (124) excel (1) ExecutionPlan (10) extended events (1) files (7) FIPS (1) foreign key (1) fragmentation (1) functions (1) GCP (2) gMSA (2) google (2) HADR (1) hashing (3) in-memory (1) index (3) indexedViews (2) insert (3) install (10) IO (1) isql (6) javascript (1) jobs (11) join (2) LDAP (2) LinkedServers (8) Linux (15) log (6) login (1) maintenance (3) mariadb (1) memory (4) merge (3) monitoring (4) MSA (2) mssql (444) mssql2005 (5) mssql2008R2 (20) mssql2012 (2) mysql (36) MySQL Shell (5) network (1) NoSQL (1) null (2) numeric (9) object-oriented (1) offline (1) openssl (1) Operating System (4) oracle (7) ORDBMS (1) ordering (2) Outer Apply (1) Outlook (1) page (1) parameters (2) partition (1) password (1) Performance (103) permissions (10) pivot (3) PLE (1) port (4) PostgreSQL (14) profiler (1) RDS (3) read (1) Replication (12) restore (4) root (1) RPO (1) RTO (1) SAP ASE (48) SAP RS (20) SCC (4) scema (1) script (8) security (10) segment (1) server (1) service broker (2) services (4) settings (75) SQL (74) SSAS (1) SSIS (19) SSL (8) SSMS (4) SSRS (6) storage (1) String (35) sybase (57) telnet (2) tempdb (1) Theory (2) tips (120) tools (3) training (1) transaction (6) trigger (2) Tuple (2) TVP (1) unix (8) users (3) vb.net (4) versioning (1) windows (14) xml (10) XSD (1) zip (1)

SAP ASE (Sybase) - find the host ID of ASP ASE

Linux:

<SAP FOLDER>\SYSAM-2_0\bin>lmutil lmhostid

lmutil - Copyright (c) 1989-2013 Flexera Software LLC. All Rights Reserved.
The FlexNet host ID of this machine is "000c7a854v87"

Windows:
Run from cmd:
ipconfig /all
--> Physical Address is the Host ID.

Windows IP Configuration

   Physical Address. . . . . . . . . : 00-0C-7A-85-4V-87

SAP ASE (Sybase) - Check the Edition of the license in the error log (after start the server)

Look for "This product is licensed to:"
It comes after the SySAM logs, look there fo find from where it take the license file etc.

You can find the license source by looking for "kernel  SySAM: Using licenses from"

Stop SAP ASE

Use isql to log in to an SAP ASE sa account

1> shutdown 
2> go

SAP ASE (Sybase) - couldn't create kernel region, could not create shared memory

What I tried to do:
Start ASE service.
(Using bat file or start thr service).

Error message:
kernel  kbcreate: couldn't create kernel region.
kernel  kistartup: could not create shared memory

Cause:
The value of ASE parameter "max memory" is larger than the Operating System shared memory.

Optional Solutions:
(There is no one solution to all cases)

1. try to edit the value in the configuration file (<SAPASEFOLDER>/<SERVERNAME>.cfg :
[Physical Memory]
max memory = 

2. Restart to the server.

SAP ASE (Sybase) - configure the number of user connections

-- Change the number:
sp_configure 'number of user connections', 50

-- Display the current setting:
sp_configure 'number of user connections'

Run a script using isql

isql64 -S<SERVERNAME> -Usa -P<PASSWORD> -i <FILEFULLPATH>

Optional:
add "-o output.txt" to save output in a file.

Sybase Database Error: The specified device is not a database device.

What I tried to do
Create a segment for a database.

Error message:
Sybase Database Error: The specified device is not a database device.

Solution:
You probably mention a device that not in use in the database you try to add athe schema to.

SQL SERVER - List of tables with size and rows count

SELECT s.Name AS SchemaName,
t.Name AS TableName,
p.rows AS RowCounts,
CAST(ROUND((SUM(a.used_pages) / 128.00), 2) AS NUMERIC(36, 2)) AS Used_MB,
CAST(ROUND((SUM(a.total_pages) - SUM(a.used_pages)) / 128.00, 2) AS NUMERIC(36, 2)) AS Unused_MB,
CAST(ROUND((SUM(a.total_pages) / 128.00), 2) AS NUMERIC(36, 2)) AS Total_MB
FROM sys.tables t
INNER JOIN sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN sys.allocation_units a ON p.partition_id = a.container_id
INNER JOIN sys.schemas s ON t.schema_id = s.schema_id
GROUP BY t.Name, s.Name, p.Rows
ORDER BY 6 desc
GO

SAP Control Center - This site can’t be reached

Problem:
Can't access to Control Center: "This site can’t be reached".

Solution:
Enable flash:

Chrome-->Settings-->Site Settings-->Flash
1. change Flash definition to "ASk First"
2. Add SCC URL (https://localhost:8283/scc/# etc.) to the allows list.

SAP ASE (Sybase) - View active transactions

In order to view active transactions, run 
sp_transactions

AIX - CPU, memory and IO (disks space) commands

CPU usage for each process:
topas –P

CPU details:
mpstat

Memory details:
vmstat
svmon

Disk IO details:
iostat
topas -D 

telnet is not recognized as an internal or external command, operable program or batch file

Error message when run telnet:
'telnet' is not recognized as an internal or external command, operable program or batch file.

Solution:
turn "Telnet Client" on via "Programs and Features"-->"Installed updates"-->"Turn Windows features on or off".

SAP ASE installation error: Using locale name "C.UTF-8" defined in environment variable LANG


Error message:
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 <DIRECTORYNAME>. Check the environment variable SYBASE if it is not the one you want!
Using locale name "C.UTF-8" defined in environment variable LANG
Locale name "C.UTF-8" doesn't exist in your /<SAP FOLDER>/locales/locales.dat file
An error occurred when attempting to allocate localization-related structures.

Solution:

<SAP FOLDER>$ export LANG=

SAP ASE installation error: Command 'isql' not found

Error message:
Command 'isql' not found, but can be installed with:
apt install unixodbc
Please ask your administrator.

Solution:
<SAP FOLDER>$ source  SYBASE.sh

SAP ASE: Connect to the database using SCC - SAP Control Center

SCC - SAP Control Center - a client tool - Web-based administrative console- of SAP to the ASE databases.
SAP Control Center replaces Sybase Central - the client tool when ASE was Sybase.

Read more here:
https://help.sap.com/doc/saphelp_iq1608_iqnfs/16.0.8/en-US/a8/780f2d84f210158b8c895da947e314/frameset.htm

In order to connect to the database using SCC:

* Resource Registration:
1. Resource-->Register - Resource Registration window will be open.
2. Resource type:
- Resource name: enter a name (just a name for you to recognize the server).
- Resource type: ASE server.
3. Connection information:
- ASE host name: the server name or IP.
- ASE port number: port number.
- Character set: -
- Language: -
4. Authentication Information:
- Enter user and password.
5. Options:
- Sign V V.
*. In the first connection the SCC will suggest to change few configuratuins. DO that...

* In order to execute SQL:
1. "Prespective Resources" window, from the server name open "Administration Console"

2. in "Administration Console" --> "Resource Selection"

SAP Replication Server Error: can not connect

Error Message:
ct_connect(): network packet layer: internal net library error: Net-Lib protocol driver call to connect two endpoints failed

Solution:
Start Replication Server (service in Windows, or batch file in Linux).

SAP ASE (Sybase): Add an identity column

In SAP ASE (Sybase) identity column has to be declared as numeric(X,0).

CREATE TABLE TABLENAME
(
id_column_name numeric(5,0) identity
...

SAP ASE (Sybase): Collection of monitoring data requires enable monitoring

Error Message while try to run queries for SAP ASE server:
Collection of monitoring data for <OBJECT> requires that the 'enable monitoring' configuration option(s) be enabled. 

Solution:
sp_configure 'enable monitoring', 1

Test Open Ports with Telnet

Open cmd and run:
telnet <IP_ADDRESS> <PORT_NUMBER>

Example:
telnet 30.125.40.120 5000

* If telnet doesn't work, turn "Telnet Client" on via "Programs and Features"-->"Installed updates"-->"Turn Windows features on or off".

SAP ASE (Sybase) ase 15.7 server invocation of this java application

What I tried to do?
Install SAP ASE 15.7 server, run the setup file.

Error:
This Application has Unexpectedly Quit
Invocation of this Java application has cause an Invocation Target Exception. this application will now exit

Cause:
Not fit SAP ASE release to the OS.
Look at SAP docs if the ASE release can be installed on the OS.

Start Sybase server

startserver -f RUN_servername

If you've got this error message:
bash: startserver: command not found...

Find where it is placed and run:
. SYBASE.sh ( the file with the Sybase Product Environment variables)
After it run again startserver from its folder.

SAP ASE (sybase) - Move a table to another Segment

sp_placeobject SEGMENTNAME , 'TABLENAME'

SAP ASE (sybase) - Create Database

A device has to be created.
How to create a device:
https://copypastenet.blogspot.com/2019/12/sap-ase-sybase-create-device.html


-- Create Database
create database DATABASENAME
    on DEVICENAME='100M'      -- data device
    log on LOGDEVICENAME='100M' -- log device, if not declared - log will be in the same device as the data
GO

For more options in the creation:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36272.1600/doc/html/san1393050910896.html

SAP ASE (sybase) - Create Segment

sp_addsegment SEGMENTNAME, DATABASENAME, DEVICENAME

SAP ASE (sybase) - Create a Device

-- Create a device - disk init
disk init 
  name="DeviceName", 
  physname="/sybvol01/sap16/data/DeviceName1.dat", 
  size="250M"
GO

For more parameters of disk init:

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36272.1550/html/commands/X64061.htm

Connect to isql

isql Uusername Ppassword [Sserver]

(U , P , S - as is and then replace to the user, password, ...)
( Pay attention: names are case-sensitive )

Unix/Linux zip commands

zip file: 
zip FILENAME.ZIP

unzip file: 
unzip FILENAME.ZIP

unzip to a folder: 
unzip FILENAME.ZIP -d FOLDERNAME

instsall zip:
sudo apt install zip

Unix/Linux files commands

remove a file
rm
(rm * - remove all files in the folder)
(-f - force deletion)

find a file in a folder including sub-folders by it's name:
find -name FILENAME
find a file in a folder including sub-folders by part of it's name:
find -name FILEN*

view text of a file
more FILENAME
  • Exit by pressing q key

edit a file
vi FILENAME
  • To save a file: press Esc key, type :w, Enter
  • To save a file and quit: press Esc key, type :x, Enter

grant privilege to a user
chown -R USERNAME: FOLDERNAME
(-R - to recursively operate on all files and directories under the given directory)

Unix/Linux System and enviroment commands

show enviroment parameters
env
show enviroment parameters results match a specified pattern
env | grep STRING

add parameter to env or replace exists value:
export PARAM="VALUE"
concantanete value to exists parameter in env:
export PARAM="VALUE":$PARAM

available and used disk space usage
df
(df -h - more human display)

Unix/Linux basic commands

where I am
pwd

go to FOLDERNAME folder
cd FOLDERNAME

go to parent folder
cd ..

display what is in the folder
ls
(-l all files)
(- la all include hidden)

create a folder
mkdir FOLDERNAME

display an user manual for a command
man COMMAND

switch user
su

run a command like admin (= "as administrator" in windows)
sudo COMMAND ...

desplay results that match a specified pattern
COMMAND | grep STRING

show commands history
history