This Site Create for Help Tech guys in Issues and fixes in Linux SAP and Oracle.

Search This Blog

Powered by Blogger.

Create Client in SAP

First Create Client via SCC4 THEN COPY Client via SCCL profile SAP_CUST After copy login into Client 000 and export default users t...

Create Client in SAP



First Create Client via SCC4

THEN COPY Client via SCCL profile SAP_CUST
After copy login into Client 000 and export default users tcode scc8 create transport
Via selecting profiles “ USERS” then import that transport via stms_import
Then login into new client and import transport via tcode SCC7
.

User Locked in SAP


Lock user (unlock)

lock - is  a record in the field  uflag, "0" - the user is not locked,

To Unlock - need to switch field  uflag to "0":

Locked
SQL> select uflag from sapsr3.usr02 where mandt='000' and bname='SAP*';

     UFLAG
----------
       128
Not locked:
SQL> select uflag from sapsr3.usr02 where mandt='431' and bname='USERNAME';

     UFLAG
----------
         0
Unlocking:
SQL> update sapsr3.usr02 set uflag='0' where mandt='000' and bname='DDIC';

1 row updated.

SQL> commit work;




UNLOCK your self
update sapr3.usr02 set uflag='0' where mandt='830' and bname='USER'; 
commit work;

RESET PASSWORD PROCESS:

SQL> select bcode, passcode from sapsr3.usr02 where mandt='000' and bname= 'DDIC';

BCODE            PASSCODE
---------------- ----------------------------------------
EF82F150AB6136BF 6BBFC576AC43020521E2206DBC1A0421A43E91C4

SQL> update sapsr3.usr02 set bcode='11FAF9DD879FE537',
passcode='ECB96161D5BDA8E04CE52AC886DEF5CD318869AE' where mandt='000' and bname='DDIC';

IF DATE EXPIRED:

SQL> select PWDCHGDATE from sapr3.usr02 where mandt='830' and bname='USERNAME';

PWDCHGDATE
------------------------
20190227

SQL> update sapr3.usr02 set PWDCHGDATE='20190728' where mandt='830' and bname='USERNAME';

1 row updated.


Pull Oracle Tablespace Size


select owner, table_name, round((num_rows*avg_row_len)/1024) "Size in KB" from All_tables where owner = 'SAPR3' order by "Size in KB" desc;


SELECT DS.TABLESPACE_NAME, SEGMENT_NAME, ROUND(SUM(DS.BYTES) / 1024) "SIZE in KB"
  FROM DBA_SEGMENTS DS
  WHERE SEGMENT_NAME IN (SELECT TABLE_NAME FROM ALL_TABLES where OWNER='SAPR3')
 GROUP BY DS.TABLESPACE_NAME,
       SEGMENT_NAME;


Use VNC on Tunnel Linux



Please follow below documents to take VNC Session. You need to run highlighted command with Yellow on servers.

  • Need a vnc-server installed;  it’s tigervnc-server for RHEL7
  • Team will start VNC server process(es) as desired
    • May be one “shared” session for particular/common account to be used across timezones/globe
    • May be one per actual user (A vs. B)
    • Vncserver starts using ports at 5901, but user could specify any port number, even one in their 10,000 list of port exceptions for EIP
  • Team must launch vncserver with the -localhost directive
    • This prevents from binding to any network interface other than localhost
    • Forces them to use an SSH tunnel to access the VNC server
  • No firewall rules for any of the vnc ports, aka 5901…must be over SSH tunnel
  • Any other VNC configuration is on the DBAs; is not a root managed daemon that is started on boot

vncserver -autokill -IdleTimeout 900 -localhost

    • VNC SSH Tunnel on local computer (5901 is only an example. It may be 5902 or higher, depending on different factors.)
ssh -L 5901:localhost:5901 -N -f -l $DOMAIN\\$USER $SERVER


Check User in Locked in AD Domain via Linux


[root@XXXXX ~]# /opt/pbis/bin/find-user-by-name --level 2 username
User info (Level-2):
====================
Name:                         username
SID:                          S-1-5-21-1960408961-1844823847-1417001333-122211
UPN:                          username@xyz.COM
Generated UPN:                NO
DN:                           CN=xx\,XXX,OU=XX,OU=XXX,OU=01_Users,DC=aXXX,DC=ixyz,DC=com
Uid:                          1971859108
Gid:                          1972229393
Gecos:                        <null>
Shell:                        /bin/bash
Home dir:                     /home/Domain/username
LMHash length:                0
NTHash length:                0
Local User:                   NO
Account disabled (or locked): FALSE
Account expired:              FALSE
Password never expires:       FALSE
Password expired:             FALSE
Prompt for password change:   YES
User can change password:     YES
Days till password expires:   6
Logon restriction:            NO



Expected archived log not found


Error : - RMAN-06059: expected archived log not found, loss of archived log compromises recoverability


RMAN>CHANGE ARCHIVELOG ALL VALIDATE;

RMAN> CROSSCHECK ARCHIVELOG ALL;
wait


Oracle Fragmentation


select
   table_name,round((blocks*8),2) "size (kb)" ,
   round((num_rows*avg_row_len/1024),2) "actual_data (kb)",
   (round((blocks*8),2) - round((num_rows*avg_row_len/1024),2)) "wasted_space (kb)"
