Add new mountpoint on your linux server

 

Below are the steps to follow for adding any new mount on you linux machine.


[root@oem ~]# fdisk -l

Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 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 /dev/sda: 64.4 GB, 64424509440 bytes, 125829120 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: 0x00030fd3

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200   125829119    61864960   8e  Linux LVM

Disk /dev/mapper/ol-root: 38.2 GB, 38235275264 bytes, 74678272 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 /dev/mapper/ol-swap: 6442 MB, 6442450944 bytes, 12582912 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 /dev/mapper/ol-home: 18.7 GB, 18668847104 bytes, 36462592 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


[root@oem ~]# fdisk /dev/sdb
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 0xcc407fe2.

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-104857599, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599):
Using default value 104857599
Partition 1 of type Linux and of size 50 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@oem ~]# mount /dev/sdb1 /u01
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
 

 

[root@oem ~]# mkfs.ext4 /dev/sdb1
mke2fs 1.45.4 (23-Sep-2019)
Creating filesystem with 13106944 4k blocks and 3276800 inodes
Filesystem UUID: d963b0cf-a786-440c-8bf8-955c45f98c4f
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424

Allocating group tables: done
Writing inode tables: done
Creating journal (65536 blocks): done
Writing superblocks and filesystem accounting information: done

Create u01 directory on root "/", and then mount.

[root@oem ~]# mount /dev/sdb1 /u01
 

[root@oem ~]# df -h
Filesystem           Size  Used Avail Use% Mounted on
devtmpfs             3.8G     0  3.8G   0% /dev
tmpfs                3.8G     0  3.8G   0% /dev/shm
tmpfs                3.8G  9.5M  3.8G   1% /run
tmpfs                3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/mapper/ol-root   36G   25G   11G  70% /
/dev/mapper/ol-home   18G   37M   18G   1% /home
/dev/sda1           1014M  343M  672M  34% /boot
tmpfs                766M  8.0K  766M   1% /run/user/42
tmpfs                766M     0  766M   0% /run/user/0
/dev/sdb1             49G   24K   47G   1% /u01

Add below entry to your /etc/fstab, so that this mount gets mounted automatically after reboot. Otherwise everytime you have mount on reboot.

/dev/sdb1    /u01    ext4    defaults     0   0


You are done with adding a new mount.

Create partition using fdisk

 First need to identify the raw disk attached with your machine usig command fdisk -l


[root@asmdr software]# fdisk -l

Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 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: 0x0003fe73

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200    83886079    40893440   8e  Linux LVM

Disk /dev/sdb: 32.2 GB, 32212254720 bytes, 62914560 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 /dev/sdc: 10.7 GB, 10737418240 bytes, 20971520 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 /dev/sdd: 32.2 GB, 32212254720 bytes, 62914560 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 /dev/mapper/ol-root: 37.7 GB, 37706792960 bytes, 73646080 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 /dev/mapper/ol-swap: 4160 MB, 4160749568 bytes, 8126464 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

So in above example is clearly show /dev/sdb, /dev/sdc and /dev/sdc are raw disk attached to my machine.

So now lets start creating partition as below.

[root@asmdr software]# fdisk /dev/sdb
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 0xd8008fcd.

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-62914559, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-62914559, default 62914559):
Using default value 62914559
Partition 1 of type Linux and of size 30 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@asmdr software]# fdisk /dev/sdc
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 0xda8ba1dc.

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-20971519, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519):
Using default value 20971519
Partition 1 of type Linux and of size 10 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@asmdr software]# 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 0x54e9805b.

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-62914559, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-62914559, default 62914559):
Using default value 62914559
Partition 1 of type Linux and of size 30 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@asmdr software]# fdisk -l

Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 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: 0x0003fe73

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200    83886079    40893440   8e  Linux LVM

Disk /dev/sdb: 32.2 GB, 32212254720 bytes, 62914560 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: 0xd8008fcd

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    62914559    31456256   83  Linux

Disk /dev/sdc: 10.7 GB, 10737418240 bytes, 20971520 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: 0xda8ba1dc

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048    20971519    10484736   83  Linux

Disk /dev/sdd: 32.2 GB, 32212254720 bytes, 62914560 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: 0x54e9805b

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1            2048    62914559    31456256   83  Linux

Disk /dev/mapper/ol-root: 37.7 GB, 37706792960 bytes, 73646080 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 /dev/mapper/ol-swap: 4160 MB, 4160749568 bytes, 8126464 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



-bash: xclock: command not found

 xclock is a simple graphical application in Unix and Unix-like operating systems, particularly in X Window System environments, that displays an analog or digital clock on the screen. It's primarily used as a basic demonstration of the X Window System's ability to display graphical applications.

 To run xclock on a Unix-like system, you can typically open a terminal or shell and simply type: 

 

 This command will start the xclock application, and a window displaying a clock will appear on your desktop. It's a straightforward utility and doesn't have any complex features or functionalities. Its primary purpose is to serve as a simple visual representation of the X Window System's capabilities.

xclock is often used as a quick way to verify that your X server is running correctly and to test the graphical capabilities of your X Window System environment.

 

Installing the package providing the xclock command


 

 

[root@asmdr software]#  yum install xorg-x11-apps
Loaded plugins: langpacks, ulninfo
ol7_UEKR6                                                                                                                                                                                                             | 3.0 kB  00:00:00
ol7_latest                                                                                                                                                                                                            | 3.6 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package xorg-x11-apps.x86_64 0:7.7-7.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
 Package                                                      Arch                                                  Version                                                  Repository                                                 Size
=============================================================================================================================================================================================================================================
Installing:
 xorg-x11-apps                                                x86_64                                                7.7-7.el7                                                ol7_latest                                                307 k

