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
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.
Blog Pages
▼
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"
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"
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.
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'
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.
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.
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
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.
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
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
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".
'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 failureYour 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
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 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).
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,
...
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
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".
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.
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.
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) - 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
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 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
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 )
(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
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
edit a file
vi FILENAME
grant privilege to a user
chown -R USERNAME: FOLDERNAME
(-R - to recursively operate on all files and directories under the given directory)
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)
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
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