Friday, 15 November 2024

Oracle Linux Commands (awk/sed /tar/untar/zip/unzip) - part 3/4

In this post i am going to share few of the oracle Linux commands .. i have posted total 4 post for Complete Linux high level commands . this post you can see Part 3/4..

check the previous parts details below .

part 1 : https://anjaniappsdba.blogspot.com/2023/09/oracle-linux-commands-part-14.html

part 2 : https://anjaniappsdba.blogspot.com/2024/02/oracle-linux-commands-part-24.html 



Unix/Linux Awk Commands:

===================

 Awk {print;} filename>>

 Awk '/searchword/' filename 

ex:

-bash-4.2$ awk '/db_name/' awrrpt_1_10_11.html

 <tr><td scope="row" class='awrc'>db_name</td><td class='awrc'>proddb</td><td class='awrc'>&#160;&#160;</td>

 Awk '{print $2,$3;}' filename ( it will print the 2nd and 3rd line of the file )

Awk '{print $2,$5;}' filename ( it will print the 2nd and 5th line of the file )

awk '{print $2,$NF;}' filename

awk '{print $2,$NF;}' awrrpt_1_10_11.html


border="0" Name</th></tr>
scope="row" class='awrc'>&#160;&#160;</td>
class='awrc'> class='awrc'>
 PDB
 </td></tr>
scope="row" class='awrnc'>&#160;&#160;</td>
class='awrnc'> class='awrnc'>
 PDB$SEED
 </td></tr>
scope="row" class='awrc'>&#160;&#160;</td>
class='awrc'> class='awrc'>
 PDB
 </td></tr>
scope="row" cl


Unix Sed Commands : 

====================

Sed 's/oldname/newname/' filename >> to change first occurrence of the each line old name to new name

Sed 's/oldname/newname/2' filename >> to change second occurrence of the each line old name to new name

Sed 's/oldname/newname/g' filename >> to change all occurrence of the each line old name to new name.

Sed –n '/name/p' filename >> to print pattern match the line

 Sed '/^#\|^$| -*#/d' httpd.conf : to empty line file and start the # beginning remove that lines


Linux Rpm Commands

=================

 rpm –ivh rpmpkgname >> to install rpm package independently(with

in dependence)

[root@proddb01 ~]# rpm -qa oracle*

oracleasm-support-2.1.11-2.el7.x86_64

oracle-database-server-12cR2-preinstall-1.0-5.el7.x86_64

oraclelinux-release-el7-1.0-11.el7.x86_64

oracle-logos-70.7.0-1.0.5.el7.noarch

oracle-database-preinstall-19c-1.0-3.el7.x86_64

oracle-database-preinstall-21c-1.0-1.el7.x86_64

oracle-database-preinstall-18c-1.0-1.el7.x86_64

oraclelinux-release-7.8-1.0.7.el7.x86_64



rpm –qa >> to display the all rpm packages installed details

bind-libs-lite-9.11.4-26.P2.el7_9.16.x86_64

urw-base35-nimbus-mono-ps-fonts-20170801-10.el7.noarch

abrt-2.1.11-57.0.1.el7.x86_64

pinentry-0.8.1-17.el7.x86_64

tigervnc-server-minimal-1.8.0-19.0.1.el7.x86_64

flite-1.3-22.el7.x86_64

gnome-screenshot-3.26.0-1.el7.x86_64

tog-pegasus-libs-2.14.1-8.0.1.el7.x86_64

xterm-295-3.el7.x86_64

mod_session-2.4.6-93.0.1.el7.x86_64

libarchive-3.1.2-14.el7_7.x86_64

xorg-x11-drv-void-1.4.1-2.el7.1.x86_64

sos-3.8-6.0.1.el7.noarch

xsettings-kde-0.12.3-7.el7.x86_64

c-ares-1.10.0-3.el7.x86_64

librsvg2-2.40.20-1.el7.x86_64



rpm –q kernel >> it display the kernel version

rpm –e packagename >> to uninstall the rpm package

