Stay at Home!! Be Safe!! Take Care!!

Thanks all my viewers for your support, I am an Oracle Ace now. For Any queries, please mail us at support@funoracleapps.com

How to Install Rar/Unrar in Linux

No comments

How to Install Rar/Unrar in Linux


RAR is tool for creating/extracting compressed archive (.rar) files. 


Steps to Install on RHEL/Centos

# cd /usr/src (Or any other folder)
# wget https://www.rarlab.com/rar/rarlinux-x64-5.6.0.tar.gz
# tar -zxvf rarlinux-x64-5.6.0.tar.gz
# cd rar
# sudo cp -v rar unrar /usr/local/bin/


Steps to install on Debian and Ubuntu based distributions

$ sudo apt-get install unrar
or
$ sudo apt install unrar

No comments :

Post a Comment

How to find the current patchset levels for products in Oracle Apps

No comments

How to find the current patchset levels for products in Oracle Apps


To obtain the current patchset levels for each specific E-Business Suite functional product test the following steps:

1. Log into OAM.
(Responsibility System Administrator,"Oracle Applications Manager", menu "OAM Support Cart") 
and Navigate:

2. Support Cart --> Applications Signature --> Collect --> Check "Product Information" box
--> Click on "View" (eyeglasses)
This will display the following patchset information:
Application Name
Current Patch Level
Product Version
Status (Installed, Shared Product, Inactive)

3. The patchset level information can be retrieved directly from sqlplus with the following diagnostic script:
$AD_TOP/sql/adutconf.sql

No comments :

Post a Comment

Important Queries Related to Undo in Oracle

No comments

Important Queries Related to Undo in Oracle


To find retention guarantee for undo tablespace

select tablespace_name,status,contents,retention from dba_tablespaces where tablespace_name like '%UNDO%';

To find Undo Space Availability

select a.tablespace_name, SIZEMB, USAGEMB, (SIZEMB - USAGEMB) FREEMB
from (select sum(bytes) / 1024 / 1024 SIZEMB, b.tablespace_name
from dba_data_files a, dba_tablespaces b
where a.tablespace_name = b.tablespace_name
and b.contents = 'UNDO'
group by b.tablespace_name) a,
(select c.tablespace_name, sum(bytes) / 1024 / 1024 USAGEMB
from DBA_UNDO_EXTENTS c
where status <> 'EXPIRED'
group by c.tablespace_name) b
where a.tablespace_name = b.tablespace_name;

To show ACTIVE/EXPIRED/UNEXPIRED Extents of Undo Tablespace

select status,
  round(sum_bytes / (1024*1024), 0) as MB,
  round((sum_bytes / undo_size) * 100, 0) as PERC
from
(
  select status, sum(bytes) sum_bytes
  from dba_undo_extents
  group by status
),
(
  select sum(a.bytes) undo_size
  from dba_tablespaces c
    join v$tablespace b on b.name = c.tablespace_name
    join v$datafile a on a.ts# = b.ts#
  where c.contents = 'UNDO'
    and c.status = 'ONLINE'
);

To find Undo Retention Value

show parameter undo_retention;


Undo retention in hours

col "Retention" for a30
col name for a30
col value for a50
select name "Retention",value/60/60 "Hours" from v$parameter where name like '%undo_retention%';


Session Details Consuming Undo