Transaction Summary
=============================================================================================================================================================================================================================================
Install  1 Package

Total download size: 307 k
Installed size: 772 k
Is this ok [y/d/N]: y
Downloading packages:
xorg-x11-apps-7.7-7.el7.x86_64.rpm                                                                                                                                                                                    | 307 kB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : xorg-x11-apps-7.7-7.el7.x86_64                                                                                                                                                                                            1/1
  Verifying  : xorg-x11-apps-7.7-7.el7.x86_64                                                                                                                                                                                            1/1

Installed:
  xorg-x11-apps.x86_64 0:7.7-7.el7

Complete!

 

Find Redo Log Size / Switch Frequency / Location in Oracle

What is redo logs?

In Oracle, the term "redo log" refers to a critical component of the database system that helps ensure data durability and recoverability. The redo log consists of a set of files, known as redo log files or redo logs, which store a record of changes made to the database.

Whenever a transaction modifies data in the database, Oracle generates redo entries, also known as redo records, that capture the before and after images of the modified data. These redo records are written to the redo log files in a sequential manner. The redo log files provide a means to recover the database to a consistent state in the event of a system failure or a database crash.

Redo logs serve two primary purposes:

1. Recovery: The redo log files are crucial for database recovery operations. In case of a failure, Oracle can use the redo log files to reapply the changes made by committed transactions that were not yet written to the data files, thus ensuring data consistency and integrity.

2. Redo Generation: The redo log files also play a role in maintaining the durability of the database. As changes are made to the database, the redo log files capture these modifications, allowing Oracle to recreate or "redo" those changes if necessary.

In summary, the redo log in Oracle is a fundamental component that helps ensure data integrity and recoverability by storing a record of changes made to the database. It plays a crucial role in database recovery and provides durability by capturing redo entries for all modifications made to the database.

Find Redo Log Size

To find the size of the redo log in Oracle, you can query the database dictionary views. Specifically, you can retrieve the redo log size information from the `V$LOG` view. Here's an example query:

 


This query will return the group number (`GROUP#`), thread number (`THREAD#`), and size in bytes (`BYTES`) of each redo log group in the database.

Note that the `V$LOG` view provides information about individual redo log groups, and the size of the redo log is typically the sum of the sizes of all the groups. So, if you want to calculate the total size of the redo log, you can use the following query:

 


This query will give you the total size of the redo log in bytes. You can divide the result by an appropriate unit (e.g., 1024 for kilobytes, 1024*1024 for megabytes) to obtain the size in a more readable format.

Keep in mind that the size of the redo log can vary depending on the configuration and settings of your Oracle database.


Redo Log Switch Frequency

To determine the redo log switch frequency in Oracle, you can query the database dictionary views to gather information about the redo log switches. Redo log switches occur when a filled redo log file is switched with an empty one to ensure continuous logging of database changes. Here's an example query:

 


This query retrieves the count of redo log switches from the `V$LOG_HISTORY` view. The `V$LOG_HISTORY` view provides a historical record of redo log switches that have occurred in the database.

You can also calculate the redo log switch frequency over a specific period of time by considering the timestamps of the redo log switches. Here's an example query that calculates the average redo log switch frequency per day:

 

 

This query divides the count of redo log switches by the time difference between the earliest and latest redo log switch timestamps to obtain the average frequency per day.

Note that the `V$LOG_HISTORY` view retains historical information for a limited period, which is determined by the database configuration. Therefore, if you need to analyze redo log switch frequency over a longer duration, you might need to consider other methods, such as log file monitoring tools or auditing features provided by Oracle or third-party tools.

 

Redo Log Location in Oracle

In Oracle, the redo log files are typically stored in a specific directory known as the "log file directory" or "log file location." The exact location of the redo log files depends on the configuration of the database and the operating system.

To find the location of the redo log files, you can query the `V$LOGFILE` view, which provides information about the redo log file configuration. Here's an example query:

 

 

This query retrieves the file paths (`MEMBER`) of the redo log files in the database. The `V$LOGFILE` view contains information about the redo log file members, including their locations.

Each redo log file member has a specific path associated with it. The path can be an absolute file system path or a relative path within the database directory structure, depending on the configuration. By querying the `V$LOGFILE` view, you can obtain the exact location of each redo log file member.

Additionally, you can also check the Oracle initialization parameter file (usually called "init.ora" or "spfile.ora") to find the specific location of the redo log files. Look for the parameter `LOG_FILE_NAME_n`, where `n` represents the redo log group number. The parameter value will indicate the path and filename of each redo log file member.

Remember to adjust the query or examine the parameter values for all redo log groups in case there are multiple groups configured in your Oracle database.

 

Redo Log File Status Descriptions

 

UNUSED – Online redo log has never been written to. This is the state of a redo log that was just added, or just after a RESETLOGS, when it is not the current redo log.

CURRENT – Current redo log. This implies that the redo log is active. The redo log could be open or closed.

ACTIVE – Log is active but is not the current log. It is needed for crash recovery. It may be in use for block recovery. It may or may not be archived.

CLEARING – Log is being re-created as an empty log after an ALTER DATABASE CLEAR LOGFILE statement. After the log is cleared, the status changes to UNUSED.

CLEARING_CURRENT – Current log is being cleared of a closed thread. The log can stay in this status if there is some failure in the switch such as an I/O error writing the new log header.

INACTIVE – Log is no longer needed for instance recovery. It may be in use for media recovery. It might or might not be archived.

 

 

Add new mountpoint on your linux server

  Below are the steps to follow for adding any new mount on you linux machine. [root@oem ~]# fdisk -l Disk /dev/sdb: 53.7 GB, 53687091200 by...