Linux File Compress commands

File Compress commands 

Linux we have two types of compress commands

  1. GZIP
  2. GUNZIP

To reduce the file size by using compress commands

gzip – This command used to compress the file size

[oracle@oracletest scripts]$ gzip ramkumar.txt
[oracle@oracletest scripts]$ ls -l
total 24
-rwxrwxrwx. 1 oracle oracle 72 Oct 21 01:49 ramkumar.txt.gz
-rwxrwxr-x. 1 oracle oracle 1291 Oct 20 23:47 rman_bkp.sh
-rw-rw-r--. 1 oracle oracle 6979 Oct 20 23:48 rman.log
-rwxr--r--. 1 oracle oinstall 515 Sep 9 14:45 setEnv.sh
-rwxr--r--. 1 oracle oinstall 134 Sep 7 10:54 stop_all.sh

Gunzip – This command is user to unzip the original file size

[oracle@oracletest scripts]$ gunzip ramkumar.txt.gz
[oracle@oracletest scripts]$ ls -l
total 24
-rwxrwxrwx. 1 oracle oracle 42 Oct 21 01:49 ramkumar.txt
-rwxrwxr-x. 1 oracle oracle 1291 Oct 20 23:47 rman_bkp.sh
-rw-rw-r--. 1 oracle oracle 6979 Oct 20 23:48 rman.log
-rwxr--r--. 1 oracle oinstall 515 Sep 9 14:45 setEnv.sh
-rwxr--r--. 1 oracle oinstall 134 Sep 7 10:54 stop_all.sh
[oracle@oracletest scripts]$

 

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

Linux Link Commands

Linux Link Commands

Creating links is a kind of shortcut to access a file. Links allow more than one file name to refer to the same file.

There are two types of links :

  1. Hard Link
  2. Soft Link or Symbolic links

Hard Link

A hard link is one most power full links in the Linux system when we create a hard link to the file and then delete the file, we can still access the file using the hard link.

syntax : ln file_name link_name
Eg: ln ramkumar.txt ram

[oracle@oracletest scripts]$ ls -l
total 24
-rwxrwxrwx. 1 oracle oracle 42 Oct 21 01:49 ramkumar.txt
-rwxrwxr-x. 1 oracle oracle 1291 Oct 20 23:47 rman_bkp.sh
-rw-rw-r--. 1 oracle oracle 6979 Oct 20 23:48 rman.log
-rwxr--r--. 1 oracle oinstall 515 Sep 9 14:45 setEnv.sh
-rwxr--r--. 1 oracle oinstall 134 Sep 7 10:54 stop_all.sh
[oracle@oracletest scripts]$ ln ramkumar.txt ram
[oracle@oracletest scripts]$ ls -l
total 28
-rwxrwxrwx. 2 oracle oracle 42 Oct 21 01:49 ram
-rwxrwxrwx. 2 oracle oracle 42 Oct 21 01:49 ramkumar.txt
-rwxrwxr-x. 1 oracle oracle 1291 Oct 20 23:47 rman_bkp.sh
-rw-rw-r--. 1 oracle oracle 6979 Oct 20 23:48 rman.log
-rwxr--r--. 1 oracle oinstall 515 Sep 9 14:45 setEnv.sh
-rwxr--r--. 1 oracle oinstall 134 Sep 7 10:54 stop_all.sh
[oracle@oracletest scripts]$ cat ram
HI 
Hello
welcome to linux basic commands
[oracle@oracletest scripts]$ rm -rf ramkumar.txt
[oracle@oracletest scripts]$ ls -l
total 24
-rwxrwxrwx. 1 oracle oracle 42 Oct 21 01:49 ram
-rwxrwxr-x. 1 oracle oracle 1291 Oct 20 23:47 rman_bkp.sh
-rw-rw-r--. 1 oracle oracle 6979 Oct 20 23:48 rman.log
-rwxr--r--. 1 oracle oinstall 515 Sep 9 14:45 setEnv.sh
-rwxr--r--. 1 oracle oinstall 134 Sep 7 10:54 stop_all.sh
[oracle@oracletest scripts]$ cat ram
HI 
Hello
welcome to linux basic commands


 