SELECT s.inst_id,
        r.name                   rbs,
        nvl(s.username, 'None')  oracle_user,
        s.osuser                 client_user,
        p.username               unix_user,
        to_char(s.sid)||','||to_char(s.serial#) as sid_serial,
        p.spid                   unix_pid,
        TO_CHAR(s.logon_time, 'mm/dd/yy hh24:mi:ss') as login_time,
        t.used_ublk * 8192  as undo_BYTES,
                st.sql_text as sql_text
   FROM gv$process     p,
        v$rollname     r,
        gv$session     s,
        gv$transaction t,
        gv$sqlarea     st
  WHERE p.inst_id=s.inst_id
    AND p.inst_id=t.inst_id
    AND s.inst_id=st.inst_id
    AND s.taddr = t.addr
    AND s.paddr = p.addr(+)
    AND r.usn   = t.xidusn(+)
    AND s.sql_address = st.address
  AND t.used_ublk * 8192 > 1073741824
  ORDER
       BY undo_BYTES desc
/


To check space related statistics of  UndoTablespace from v$undostat

select
sum(ssolderrcnt) "Total ORA-1555s",
round(max(maxquerylen)/60/60) "Max Query HRS",
sum(unxpstealcnt) "UNExpired STEALS",
sum(expstealcnt) "Expired STEALS"
from v$undostat
order by begin_time;

Find Undo Segments related to users


select  s.sid,s.serial#,username,s.machine,
t.used_ublk ,t.used_urec,(rs.rssize)/1024/1024 MB,rn.name
from    v$transaction t,v$session s,v$rollstat rs, v$rollname rn
where   t.addr=s.taddr and rs.usn=rn.usn and rs.usn=t.xidusn and rs.xacts>0;

No comments :

Post a Comment

Locking and Disabling User Accounts in Linux

No comments

Locking and Disabling User Accounts in Linux


1. Locking the user account
To lock a user account use the command usermod -L or passwd -l. Both the commands adds an exclamation mark (“!”) in the second field of the file /etc/shadow.It has to be executed by either bob/privilaged user.
It will deny any access which would be done directly using su or with ssh.

# usermod -L bob
or

 
# passwd -l bob

Verify if the user account is locked.
Check for the flag *LK* in the below command output which indicates that the account is locked.

# passwd --status bob
bob *LK* 2020-05-01 0 45 7 -1 (Password set, SHA512 crypt.)

Try to Login

[himanshu@lcfs ~]$ su - bob
Password: 
su: Authentication failure

But with SSH key still connecting

[himanshu@lcfs ~]$ ssh bob@lcfs.lab
Welcome to Himanshu's Server Remote Login!
Last failed login: Fri May 15 17:52:08 IST 2020 on pts/1
There was 1 failed login attempt since the last successful login.
Last login: Fri May 15 17:51:07 2020 from lcfs.lab


2. Expiring the user account

The problem with above menthod is that if ssh password less key setup is done, then the user can still login via ssh using the keys.


# chage -E0 bob
Expiring an account via use of the 8th field in /etc/shadow (using “chage -E”) will block all access methods that use PAM to authenticate a user.


Verify if the account has been expired.


# chage -l bob
Last password change                                    : Apr 17, 2020
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : Jan 01, 1970
Minimum number of days between password change          : 0
Maximum number of days between password change          : 999999
Number of days of warning before password expires       : 7


Try Login

[himanshu@lcfs ~]$ ssh bob@lcfs.lab
Welcome to Himanshu's Server Remote Login!
Your account has expired; please contact your system administrator
Authentication failed.

So normally I prefer to lock and expire the user account both for better security.

3. Changing the shell to no login
We can also change the default shell of the user to /sbin/nologin so that the user do not get any login shell when he tries to login into the system.

# usermod -s /sbin/nologin bob
You can check for the 7th and last field in /etc/passwd for the change of shell to /sbin/nologin.

Verify for no login shell


# grep ^bob /etc/passwd
bob:x:1001:1001:bob:/bob:/sbin/nologin

No comments :

Post a Comment

Globbing/Wildcards in Linux

No comments

Globbing/Wildcards in Linux


Globbing in linux is referred to the use of wildcards. Wildcards, in the Linux file system, allow you to refer to files in a flexible way. 

Types of  Wildcards  in Linux

1) * - Star is for everything. Unlimited number of characters. 
example:
ls *
It will give all file names in the current directory, no matter how long they are. 

ls a*

All files starting with a

2) ? - Question mark is for one single character. 
example:
ls ?

It will give all filesname with single character

3) [] - Square brackets, you can specify a range. 

example:
ls [a-c]

It will search with filenames as a, b, or c. It's a range. 

We can combine them with other wildcards as well.

example:
ls [a-c]*

It will show all files names starting with a or b or c.

example:

ls ?[z-s]*

It will show you all files where the second character is a z or an s. 

example:

ls *?

star already covers all characters and if we put anything behind a star, that makes no sense, especially if you make that star question mark. 


example:

ls *?[a-c]
It will mean all files that have a letter(a/b/c) on the last position. In this case, the file name must be at least two characters long.

No comments :