rpm –l package >> to search the rpm location path




Linux Compressed / uncompressed Commands

============================

tar –cvf filename.tar directory/filepath>> to create tar file

tar -cvf ashrpt_1_0910_1111.html.tar ashrpt_1_0910_1111.html

ashrpt_1_0910_1111.html.tar


tar –xvf filename.tar>> to extract the tar file

bash-4.2$ tar -xvf ashrpt_1_0910_1111.html.tar

tar –cvf filename.tar directory1 directory2 directory3>> to create tar

file multiple directory

tar –xvf filename.tar –d directorypath>> to extract the tar file in

specific location

tar –tvf filename.tar>> to see the contents tar file without extract

tar –czvf filename.tar.gz directory1 directory2 directory3>> to create

tar file multiple directory

tar –xzvf filename.tar.gz>> to extract the tar file

tar –tzvf filename.tar.gz>> to see the contents tar file without extract

zip –r filename.zip directory1 >> to creates zip files

unzip filename.zip >> to unzip the files

unzip –l filename.zip (or) less filename.zip>> to see the content


without extract to see the content


Gzip filename>> to create only the files not directories

Example: gzip filename

Output:filename.gz

Gzip –r directory>> to create only zip In files in directories

Gunzip filename.gz >> to extract the gz file

Tar –cjvf filename.tar.bz filename>> to create bz file

tar –cvf filename.tar file1 file2 >> to create a tar file

tar –xvf filename.tar >> extract the tar file

tar –tvf filename.tar >> to see the content of tar file without extract

tar –cvf filename.war directorypath>> create a tar file

tar –xvf filename.war>> extract the tar file

tar –xvf filename.war –d directorypath>> extract the war file in

specific location

tar –tvf filename.war>> to see the tar file content without extract


Moving data one location to another

================================


Cp >> copy the files or duplicate the files / backup the existing file / folder / directories 

Cp source destintion>> to copy the files one location to another.

Cp -r source destintion>> to copy the directories one location to

another.

mv source destintion>> to cut and paste the files one location to another. Or rename the files /directories


-bash-4.2$ cp test.txt test.txt_old

-bash-4.2$ ls -ltr

total 8

-rw-r--r-- 1 oracle oinstall 20 Nov 15 14:58 test.txt

-rw-r--r-- 1 oracle oinstall 20 Nov 15 14:58 test.txt_old

-bash-4.2$


-bash-4.2$ mv test.txt_old test.txt_new
-bash-4.2$ ls -ltr
total 8
-rw-r--r-- 1 oracle oinstall 20 Nov 15 14:58 test.txt
-rw-r--r-- 1 oracle oinstall 20 Nov 15 14:58 test.txt_new
-bash-4.2$


Linux Common Commands

============================

 pwd >>present working directory

 w>> to display system uptime ,load avg ,how many users

working full information of users

who>>to display the current active users

 whoami>> current user name

who am i>>it gives first login user in the system command

prompt

which command >> to know the execution command location

path

cd>> to go the home directory

 cd ~ >> to go the home directory

 cd ..>> to go the previous directory

cd /somepath>> to go the given path

man >> to given the commands information

 ls >> to display the list of files and directories

 ls –a >> to display the list of files and directories and hidden

directories and files

 ls –l >>

 ls –lt>>it display the files with time based

 ls –ltr>> it display the files with time reverse order

ls –ltrh>> it display the files with human readable format (like

gb,mb)

-bash-4.2$ pwd

/home/oracle/racsinfotech

-bash-4.2$ ls

test.txt

-bash-4.2$ ls -ltr

total 4

-rw-r--r-- 1 oracle oinstall 20 Nov 15 14:58 test.txt

-bash-4.2$



Thanks,

Srini


Saturday, 26 October 2024

Oracle EBS R12.2.12 Startup and Shutdown Sequence

 Dear All,

In this post i am going to share you how to start and stop oracle EBS R12.2.2 applications.

this will useful for oracle apps dba's .

Here is my current work environment details , its includes my OS version , database version and EBS application version.