Soft Link or Symbolic links

Soft link is another variety type of Linux link, But if we create a soft link of the file and then delete the file, we can’t access the file through the soft link, and the soft link becomes dangling

Syntax: ln -s file_name link_name

Eg: ln -s ramkumar.txt ram

Eg: ls -s sample.txt kar

[oracle@oracletest scripts]$ ln -s sample.txt kar
[oracle@oracletest scripts]$ ls -l
total 28
lrwxrwxrwx. 1 oracle oracle 9 Oct 21 23:12 ram -> sample.txt
-rw-rw-r--. 1 oracle oracle 49 Oct 21 23:12 ramkumar.txt
-rwxrwxrwx. 1 oracle oracle 42 Oct 21 01:49 ram
-rwxrwxr-x. 1 oracle oracle 1291 Oct 20 23:47 rman_bkp.sh
-rw-rw-r--. 1 oracle oracle 6979 Oct 20 23:48 rman.log
-rwxr--r--. 1 oracle oinstall 515 Sep 9 14:45 setEnv.sh
-rwxr--r--. 1 oracle oinstall 134 Sep 7 10:54 stop_all.sh
[oracle@oracletest scripts]$ cat ram
Good morning
How are you all
Take care
Bye Bye !
[oracle@oracletest scripts]$ rm -rf sample.txt
[oracle@oracletest scripts]$ ls -l
total 24
lrwxrwxrwx. 1 oracle oracle 9 Oct 21 23:12 ram -> sample.txt
-rwxrwxrwx. 1 oracle oracle 42 Oct 21 01:49 ram
-rwxrwxr-x. 1 oracle oracle 1291 Oct 20 23:47 rman_bkp.sh
-rw-rw-r--. 1 oracle oracle 6979 Oct 20 23:48 rman.log
-rwxr--r--. 1 oracle oinstall 515 Sep 9 14:45 setEnv.sh
-rwxr--r--. 1 oracle oinstall 134 Sep 7 10:54 stop_all.sh
[oracle@oracletest scripts]$ cat ram
cat: ram: No such file or directory

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

Linux search commands

Linux search commands

In Linux, we have four various types of search commands

  • Grep

Grep is an acronym that stands for Global Regular Expression Print.

Grep is a Linux command used to search for a string of characters in a specified file.

To Search a File:

Syntax: Grep match_string file_name

Eg: grep database sample1

To Search Multiple Files: 

To search multiple files with the grep command, insert the filenames you want to search, separated with a space character.

Syntax: grep match_string file_name file_name

Eg: grep database sample1 sample2 sample3
  • AWK

AWK this command  is used for pattern search and processing, scanning files line by line then performing specified actions on matching lines

Syntax: awk ‘{search options from to}’ file_name

Eg: $ awk '{print $2 "\t" $3}' file.txt
  • Locate

locate command and find command is used to search a file by name. But, the difference between both commands is that locating command is a background process and searches the file in the database whereas, find command searches in the file system. The locate command is much faster than the find command.

We have some options in locating search commands by locate -h (help cmd)
Search for entries in a locate database.

-A, --all only print entries that match all patterns
-b, --basename match only the base name of path names
-c, --count only print number of found entries
-d, --database DBPATH use DBPATH instead of default database (which is
/var/lib/mlocate/mlocate.db)
-e, --existing only print entries for currently existing files
-L, --follow follow trailing symbolic links when checking file
existence (default)
-h, --help print this help
-i, --ignore-case ignore case distinctions when matching patterns
-l, --limit, -n LIMIT limit output (or counting) to LIMIT entries
-m, --mmap ignored, for backward compatibility
-P, --nofollow, -H don't follow trailing symbolic links when checking file
existence
-0, --null separate entries with NUL on output
-S, --statistics don't search for entries, print statistics about each
used database
-q, --quiet report no error messages about reading databases
-r, --regexp REGEXP search for basic regexp REGEXP instead of patterns
--regex patterns are extended regexps
-s, --stdio ignored, for backward compatibility
-V, --version print version information
-w, --wholename match whole path name (default)
Syntax: locate {Options…..} (filename)

 Eg:  locate ramkumar.txt

