Tags

11g (5) 12c (6) 18c (3) 19c (4) ASM (1) Critical Patch (11) Data Pump (1) Dataguard (9) Diverse (3) GRID (7) GitLab (2) Linux (8) OEM (2) ORA Errors (13) Oracle (12) RMAN (4)
Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, May 17, 2023

Linux update RHEL 7 to RHEL 8 using Leapp

Linux update RHEL 7 to RHEL 8 using Leapp

Upgrading the system from RHEL 7 to RHEL 8 using Leapp

PURPOSE: All documents are provided on this Blog just for educational purposes only.  Please make sure that you run it in your test environment before to move on to production environment. 


Linux update redhat 8.6 using leapp
subscription-manager list --installed
subscription-manager repos --enable rhel-7-server-rpms
subscription-manager repos --enable rhel-7-server-extras-rpms
subscription-manager release --unset

yum versionlock clear 

cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.5 (Maipo)

yum update -y # bring the current version to update first 
or 
yum --releasever=7.9 update -y

reboor -r now
uname -a

yum install leapp leapp-repository cockpit-leapp wget -y

# Download letest leapp-data file:

https://access.redhat.com/articles/3664871

tar -xzf leapp-data21.tar.gz -C /etc/leapp/files && rm leapp-data21.tar.gz

y

ll /etc/leapp/files


# This enable GUI for report:

systemctl enable --now cockpit

https://hostname:9090

firewall-cmd --list-all
firewall-cmd --permanent --add-port=9090/tcp
firewall-cmd --reload

# Preupgrade task:

leapp preupgrade

UI for report

https://[hostname]:9090/leapp

https://hostname:9090


Fix the errors 

1. symbolic links point to absolute paths that have non-utf8 encoding and need to be fixed additionally

SOLUTION:

https://access.redhat.com/solutions/6989732

ls -l / | grep ^l

unlink /oracle 

ln -s oracle12.2 /oracle

ll / | grep ^l


2. The following packages have not been signed by Red Hat and may be removed during the upgrade...

SOLUTION:

Ignore this error for now.


3. Support for the following RHEL 7 device drivers has been removed in RHEL 8: - pata_acpi

# do this after reboot ther server.

rmmod pata_acpi

or

modprobe -r pata_acpi


4. If you depend on remote root logins using passwords, consider setting up a different user for remote administration or adding "PermitRootLogin yes" to sshd_config.

vi /etc/ssh/sshd_config

uncommit parameter

PermitRootLogin yes

systemctl restart sshd


5. The following RHEL 7 device drivers are no longer maintained RHEL 8: - e1000 - mptspi - mptbase - mptscsih - mptspi - e1000

# you need to remove Network adapter and recreat it via VCenter

# before you remove network adapter. Create an new interface:

cd /etc/sysconfig/network-scripts


vi ifcfg-ens192_NEW

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
IPADDR=xxx.xx.xx.xx
PREFIX=22
GATEWAY=xxx.xx.xx.x
DNS1=xxx.xx.xx.x
DNS2=xxx.xx.xx.x
DNS3=xxx.xx.xx.x
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=eui64
NAME=ens160
DEVICE=ens160
ONBOOT=yes
NM_CONTROLLED=no


Login to VCenter:

Edit Setting ==> Network adapter 1 (remove) 

Edit Setting ==> Add New Device ==> Network Adapter (It will automatically create the correct one VMXNET 3)

# Via Launch Concole do following:

mv ifcfg-ens32 ifcfg-ens32_OLD

mv ifcfg-ens192_NEW ifcfg-ens192


6. On legacy (BIOS) systems, GRUB core...

# can be ignored at this point


7. Please register user choices with leapp answer cli command or by manually editing the answerfile.

leapp answer --section remove_pam_pkcs11_module_check.confirm=True


8. 16 packages will be skipped because

# can be ignored for now


#Do again.

leapp preupgrade

#check the report again


# IMPORTENT: Before update do following export command. Otherwise you will get following error. 

Disk Requirements:

   At least 1597MB more space needed on the / filesystem.

export LEAPP_OVL_SIZE=4096

leapp upgrade

#check the logs 

reboot the system ==> IMPORTENT open the console über VMWare

-- The actual update will started. Watch the over the console

-- The system will be rebooted automatecally or you do by your self after update

-- Now login via ssh

uname -a