Environment: Oracle apps R12.2 Single Node.

Database:  Oracle 19C

select banner_full from v$version;

BANNER_FULL

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

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.18.0.0.0

Application: EBS R12.2.12

SELECT RELEASE_NAME FROM FND_PRODUCT_GROUPS;

RELEASE_NAME

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

12.2.12

OS: Oracle Linux.:

[oracle@apps ~]$ cat /etc/redhat-release

Red Hat Enterprise Linux Server release 7.9 (Maipo)

 

EBS R12.2.12 Application Start-up Sequence:


First we need to connect to the physical host and then we need to set the database environment then follow the below steps .

##check the database status 

[root@apps ~]# ps -ef |grep smon
oracle    1760     1  0 07:40 ?        00:00:00 ora_smon_EBSCDB
root      6868  6822  0 07:59 pts/0    00:00:00 grep --color=auto smon


Ø Start Database services.

sqlplus / as sysdba
SQL >  startup 




Ø Start Database Listener services.

lsnrctl status listner_name or lsnrctl 

start / status 







next we need to connect to application host and then set the application environment.

##check the application status.

[root@apps ~]# ps -ef |grep tns
root        35     2  0 07:39 ?        00:00:00 [netns]
oracle    2063     1  0 07:40 ?        00:00:00 /u01/install/APPS/19.0.0/bin/tnslsnr EBSCDB -inherit
oracle    3324     1  0 07:42 ?        00:00:00 /u01/install/APPS/fs1/EBSapps/10.1.2/bin/tnslsnr APPS_EBSDB -inherit
root      6873  6822  0 07:59 pts/0    00:00:00 grep --color=auto tns
[root@apps ~]#
 


Ø Start EBS Application services
set the application environment... then start the application  services using .. adstral.sh 

Ø


 



application services started successfully.




EBS R12.2.12 Application Stop Sequence:

First we need to connect to application host and then set the application environment.
[oracle@apps ~]$ . EBSapps.env

  E-Business Suite Environment Information
  ----------------------------------------
  RUN File System           : /u01/install/APPS/fs1/EBSapps/appl
  PATCH File System         : /u01/install/APPS/fs2/EBSapps/appl
  Non-Editioned File System : /u01/install/APPS/fs_ne


  DB Host: apps.example.com  Service/SID: EBSDB


  E-Business Suite Environment Setting
  ------------------------------------
  - Enter [R/r] for sourcing Run File System Environment file, or
  - Enter [P/p] for sourcing Patch File System Environment file, or
  - Enter anything else to exit

  Please choose the environment file you wish to source [R/P]:R   ( we set the run filesystem )

  Sourcing the RUN File System ...




Ø Stop Application services

cd /u01/install/APPS/fs1/inst/apps/EBSDB_apps/admin/scripts
or 
cd $ADMIN_SCRIPTS_HOME/

[oracle@apps scripts]$ sh adstpall.sh

You are running adstpall.sh version 120.22.12020000.7


Enter the APPS username: apps

Enter the APPS password: appspassword 
Enter the WebLogic Server password: weblogic-password 

The logfile for this session is located at /u01/install/APPS/fs1/inst/apps/EBSDB_apps/logs/appl/admin/log/adstpall.log

stop log files.. 





Next we need to connect to the physical host and then we need to set the database environment then follow the below steps .


Ø Stop Database Listener services.

LSNRCTL> stop

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

The command completed successfully

LSNRCTL> status

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

TNS-12541: TNS:no listener

 TNS-12560: TNS:protocol adapter error

  TNS-00511: No listener

   Linux Error: 111: Connection refused

lsnrctl stop listner_name;

lsnrctl

LSNRCTL> stop / status / start 





Ø Stop Database services.

stop the pdb first using below command

SQL >  alter pluggable database EBSDB close;
SQL> shut immediate;



Post application started , Sanity checks .

application login page : 








we have successfully bounced the Oracle EBS R12.2.12 including the 19C database services .. 

Thanks,
Srini