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 :
Hard Link
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.
[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 Hellowelcome 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:
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)
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:
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.
Number
Permission Type
Symbol
0
No Permission
—
1
Execute
–x
2
Write
-w-
3
Execute + Write
-wx
4
Read
r–
5
Read + Execute
r-x
6
Read +Write
rw-
7
Read + Write +Execute
rwx
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.
Operator
Description
+
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
u
user/owner
g
group
o
other
a
all
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
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:3Here 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