After upgrade:

alternatives --set python /usr/bin/python3

# if needed 
getenforce
setenforce 1
getenforce

# Check any rmp von el7. Be carefully

rpm -qa | grep -i el7

yum erase xxx xxx xxx -y

yum list kernel   # check any old kernal availabel

df -h

# If your environment needed. 

cat /etc/default/grub

cat /proc/cmdline

grub2-mkconfig -o /boot/grub2/grub.cfg


yum --releasever=8.7 update -y

done!!

Your comments are most valuable and it would help me to come up with better posts. 


Sunday, February 5, 2023

VNC Server Installation Steps

 VNC Server Installation Steps

PURPOSE: All documents are provided on this Blog just for educational purposes only.  Please make sure that you run it in your test environment before to move on to production environment. 

yum groupinstall "Server with GUI"
unalias shutdown
shutdown -r now
yum install tigervnc-server xorg-x11-fonts-Type1
yum install xorg-x11-xauth xorg-x11-fonts-* xorg-x11-utils

vncpasswd


pwd
/root
cd .vnc/

The File config file looks like as follow and no need to change.

vi .vnc/config

# securitytypes=vncauth,tlsvnc
# desktop=sandbox
# geometry=2000x1200
# 1920x1200
# localhost
# alwaysshared


VNC start stop script

Create a VNC start script as follow. 

more startVNC_55
vncserver -kill :55
sleep 5
vncserver :55 -geometry 1920x1200


./startVNC_55 &

ps -ef|grep vnc


MobaX

hostname=vm-adm-vnc-th.com

port=5955


For DISPLAY

NOTE: check following setting 

vi /etc/ssh/sshd_config
Uncheck and set to no
X11UseLocalhost no
service sshd restart

xhost +

or

xhost

ssh username@hostname -X

Test with the command

xclock

Your comments are most valuable and it would help me to come up with better posts. 

Thursday, November 3, 2022

How to Share NFS Mount Step by Step

 

How to Share NFS Mount Step by Step


Mounting the NFS Share


PURPOSE: All documents are provided on this Blog just for educational purposes only.  Please make sure that you run it in your test environment before to move on to production environment. 


NOTE:  Following guide will show you how to Mount the NFS Share

  • Source server  [your Server Name:test-db-01]
    ssh test-db-01
    vi /etc/exports
    /oracle/rman/backup test-db-02(rw,sync) test-db-03(rw,sync)
    /oracle/rman/backup/log jumphost-01(ro,sync,nohide,crossmnt)
           
         Execute following command 
     
    service nfs restart
    exportfs -ra
    

  • Destination Server [test-db-02, test-db-03,jumphost-01]
 login to the destination server where you want to mount the filesystem. In our case are   the above listed server.
          
     ssh test-db-02  and ssh test-db-03
     mkdir -p /oracle/rman/backup
     chown -R oracle:dba /backup
     mount -t nfs test-db-01:/oracle/rman/backup /oracle/rman/backup
           
           Same step for test-db-03:
          
          And same steps for the jumphost-01 server.
          ssh jumphost-01
     mkdir -p /oracle/rman/backup/log
     chown -R oracle:dba /backup
     mount -t nfs jumphost-   01:/oracle/rman/backup/log /oracle/rman/backup/log

    
     Add the entry on each server in the fstab file. In case of reboot the server,
          The mount will happen automatically.

     vi /etc/fstab
     test-db-01:oracle/rman/backup               oracle/rman/backup            nfs                defaults        0 0

Thursday, May 5, 2022

Extend device using LVM

Extend device using LVM

How to Extend LVM Partition with lvextend command

PURPOSE: All documents are provided on this Blog just for educational purposes only.  Please make sure that you run it in your test environment before to move on to production environment. 


Extent physical volume using LVM 

# Use  VCenter and give the disk.

ls -l /dev/disk/by-path/ <<== Scan the correct scsi device

echo 1 > /sys/class/scsi_device/0\:0\:3\:0/device/rescan

vgdisplay
fdisk -l
...
...
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048   209715199   104856576   83  Linux
...
...

partprobe

fdisk /dev/sdc <<== With the command  another disk is recognized. Example: sdc1 or  sdc2 recognized


n              #n   add a new partition
p              #p   print the partition table
enter
enter
enter
w              #w   write table to disk and exit
partprobe