Post a Comment

Installing and Removing Packages in Linux using Yum

No comments

Installing and Removing Packages in Linux using Yum

To install/remove a package in linux using yum we have to use root or privilaged user.Package will install all the dependencies as well.


Install package
yum install <package name>

yum install zip


Only Download RPM

yum install --downloadonly --downloaddir=/tmp

Install from local rpm

yum localinstall  <rpm name>


Re-install a package

yum reinstall <package name>


Re-install while skipping a dependencies which is not available in repository

yum reinstall  --skip-broken <package name>

Upgrade a package

yum upgrade <package name>

Remove a package
It will only remove package and dont remove any dependency

yum remove <package name>

Remove package and its dependencies

yum autoremove <package name>

No comments :

Post a Comment

Understanding Yum in Linux

No comments

Understanding Yum in Linux


Yum overview
RPM knows what its dependencies are, and has the ability to download software from FTP and web servers. 
Yum was created by Yellowdog Linux, and has since been adopted by many Red Hat-based distributions including Fedora and CentOS. 
Yum resolves dependencies automatically. This means it downloads and installs all software packages necessary. 
This includes packages that the user didn't specify, if the chosen package requires them. Y
Yum has also the concept of software package groups. A group is a list of software that is usually installed together. 

For instance, we could have a web server group that included the web server, and other tools commonly installed with it. Yum repositories contain RPM software packages. 
The Yum client maintains a local list of software repositories. Users can add repositories by just adding a new Yum configuration file for them. 
The Yum client also maintains a local list of all available software. The package install process using Yum is pretty straightforward. 
First, the Yum client contacts the repositories that it's aware of, and gets their list of software packages. 
These lists are then cached locally, and it updates them during install operations. 
The user then selects a software package that they want to install. Users can select packages to install by using either CLI or GUI tools. 
Yum then calculates dependencies. This would be the requested software package, and any packages that it requires. 
Yum then downloads all software packages and installs them using the RPM libraries, just like the RPM command does. 
Once the install has finished, Yum updates the RPM package database. 
Installing software using Yum couldn't be easier. 
Yum also has the concept of software groups. Yum groups contain multiple software packages. 
These software packages are usually installed together. All software in a group can be installed at once. 
All software in a group can be removed at once. Groups can contain optional software. 
Option software is related software, but not installed by default. Groups make configuring a system quicker. 
Installing a group of software with one command is much easier than installing each package individually.


Yum commands:

1) show package list in repository
yum list <name>

yum list samba

2) Show all version of packages in repository

yum --showduplicates list samba*

3) Get information on package

yum list 
yum info <name>


ex. yum info samba

4) Get info on installed packages

yum list installed

Output Color Codes:

All package in Bold and Underline means -Curent Kernel Version
All package in Bold means -Have updates available
All package in Red means- Package is not in our repository
All package in yellow means -package in installed with higher version that in repository

5) To only download rpm 

yum install -downloadonly -downloaddir=/tmp

6)Get all packages with updates available

yum list updates

7)Get list of packages available in repository

yum list available

Output Color Codes:

Blue: An updated to an installed package
Cyan: Downgrade to a installed package
Green and Underlined: Current Version of installed package


8) Check all package

yum list all

9) Check obsolete package list
yum list obsoletes

10)Check more information on package

yum info <package name>

yum info zip
yum info updates (check information on updates)
yum info obsoletes (check information on obsoletes)

11) Check dependency of a package

yum deplist <package name>
yum deplist zip

12) Checking various package groups

yum group list

13) Checking hidden groups

yum group list hidden

14) Checking group information

yum group info "group name"

yum group info "Development Tools"

15) Searching a package using yum

yum search <package name>

yum search zip

we can also search all which will search description as well

yum search all zip

16) Find which package can provide specific utility

yum provides <package name>

yum provides zip

No comments :

Post a Comment

Restore the Original Permissions of Package Files using RPM

No comments

Restore the Original Permissions of Files using RPM


If in any case the package configuration files permissions or get changed in Linux, we can use rpm to restore the permissions.

I have changed the permission manully.

