Saturday 22 May 2021

        Oracle Linux DBA basic commands/ Troubleshooting


 -----------Who logged in to Linux / Bruit force attack login history----------


who | cut -d' ' -f1 | sort | uniq
last


-----------------------Linux /Solaris Commands ----------------------------------------------
• Finding file in application tier 

find . -name O7533820.out


• Operating system details
bash-4.1$  uname -a
SunOS manihdevdb01 5.11 11.1 sun4v sparc sun4v

• Check folder size (Du disk utilization)
du -sh oacore_server1/
• Copy file to specific folder location 
cp oacore_server1.out metrics/

• Create a new  file from 1000 last lines of a file 
tail -n 1000 oacore_server1.out >> oacore_server1_1000.out
Above example will copy 1000 lilnes from .out file and create a  new file _1000.out

• Removing file with specific name and time +1 days 

find /u01/app/appldev/BRES/fs2/FMW_Home/user_projects/domains/EBS_domain_BRES/servers/oacore_server1/logs/*log* -mtime +1 -exec rm {} \;
Below will remove all with %log%
find *log*  -exec rm {} \;

• Removing all files from a directory 

rm -rf *
• Getting out of the command
Cntr + x
Cntrl + c
Cntrl + z
:q  
• Viewing file in the putty 
vi  $INST_TOP/admin/out/portpool.lst
•  TOP navigation 
Travel to any TOP by using command  cd $APPL_TOP  , cd $AU_TOP 
ls  list all files and folder
Use cd pwd for present working directory 
• Root user is the father of all usera
You can see all the users  by top command 
Once you logged in by root user you can enter to any user mode as follows 
Su -applmgr ( here applmgr is the application  user ) 
• Ho to find location of $CONTEXT_FILE 
ps -ef |grep $CONTEXT_FILE
Or 
Echo $CONTEXT_FILE


---------------------Oracle EBS Application Version/ Details -------------------------------


  select * from FND_PRODUCT_GROUPS;


Get Application EBS URL 

SELECT home_url   FROM icx_parameters;

EBS Version 
  select * from V$VERSION;
DB Version
SELECT * FROM PRODUCT_COMPONENT_VERSION;
Operating system
  select dbms_utility.port_string from dual;

  SELECT PRODUCT, VERSION FROM SYS.PRODUCT_COMPONENT_VERSION;

Finding Location of appl_top from dabatase 

Select distinct  variable_name, value  from fnd_env_context where variable_name like 'APPL_TOP';

Finding database tier location on server 

select name from v$database;



----- Checking  access to port    (TELNET on windows is wget on linux) -----------------
[cmarais@ebsapp-gmtuat01 ~]$ wget http://10.1.0.198:8080
--2021-02-09 11:28:39-- http://10.1.0.198:8080/
Connecting to 10.1.0.198:8080... connected.
HTTP request sent, awaiting response... 200
Length: unspecified [text/html]
Saving to: ‘index.html’
[ <=> ] 11,438 --.-K/s in 0.001s
2021-02-09 11:28:39 (18.2 MB/s) - ‘index.html’ saved [11438]


• Finding hosts file on oracle Server  for host entry


( needs to login through root user for editing the host file)



----------------------Concurrent manager IS DOWN --------------------------

Shutdown all the services and check the fndlbr


appclone@ebststcm02:/oraapp/ebsclone/inst/apps/EBSCLONE_ebststcm02/admin/scripts$ ps -ef | grep FNDLIBR|grep appclone

appclone  8328  7742   0 13:11:21 pts/1       0:00 grep FNDLIBR

appclone@ebststcm02:/oraapp/ebsclone/inst/apps/EBSCLONE_ebststcm02/admin/scripts$ cd

appclone@ebststcm02:~$ sqlplus apps/apps


SQL*Plus: Release 10.1.0.5.0 - Production on Fri Jun 21 13:11:27 2019


Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options


SQL> @cmclean.sql

DOC>

DOC>WARNING : Do not run this script without explicit instructions

DOC>from Oracle Support

DOC>

DOC>

DOC>*** Make sure that the managers are shut down ***

DOC>*** before running this script ***

DOC>

DOC>*** If the concurrent managers are NOT shut down, ***

DOC>*** exit this script now !! ***

DOC>

DOC>#

If you wish to continue type the word 'dual': dual

-----------------------------------------------------------------------

-- Updating invalid process status codes in FND_CONCURRENT_PROCESSES

0 rows updated.

-----------------------------------------------------------------------

-- Updating running processes in FND_CONCURRENT_QUEUES

-- Setting running_processes = 0 and max_processes = 0 for all managers


50 rows updated.

-----------------------------------------------------------------------

-- Updating invalid control_codes in FND_CONCURRENT_QUEUES


0 rows updated.

50 rows updated.

-----------------------------------------------------------------------

-- Updating any Running or Terminating requests to Completed/Error canceled by CMCLEAN

 0 rows updated.

----------------------------------------------------------------------

-- Updating any Runalone flags to 'N'


Updated 0 rows of runalone_flag in fnd_conflicts_domain to 'N'

-----------------------------------------------------------------------

Updates complete.

Type commit now to commit these updates, or rollback to cancel.

-----------------------------------------------------------------------

> commit

SQL> commit

2

SQL>Exit

 ---------------------Database is down /TNS listener is down ------------------------------------


Check if TNS is down using below command 

$ lsnrctl status

Enter the WebLogic Server password: 

adstpall.sh: Database connection could not be established. Either the database is down or the APPS credentials supplied are wrong. 

Set the database env variable then  sqlplus / as sysdba and then stratup as below to start db



To bounce the DB 

$ shut immediate 

-------------------- VNC SERVER--------------------------------------


To find Exisiting VNC server in linux use below command 

ps -ef|grep vnc

You can create new session for vnc with below command, here 5 is not a port number it’s a  new session number 



Enter above port 5 to ip address of server and hit enter 




Restarting VNC Server

$vncserver restart

Logging into VNC Server




You can change the VNC password as below 


------------------  Too many security failures  error  or authentication failed in VNC --------------------

This either means you have entered wrong password multiple time or you have brut force attack on server, to avoid this error kill the VNC session and restart it again 
Login to server using root user 







Use below command to kill the session and restart it again ,

sudo vncserver -kill :1
sudo vncserver :1



No comments:

Post a Comment