fdisk -l
...
...
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048   209715199   104856576   83  Linux
/dev/sdc2       209715200   419430399   104857600   83  Linux
...
...

pvscan
PV /dev/sdc1   VG vg_data         lvm2 [<100.00 GiB / 0    free]
PV /dev/sdc2                      lvm2 [100.00 GiB]

pvcreate /dev/sdc2    <<== sdc2 is a new disk
pvscan

vgs
  VG      #PV #LV #SN Attr   VSize    VFree
  vg_data   1   1   0 wz--n- <100.00g    0

vgextend vg_data /dev/sdc2

vgs
  VG      #PV #LV #SN Attr   VSize   VFree
  vg_data   2   1   0 wz--n- 199.99g <100.00g

lvextend -l +100%FREE /dev/mapper/vg_data-lv_data

xfs_growfs /data


Done:

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

Steps for Physical Host extend LVM File system with multipath.

rescan-scsi-bus.sh -a -w -m

multipath -ll

#LUN WWID finden. You do with pipe

lsscsi -i -s 

vgdisplay

lvdisplay


vi /etc/multipath.conf  # add new LUN ID 

service multipathd reload

multipath -ll


parted /dev/mapper/tst-03DATA_03

GNU Parted 3.1

Using /dev/mapper/tst-01DATA_03

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) mklabel gpt

(parted) mkpart tst-03DATA_03 2048s 100%

(parted) align-check opt 1

1 aligned

(parted) quit


ll /dev/mapper/

pvcreate /dev/mapper/tst-03DATA_03p1

You can use multiple PV in one command.

pvcreate /dev/mapper/xxx /dev/mapper/xxx

pvscan

vgs

vgextend vg_data /dev/mapper/tst-03DATA_03p1

You can as well as extend multiple VG as one command  

vgextend /dev/mapper/xxx /dev/mapper/xxx

lvextend --resizefs -l +100%FREE /dev/vg_data/lv_data

df -hl

Done

Your comments are most valuable and it would help me to come up with better posts.


Wednesday, April 27, 2022

Create new xfs Filesystem

 

Create new xfs Filesystem

Add a new Hard Disk to Linux

How do I mount a disk in XFS

PURPOSE: All documents are provided on this Blog just for educational purposes only.  Please make sure that you run it in your test environment before to move on to production environment. 

# First assign a disk via VCenter

# Now we can add and mount new assign disk to the Linux system.

To find which host bus number is relevant.
grep mpt /sys/class/scsi_host/host?/proc_name
/sys/class/scsi_host/host0/proc_name:mptspi   <<== this ist the output

# Scan scsi host device 0
echo "- - -" > /sys/class/scsi_host/host0/scan

# Now you should be able to see the new Disk.
 
fdisk -l
mkfs.xfs /dev/sdb
mkdir /data
mount /dev/sdb /data
df -hl

# Add the entry in the fstab file
vi /etc/fstab
/dev/sdb    /data     xfs     defaults        0 0

Done.

If you want to create ext4 file system. Please use the following steps:

fdisk -l
fdisk /dev/sdc
n
enter
enter 
enter 
p

mkfs.ext4 /dev/sdc1 
blkid

vi /etc/fstab
UUID=832d4328-3dde-4861-b57b-06ce2be7245g       /data        ext4    defaults        0 0


Your comments are most valuable and it would help me to come up with better posts. 

Wednesday, March 2, 2022

Extend root partition xfs

 

Extend root partition using growpart

Extend root partition xfs

PURPOSE: All documents are provided on this Blog just for educational purposes only.  Please make sure that you run it in your test environment before to move on to production environment. 


Increase the disk first. I using VM Ware. 


Now let's check on server side. Login to the server and execute following commands. 

ls -l /dev/disk/by-path/ 

echo 1 > /sys/class/scsi_device/0\:0\:2\:0/device/rescan <<==  put the correct scsi id

lsblk
growpart -h
fdisk -l /dev/sdc


growpart /dev/sdc 1  <<== you may don't need this line. It depends on the environment.

lsblk
xfs_growfs /data
df -hl



Following steps are for the root Partition. 

echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan
lsblk
growpart /dev/sda 2
lsblk

xfs_growfs /


Following steps are for extend the Multipath LUN. 

# Current size is 1.5 TB

