Friday 28 February 2020

Delete old HANA database diagnosis trace files

Tags

Hi all,

Here I am going to show delete HANA old trace file easy workaround for this is this:

    Create another folder, say “old_tracefiles

    Move all files older than, say 7 days (or whenever you last upgraded to the most recent revision), to this “old_tracesfiles” folder.
 
Follow these steps:

1. Logon to the SAP HANA server as SID.

2. Navigate to the trace file folder

For that, just use the predefined shell command alias ‘cdtrace

hanatest:/usr/sap/THR/HDB00> cdtrace

hanatest:/usr/sap/THR/HDB00/hanatest/trace>


3. Create the “old_tracefiles” folder
 
Heres simply create the “old_tracefiles” folder as a sub-folder of the actual trace folder.

You might and probably should create it at a different location, to release the storage space in the trace file folder.

hanatest:/usr/sap/THR/HDB00/hanatest/trace> mkdir old_tracefiles


4. Move old trace files into the new folder:

This can take some time…

hanatest:/usr/sap/THR/HDB00/hanatest/trace>find . -type f -mtime +7 -print | xargs -I {} mv {} old_traces/
If you find that you don’t actually need the trace files any more, you may just go on and delete this folder later on.

In general, it usually doesn’t make sense to keep the trace files generated by older revisions.

Exceptions to this general approach could be, that you faced bugs that you still wait to see fixed or to compare messages from normal/baseline system operations (think of time required for restart, message output during restart/shutdown/backup…).


Source: SAP SCN blog.

Saturday 22 February 2020

hdbdaemon HDB Daemon not running due to nameserver.ini missing or deleted

Tags

You try to start HANA DB from the command line with 'HDB Start' and an error returns 'FAIL: process hdbdaemon HDB Daemon not running'.

Possible Reason:

1. The nameserver.ini file is corrupt 
2. The nameserver.ini file is missing, the error messages in the nameserver trace files:
    [75956]{-1}[-1/-1] 2020-02-21 16:24:16.302707 f NameServer TREXNameServer.cpp(02829) :     [landscape]/master is missing in nameserver.ini. did someone delete SYS/global/hdb/custom/config/nameserver.ini ? -> stopping instance ...
 [75956]{-1}[-1/-1] 2020-02-21 16:24:16.312673 e Basis TREXNameServer.cpp(02859) : Process exited due to an error via explicit exit call with exit code 1 , no crash dump will be written


Solution :
 
Check the nameserver.ini  file if there any nameserver entry in that file if no maintain manually below the entry.

Open a text editor and copy the following text into the file and save it as nameserver.ini
 
[landscape]

 id = 

master = 

worker = 

active_master =

The id for your system is located in the landscape.id file: Location of file: [...]/hana/SID/data/mnt0001/hdb00001/landscape.id

open landscape.id get ID
 
For master = hostname: port number (single node system)

worker= hostname

active master= hostname: port number (single node system)

Default locations of the nameserver.ini file:

[...]/global/hdb/custom/config/nameserver.ini [...]/exe/linuxx86_64/HDB_1.00.67.383230_1263754/config/nameserver.ini

Note: The HANA configuration file files (nameserver.ini, indexserver.ini, xsengine.ini, etc.) are not backed up as part of a database backup.




Thursday 20 February 2020

Oracle Database password expired

Tags

Possible Error During SAP Upgrade.

1. Oracle Password expired and required that this be changed.
2. Once changed unable to connect to the database. Sourcing no longer functions.
3. Error: "attempted connection to System Database [jdbc:oracle:thin:@somehost:1527:ABC(source/source)]:0 failed. Reason: ORA-28001: the password has expired"

Run the below Command to reset or extend Password Lifetime in DB Level.

 In the Oracle case simply applying the following SQL command as an admin user will allow the specified profile (and users assigned to it) to have a nonexpiring password:

    SQL> ALTER PROFILE PASSWORD_LIFE_TIME UNLIMITED;

 

Tuesday 18 February 2020

How to Access to HANA DB trace files via sapstartsrv

Tags

Now it's possible to see all trace files of your SAP HANA DB instance via the SAP Start Service (sapstartsrv) to an additional operating system user.

 The following steps are required to grant the new sidtrc user access to the trace files of your SAP HANA DB instance.

(1) Enable authentication for additional users in the SAP Start Service. Execute as user root the following commands:
chmod u+s,o-rwx /usr/sap//HDB/exe/sapuxuserchk 
sudo chown root /usr/sap//HDB/exe/sapuxuserchk
 
In addition, you should check if the following file system is mounted with "nosuid": /usr/sap

 (2) Add user sidtrc to the SAP Start Service profile as an admin user.
Edit file /usr/sap//SYS/profile/_HDB_ and add the
 following line:

service/admin_users = sidtrc 

(3) Restart the SAP Start Service.

Execute as sidadm: sapcontrol -nr -function RestartService The new user is now set up to access the trace files via the SAP Start Service. Be aware that the user has the administrative rights, for example :  the user will also be able to start and stop your instance.