[root@lcfs packages]# rpm -qc wget
/etc/wgetrc
[root@lcfs packages]# ls -ltr /etc/wgetrc
-rw-r--r--. 1 root root 4479 May 16  2019 /etc/wgetrc
[root@lcfs packages]# chmod 777 /etc/wgetrc
[root@lcfs packages]# chown himanshu:himanshu /etc/wgetrc
[root@lcfs packages]# ls -ltr /etc/wgetrc
-rwxrwxrwx. 1 himanshu himanshu 4479 May 16  2019 /etc/wgetrc

Now lets restore original permissions using setperms:

[root@lcfs packages]# rpm -setperms wget
[root@lcfs packages]# ls -ltr /etc/wgetrc
-rw-r--r--. 1 himanshu himanshu 4479 May 16  2019 /etc/wgetrc

Also we can restore the original ownership as well using setugids:

[root@lcfs packages]# rpm -setugids wget
[root@lcfs packages]# ls -ltr /etc/wgetrc
-rw-r--r--. 1 root root 4479 May 16  2019 /etc/wgetrc

No comments :

Post a Comment

Install|Remove|Upgrade|Re-Install|Verify|Validate Packages using RPM in Linux

No comments

Install|Remove|Upgrade|Re-Install|Verify|Validate Packages using RPM in Linux


Installing a Package:

rpm -ivh

rpm -ivh httpd-2.4.6-93.el7.centos.x86_64.rpm

Please note if any dependent package is notinstalled it will fail and you have first install the dependent package.

Uninstalling a Package:

rpm -ev

rpm -ev httpd

Please note this will not remove any dependent package that was installed as part of the "httpd" installation.

Upgrading a Package:

rpm -Uvh

To find out which package need to be upgraded we will use below command and all the packages mentioned in bold would be eligible for upgrade.

yum list installed

I ran the command and found below 2 packages.
tzdata.noarch                      
tzdata-java.noarch 

Note: I have already downloaded the rpm.

Now we will upgrade packages, it will cleanup old version and install new rpm.

[root@lcfs packages]# rpm -Uvh tzdata-2020a-1.el7.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:tzdata-2020a-1.el7               ################################# [ 50%]
Cleaning up / removing...
   2:tzdata-2019c-1.el7               ################################# [100%]


In case there is a dependency problem while upgrade which means it create a deadlock like situation where each package is dependent on other then we can use below option while upgrade which will ignore dependency problem.

rpm -Uvh --nodeps

Freshening a Package:

rpm -F

It works same way as upgrade but the diffrence is that it will only upgrade the packages which are already installed, whereas upgrade will install the package if it is not installed.


Re-Installing a Package:

rpm -ivh --force

[root@lcfs packages]# rpm -ivh --force tzdata-2020a-1.el7.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:tzdata-2020a-1.el7               ################################# [100%]


Verify Package Attributes:

Attibutes of a files are
S - Size
M - File permission
5 - Checksum
D - Device Number
L - Link Path
U - User ownership
G - Group ownership
T - Last modified Time
C - Capabilities
c - file type


This will help to identify if the files were changed once they were installed.
This information includes file size, file permissions, check sum, device major and minor numbers, link path, user ownership, group ownership, last modify time, and capabilities. Using rpm verify, we can check if files have changed since they were installed. Rpm verify will also show us the file type. This type could be, a configuration file, a documentation file, a ghost file, which is one where the contents were not included in the package itself, a license file, or lastly, a README file.



rpm -V name

 This shows the size has changed, the digest or check sum has changed, and the last modify timestamp has changed. 
[root@lcfs zoneinfo]# rpm -V yum
S.5....T.  c /etc/yum.conf


We can use "v" to get information in detail

[root@lcfs zoneinfo]# rpm -Vv zip
.........    /usr/bin/zip
.........    /usr/bin/zipcloak
.........    /usr/bin/zipnote
.........    /usr/bin/zipsplit
.........    /usr/share/doc/zip-3.0
.........  d /usr/share/doc/zip-3.0/CHANGES
.........  d /usr/share/doc/zip-3.0/LICENSE
.........  d /usr/share/doc/zip-3.0/README
.........  d /usr/share/doc/zip-3.0/README.CR
.........  d /usr/share/doc/zip-3.0/TODO
.........  d /usr/share/doc/zip-3.0/WHATSNEW
.........  d /usr/share/doc/zip-3.0/WHERE
.........  d /usr/share/doc/zip-3.0/algorith.txt
.........  d /usr/share/man/man1/zip.1.gz
.........  d /usr/share/man/man1/zipcloak.1.gz
.........  d /usr/share/man/man1/zipnote.1.gz
.........  d /usr/share/man/man1/zipsplit.1.gz