fdisk -l
Disk /dev/mapper/ORACLE_FASTRECOVERYAREA: 1572.9 GB, 1572864000000 bytes, 3072000000 sectors

# Add another 1.5 TB to the LUN-ID and use the following command to detect the new space

rescan-scsi-bus.sh -a -w -s
service multipathd restart

# Now we can see the another 1.5 TB assign to the LUN-ID

fdisk -l
Disk /dev/mapper/ORACLE_FASTRECOVERYAREA: 3145.7 GB, 3145728000000 bytes, 6144000000 sectors


# Now we need to increase xfs File System. Currently looks like as follow 1.5 TB 

df -hl /fast_recovery_area
Filesystem                           Size  Used  Avail Use% Mounted on
/dev/mapper/ORACLE_FASTRECOVERYAREA  1.5T  981G  484G  67% /fast_recovery_area

# Using following command to increase the Filesystem 

xfs_growfs /fast_recovery_area

# Now we can see the file system is increased

df -hl /fast_recovery_area
Filesystem                           Size  Used  Avail Use% Mounted on
/dev/mapper/ORACLE_FASTRECOVERYAREA  2.9T  981G  2.0T  34% /fast_recovery_area

Your comments are most valuable and it would help me to come up with better posts. 

Thursday, December 2, 2021

Create a physical volume in Linux using LVM

Create a physical volume in Linux using LVM


PURPOSE: All documents are provided on this Blog just for educational purposes only.  Please make sure that you run it in your test environment before to move on to production environment. 

Step 1:

fdisk /dev/sdd
Welcome to fdisk (util-linux 2.23.2).
 
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
 
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x33399fd3.
 
Command (m for help): p
 
Disk /dev/sdd: 1099.5 GB, 1099511627776 bytes, 2147483648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x33399fd3
 
   Device Boot      Start         End      Blocks   Id  System
 
Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-2147483647, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-2147483647, default 2147483647):
Using default value 2147483647
Partition 1 of type Linux and of size 1024 GiB is set
 
Command (m for help): w
The partition table has been altered!
 

Calling ioctl() to re-read partition table.

 

Step 2:

LVM

pvcreate /dev/sdb1
pvdisplay
pvs
vgcreate vg_db /dev/sdb1
lvcreate --name lv_db -l 100%FREE vg_db
 
mkfs.xfs /dev/mapper/vg_db-lv_db
mkdir /oracle
mount /dev/mapper/vg_db-lv_db /oracle
 
Add the entry in the fstab file.
vi /etc/fstab

dev/mapper/vg_db-lv_db        / oracle                    xfs     defaults        0 0 

Saturday, December 28, 2019

How to Increase xfs File System



How to Increase or expand an XFS File System without LVM


PURPOSE: All documents are provided on this Blog just for educational purposes only.  Please make sure that you run it in your test environment before to move on to production environment. 

NOTE: make sure, that you test first on our test system!
Following is the File System we want to increase.
/dev/sdb1       100G   88G   13G  88% /oracle
Step 1. Increase a hardware disk size in VMWare to 150GB
Using VMWare vSphere Client, open the properties of the virtual machine and increase the Provisioned Size.

Step2. Stop the running Application on Server
Step3. Unmount the partition
umount /oracle
or
umount -l /oracle
df -Th
Step4. Start to increase the partition.
parted -a optimal /dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit s
(parted) print
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 314572800s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start  End         Size        Type     File system  Flags
 1      2048s  209715199s  209713152s  primary  xfs

(parted) rm 1
Error: Partition(s) 1 on /dev/sdb have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now
before making further changes.
Ignore/Cancel? Ignore
(parted) mkpart
Partition type?  primary/extended? primary
File system type?  [ext2]? xfs
Start? 2048s
End? 100%
(parted) print
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 314572800s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start  End         Size        Type     File system  Flags
 1      2048s  314572799s  314570752s  primary  xfs

(parted) unit compact
(parted) quit
Information: You may need to update /etc/fstab.

Step5.
mount /oracle
xfs_growfs -d /oracle
meta-data=/dev/sdb1              isize=512    agcount=4, agsize=6553536 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=26214144, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=12799, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 26214144 to 39321344

Step6.
df -Th /oracle
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/sdb1      xfs   150G   88G   63G  59% /oracle

Completed.

physical standby without duplicate command

physical standby without duplicate command create a physical standby database using RMAN without using duplicate command PURPOSE:   All docu...