from
   dba_tables
where
   (round((blocks*8),2) > round((num_rows*avg_row_len/1024),2))
order by 4 desc;

SLPProxyHand 500



SUM Issue
*** ERROR => SLPProxyHandlerFactory::ConnectContext called but ctx->operationID is NULL  [SLPProxyHand 500]
Upgrade SAP Host Agent

*** ERROR => SLPProxyHandlerFactory::ConnectContext called but ctx->operationID is NULL  [SLPProxyHand 503]
Kill all services starting with  : ps -ef|grep sap

How to reset password for user "sys" in Oracle?



How to reset password for user "sys" in Oracle?
Solution:
  1. Delete pwdniku.ora from /$ORACLE_HOME/dbs folder 

  2. Run command orapwd file=/$ORACLE_HOME/dbs/orapwniku.ora password=system entries=10 

  3. Connect to Oralce using sqlplus /nolog 

  4. Run command inside SQL prompt: connect sys/system as sysdba 

  5. Run command: alter user system identified by system; 

  6. At this point your user "system" password has been changed to system in this example 

  7. Connect to SQLPLUS: sqlplus system/system 

  8. Run command: alter user sys identified by system; 

  9. Your sys password now has been changed

cleanipc



error : 
kernel runs with dp version 140000(ext=121000) (@(#) DPLIB-INT-VERSION-140000-UC)
length of sys_adm_ext is 592 bytes
*** ERROR => Shared Memory Key 57 (SHM_PROFILE) already exist [dpxxdisp.c   1124]
*** ERROR => dispatcher already running ???? [dpxxdisp.c   1125]
*** ERROR => I better EXIT before I do any (more) damage [dpxxdisp.c   1126]


Fix

cleanipc <Instance Number> remove

SAP Router Installation


1. Copy d:\usr\sap\saprouter from existing server  to new server .

2. Open a command prompt with administrator rights (right click and select "run as administrator").

3. navigate to D:\usr\sap\saprouter

4. execute the following command:

D:\usr\sap\saprouter>ntscmgr install SAProuter -b d:\usr\sap\saprouter\saprouter.exe -p "service -r -R d:\usr\sap\saprouter\SAPROUTTAB"

Result should be: CreateService SUCCESS

5. Open SAProuter service and set startup type to "Automatic"

6. Modify SAProuter service and set Log On to "This account: .\sapadmin" and enter password.

7. Done!

Set Oracle user expiry unlimted


ALTER PROFILE "DEFAULT" LIMIT
  SESSIONS_PER_USER UNLIMITED
  CPU_PER_SESSION UNLIMITED
  CPU_PER_CALL UNLIMITED
  CONNECT_TIME UNLIMITED
  IDLE_TIME UNLIMITED
  LOGICAL_READS_PER_SESSION UNLIMITED
  LOGICAL_READS_PER_CALL UNLIMITED
  COMPOSITE_LIMIT UNLIMITED
  PRIVATE_SGA UNLIMITED
  FAILED_LOGIN_ATTEMPTS 10
  PASSWORD_LIFE_TIME UNLIMITED
 PASSWORD_REUSE_TIME UNLIMITED
  PASSWORD_REUSE_MAX UNLIMITED
  PASSWORD_LOCK_TIME 1
  PASSWORD_GRACE_TIME 7
  PASSWORD_VERIFY_FUNCTION NULL;

to verify


column limit format a20

select profile,resource_name,limit from dba_profiles where profile='DEFAULT';

Kill Oracle Sessions


select inst_id,sid,serial# from gv$session where username='DBSNMP';

   INST_ID        SID    SERIAL#
---------- ---------- ----------
         1        282        730
         1        284      18914
         1        305      28470



alter system kill session '282,730,@1';

Set Oracle Path in Bash Profile


export ORACLE_HOME=/oracle/Q0X/122
export ORACLE_SID=Q0X
export LD_LIBRARY_PATH=/oracle/Q0X/122/lib
export ORACLE_PATH=/oracle/Q0X/122/bin
export PATH=$PATH:/oracle/Q0X/122/bin/

Change Username expiry in Linux 7



[root@servername ~]# chage -l sp3adm
Last password change                                    : Jul 23, 2019
Password expires                                        : Aug 22, 2019
Password inactive                                       : Sep 21, 2019
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 30
Number of days of warning before password expires       : 7
[root@servername ~]# passwd -x -1 sp3adm
Adjusting aging data for user oracle.
passwd: Success
[root@servername ~]# chage -l sp3adm
Last password change                                    : Jul 23, 2019
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : -1
Number of days of warning before password expires       : 7
[root@servername ~]#

Install VNC Server in Linux


For installation VNC Server you need to install following rpm's

yum -y install libvncserver.x86_64 tigervnc.x86_64 tigervnc-license.noarch tigervnc-icons.noarch tigervnc-server.x86_64 tigervnc-server-minimal.x86_64 motif xterm xorg-x11-apps; sed -i s/twm/mwm/g /etc/X11/xinit/Xclients; sed -i s/twm/mwm/g /etc/X11/xinit/xinitrc