To verify all files we can use below command. This is a time taking activity

rpm -Va

Validate Package Integrity

It will help validate if the package is not alter or modified or any type of corruption.

Check MD5 checksum

[root@lcfs packages]# rpm -K --nosignature tzdata-java-2020a-1.el7.noarch.rpm
tzdata-java-2020a-1.el7.noarch.rpm: sha1 md5 OK

GPG check

[root@lcfs packages]# rpm -K  tzdata-java-2020a-1.el7.noarch.rpm
tzdata-java-2020a-1.el7.noarch.rpm: rsa sha1 (md5) pgp md5 OK

Check the key information

[root@lcfs packages]# rpm -q gpg-pubkey
gpg-pubkey-f4a80eb5-53a7ff4b

[root@lcfs packages]# rpm -qi gpg-pubkey-f4a80eb5-53a7ff4b
Name        : gpg-pubkey
Version     : f4a80eb5
Release     : 53a7ff4b
Architecture: (none)
Install Date: Thursday 09 April 2020 08:03:16 AM IST
Group       : Public Keys
Size        : 0
License     : pubkey
Signature   : (none)
Source RPM  : (none)
Build Date  : Monday 23 June 2014 03:49:55 PM IST
Build Host  : localhost
Relocations : (not relocatable)
Packager    : CentOS-7 Key (CentOS 7 Official Signing Key)
Summary     : gpg(CentOS-7 Key (CentOS 7 Official Signing Key) )
Description :

No comments :

Post a Comment

Understanding RPM Tags in Linux

No comments

Understanding RPM Tags in Linux


All rpm package comes with certain tags and can be used for better formatting and fetching the output as required by a Admin or day to day basis.


If we wanna see all the tags we can use

rpm --querytags

Some examples for using these tags are as below

1) Finding only name and version we can use

rpm -qa --queryformat "%{NAME} %{VERSION}\n"

2) Make output in better format in above command

rpm -qa --queryformat "%-30{NAME} %-10{VERSION}\n"

3) Find file names in a package with better format

rpm -ql --queryformat "%{FILENAMES}\n" bash

4) Find file names with size

rpm -ql --queryformat "[%{FILENAMES} %{FILESIZES}\n]" zip

5) Find package install date 

rpm -q --queryformat "%{NAME} %{INSTALLTIME:date}\n" zip

6) File files in a package and the permissions 

rpm -q --queryformat "%{FILEMODES:perms} %{FILENAMES}\n" zip

No comments :

Post a Comment

Understanding and Managing RPM in Linux

No comments

Understanding and Managing RPM in Linux




RPM is a package manager which is used on Linux based OS. It can help in package installation from FTP/HTTP site as well.



Few Feature of RPM

Install Software
Upgrade Software
Remove Software
Query Package Database
Check Package Dependencies


Disadvantages:
RPM can detect package dependecies but cannot install those during main package installation. For this we use other tools like yum

Important queries related to installed packages

1) Check all installed pcakages
 rpm -qa

2) List packages in Sorted way
 rpm -qa|sort

3) Information about a package installed
 rpm -qi zip

 Sample Output

 [root@lcfs ~]# rpm -qi zip
Name        : zip
Version     : 3.0
Release     : 11.el7
Architecture: x86_64
Install Date: Thursday 09 April 2020 07:18:33 AM IST
Group       : Applications/Archiving
Size        : 815173
License     : BSD

4) Information about packages installed based on group

[root@lcfs ~]# rpm -qa Group="System Environment/Shells"
tcsh-6.18.01-16.el7.x86_64
bash-4.2.46-34.el7.x86_64

5) Find packages installed based on date

rpm -qa --last

6) Find files installed by a package

rpm -ql zip
rpm -qd zip (for all document files for package)

7) Find configuration files related to package installed.

rpm -qc yum

8) Find a file was installed by which package

rpm -qf /bin/bash