[oracle@oracletest pfile]$ locate ramkumar.txt
/home/oracle/scripts/ramkumar.txt

  • Find

find command is one of the most powerful tools in Linux, It supports searching by file, folder, name, creation date, modification date, owner, and permissions.

By using the ‘-exec’

Syntax: find [where to start searching from]
[expression determines what to find] [-options] [what to find]

Eg: find ramkumar

Options :

-exec CMD: The file being searched which meets the above criteria and returns 0 
for as its exit status for successful command execution.

-ok CMD : It works same as -exec except the user is prompted first.

-inum N : Search for files with inode number ‘N’.

-links N : Search for files with ‘N’ links.

-name demo : Search for files that are specified by ‘demo’.

-newer file : Search for files that were modified/created after ‘file’.

-perm octal : Search for the file if permission is ‘octal’.

-print : Display the path name of the files found by using the rest of the criteria.

-empty : Search for empty files and directories.

-size +N/-N : Search for files of ‘N’ blocks; ‘N’ followed by ‘c’can be used to 
measure size in characters; ‘+N’ means size > ‘N’ blocks and ‘-N’ means 
size < 'N' blocks.

-user name : Search for files owned by user name or ID ‘name’.

\(expr \) : True if ‘expr’ is true; used for grouping criteria combined with OR or AND.

! expr : True if ‘expr’ is false.

 

 

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

Linux File Commands

Linux File Commands

File creating commands

Touch: This touch command is used to update the timestamps on existing files and as creating new files and empty files.

 

 

Vi: virtual editor vi filename.txt commands used to create a virtual editor

By pressing keys on the keyboard to perform an action in vi


Insert – a,I,o,u

  • :w! – Save the file but keep it open
  • :q! – Quit without saving:
  • :wq! – Save the file and quit

Cat: This cat command is mainly used to read files, But it can also be used to create new files.

 

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

Linux Basic Commands

Linux Basic Commands

BASIC COMMANDS

Hostname: Hostname command in Linux is used to find the DNS (Domain Name System)

Hostname a: This command is used to get the Domain Name of the host system

Hostname -d: This command is used to get the local domain

Hostname -i: This command is used to get the IP(network) addresses

Hostname –v: This command gives version number as output

Uname command: This command is used to display basic information about the operating system and hardware.

Uname -s:  This command is used to get the kernel name

Uname -r: This command is used to get kernel release

Uname -v: This command is used to get the kernel version

Uname -n: This command is used to get node name

Uname-a: This command is used to get shows all parameters

Uname -m: This command is used to get the hardware name

 

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

Linux Permission commands

Linux Permission commands

Every file and directory in your Linux system has the following 3 permissions defined for all the 3 owners discussed above.

Read: This permission give you the authority to open and read a file.

Write: The write permission on a directory gives you the authority to add, remove and rename files stored in the directory

Execute: In Windows, an executable program usually has an extension “.exe” and which you can easily run. Linux, you cannot run a program unless the execute permission is set. If the execute permission is not set, you might still be able to see/modify the program code(provided read & write permissions are set), but not run it.

Let’s see file permissions in Linux with examples:

ls – l  This list command will show the file permissions

[oracle@oracletest scripts]$ ls -l
total 24
-rw-rw-r--. 1 oracle oracle 42 Oct 21 01:49 kiruba.txt
-rwxrwxr-x. 1 oracle oracle 1291 Oct 20 23:47 rman_bkp.sh
-rw-rw-r--. 1 oracle oracle 6979 Oct 20 23:48 rman.log
-rwxr--r--. 1 oracle oinstall 515 Sep 9 14:45 setEnv.sh
-rwxr--r--. 1 oracle oinstall 134 Sep 7 10:54 stop_all.sh

So, Here we listed some files with permissions

r = read permission
w = write permission
x = execute permission
 = no permission

permissions with chmod command

We can use the chmod command which stands for change mode. Using the command, we can set permissions (read, write, execute) on a file/directory for the owner, group.

There are 2 ways to use the command

  • Absolute mode
  • Symbolic mode

Absolute(Numeric) Mode

In this mode file permissions are not represented as characters, we can give in a three-digit octal number.

NumberPermission TypeSymbol
0No Permission
1Execute–x
2Write-w-
3Execute + Write-wx
4Readr–
5Read + Executer-x
6Read +Writerw-
7Read + Write +Executerwx

Example: chmod three-digit octal number filename

chmod 777 kiruba.txt

we were given this permission to text file we can able to read, write and execute the specified file

 

Symbolic Mode

In the Absolute mode, we can change permissions for all 3 owners. In the symbolic mode, we can modify the permissions of a specific owner also make use of mathematical symbols to modify the Linux file permissions.

OperatorDescription
+Adds permission to a file or directory
Removes the permission
=Sets the permission and overrides the permissions set earlier.

The various owners are represented as –

User Denotations
uuser/owner
ggroup
oother
aall

Changing Ownership and Group:

changing the ownership of a file/directory we can use the following command

chown user filename

Eg: chown kiruba rman_backup.log

To change group-owner only, use the command

chgrp group_name filename

Eg: chgrp oracle rman.log

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

Oracle 19c Binaries and Database installation

Here , I am going to install 19c binaries database software, but I already moved the 19c software to my VM and i also unzipped it. Just I am running the ./runInstaller file as a oracle user.

Follow the steps to install 19c database software,

Step:1 in this window choose Set up Software only option and click Next. It means that we are only installing the software.

 

 

 

Step:2 The second page asks for whether we are installing single instance database or RAC Installation, choose single instance db installation and click Next.

Step:3 Here we have to choose the type of the edition we are going to install,either Enterprise edition or Standard Edition 2,choose Enterprise edition and click Next.

 

Step:4 Then it asks for Oracle base location, choose ‘/u01/app/oracle’ as location and then click Next.

 

Step:5 Choose inventory location(/u01/app/oraInventory) and oraInventory group as oinstall.

 

Step:6 in this window select OSDBA , OSOPER , OSBACKUPDBA , OSDGDBA , OSKMDBA , OSRACDBA group as oinstall and proceed further.

Step:7 It shows for root script execution configuration ,here don’t choose any of the option go to the next window.

Step:8 This window asks to perform the prerequisite checks, for us two of the checks completed with warning. click Next.

Step:9 Yes we have completed all the steps this is the summary page of our software installation, check the details if it is correct proceed further.

Step:10 Our 19c software installation is in progress.

Step:11 When the software is in progress,you have to run the following two scripts as “root” user.

Step:12 The oracle 19c software was installed successfully.

Step:13 Previously we have installed the 19c software, we are proceeding with the database creation. Using dbca create the database, choose create a database option and click Next.

Step:14 In this window choose advanced configuration.

Step:15 choose database type as oracle single instance database and you have to choose a template for your database. here I choose general purpose or transaction processing as a template for my db.

Step:16 In this specify the global database name and Sid ,it is nothing but the name you give to your database.

Step:17  We have to choose the attributes for your database, either we can use default storage attributes or you can specify the customized attributes.

Step:18 you have to enable the Fast Recovery Area option it is used to recover your database, then click Next.

Step:19 create a new listener, enter the listener name and port number for your listener, it very important to configure a listener for your db.

Step:20 configure the oracle data vault option if you want. it helps us to protect our application data by providing powerful security controls.

Step:21 it asks for storage option either we want to use ASMM or MSMM.I am choosing Automatic Shared Memory Management and set the required SGA,PGA values.

Step:22 select use Unicode (AL32UTF8) character set and choose National character set, default language, default territory as follows,

National character set :AL16UTF16

Default language: American

Default territory: United states

Step:23 Select the management option as ‘configure Enterprise Manager (EM) database express check box.

Step;24 Create the password credentials for your db, here I use the same administrative passwords for all accounts.

Step:25 We have completed all the above mentioned configurations, we have yet one more step left to create a database. Choose the create database check box.

Step:26 check with all the configurations are correctly configured and proceed further.

Step:27 After that the database creation is in progress.

Step:28 we have successfully completed the database and we can now connect to our database. Here I have connected to my db and checked the name, open_mode of my database.

Thank you for giving your valuable time to read the above information.
If you want to be updated with all our articles send us the Invitation or Follow us:
Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter : https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8