9) Find Documentation for a file which was installed via package.

rpm -qfd /bin/bash

10) Find features of a utility

rpm -q --provides bash

11) Check Dependent packages for a package

rpm -q --requires zip

12) Find all changes to a package done(like changes in package development)

rpm -q --changelog zip


Important queries related to rpm packages before installation

1) Find Package information for RPM.

rpm -qip httpd-2.4.6-93.el7.centos.x86_64.rpm

2) Find all the files inside a RPM package

rpm -qlp httpd-2.4.6-93.el7.centos.x86_64.rpm

Please note the most command will run on rpm also but we have to give "p" option for checking

Extract a rpm

rpm2cpio |cpio -id 



No comments :

Post a Comment

Oracle Apps Web ADI Error: Web ADI Invalid Integrator Key

No comments

Oracle Apps Web ADI Error: Web ADI Invalid Integrator Key



Error: 

Web ADI Invalid Integrator Key

Cause:

For Specific user level, we have to set the following profile option 'YES', If user not having System Administrator Responsibility

Solution:

'BNE Allow No Security Rule' as Yes at the User level

No comments :

Post a Comment

How to Migrate Web ADI template from one EBS Instance to other EBS instance

No comments

How to Migrate Web ADI template from one EBS Instance to other EBS instance


Following are the components that are associated to the Web ADI that can be migrated from one instance to another:


  • Integrators
  • Layouts
  • Mappings
  • Contents

Integrators:

Identify the Integrator to migrate as below,

select integrator_code, application_short_name
  from apps.bne_integrators_vl  bnv
      ,apps.fnd_application_vl  fav
 where bnv.user_name = &integrator_name
   and fav.application_id = bnv.application_id;



Download the Integrator:
FNDLOAD apps/$APPS_PASSWORD 0 Y DOWNLOAD $BNE_TOP/patch/115/import/bneintegrator.lct INTEGRATOR_LDTFILE.ldt BNE_INTEGRATORS INTEGRATOR_ASN="appl_short_name" INTEGRATOR_CODE="integrator_name"

Upload the Integrator:
FNDLOAD apps/$APPS_PASSWORD 0 Y UPLOAD $BNE_TOP/patch/115/import/bneintegrator.lct INTEGRATOR_LDTFILE.ldt

Layouts:

Identify the Layout to migrate as below,

select layout_code
  from apps.bne_layouts_vl
 where user_name = &layout_name;



Download the Layout:
FNDLOAD apps/$APPS_PASSWORD 0 Y DOWNLOAD $BNE_TOP/patch/115/import/bnelay.lct LAYOUT_LDT.ldt BNE_LAYOUTS LAYOUT_ASN="appl_short_name" LAYOUT_CODE="Layout_code"

Upload the Layout:
FNDLOAD apps/$APPS_PASSWORD 0 Y UPLOAD $BNE_TOP/admin/import/bnelay.lct LAYOUT_LDT.ldt

Mappings:

Identify the Mapping to migrate as below,


select mapping_code
  from apps.bne_mappings_vl
 where integrator_code = &integrator_code



Download the Mapping:
FNDLOAD apps/$APPS_PASSWORD 0 Y DOWNLOAD $BNE_TOP/patch/115/import/bnemap.lct MAPPING_LDT.ldt BNE_MAPPINGS MAPPING_ASN="appl_short_name" MAPPING_CODE="Mapping_code"

Upload the Mapping:
FNDLOAD apps/$APPS_PASSWORD 0 Y UPLOAD $BNE_TOP/admin/import/bnemap.lct MAPPING_LDT.ldt

Contents:

Identify the Contents to migrate as below,

select content_code
   from apps.bne_contents_vl
  where integrator_code = &integrator_code



Download the Contents:
FNDLOAD apps/$APPS_PASSWORD 0 Y DOWNLOAD $BNE_TOP/patch/115/import/bnecont.lct CONTENT_LDT.ldt BNE_CONTENTS CONTENT_ASN="appl_short_name" CONTENT_CODE="Content_code"

Upload the Contents:
FNDLOAD apps/$APPS_PASSWORD 0 Y UPLOAD $BNE_TOP/admin/import/bnecont.lct CONTENT_LDT.ldt



No comments :

Post a Comment