You are on page 1of 16

1.

) database users like sys,sysadmin


SYS

This account can perform all administrative functions. All base (underlying) tables and views for the
database data dictionary are stored in the SYS schema. These base tables and views are critical for the
operation of Oracle Database. To maintain the integrity of the data dictionary, tables in the SYS schema
are manipulated only by the database. They should never be modified by any user or database
administrator. You must not create any tables in the SYS schema.
The SYS user is granted the SYSDBA privilege, which enables a user to perform high-level
administrative tasks such as backup and recovery.

SYSadmin:
sys admin can perform any operation on server.

2.)what is sql plus commands?

SQL*Plus is a command-line tool that provides access to the Oracle RDBMS. SQL*Plus enables you to:
•Enter SQL*Plus commands to configure the SQL*Plus environment
•Startup and shutdown an Oracle database
•Connect to an Oracle database
•Enter and execute SQL commands and PL/SQL blocks
•Format and print query results

What is host name?

Host name is name of the system that is connected in database server


The name of a computer. The maximum length of a computer name can be 1024 bytes

what is port number?


In computer networking, a port is a number assigned to uniquely identify a connection endpoint and to
direct data to a specific service.
A port number is always associated with an IP address  of a host and the type of transport protocol
used for communication.

A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535. 

Notable well-known port numbers


Number Assignment
20 File Transfer Protocol (FTP) Data Transfer
21 File Transfer Protocol (FTP) Command Control
22 Secure Shell (SSH) Secure Login
23 Telnet remote login service, unencrypted text messages
25 Simple Mail Transfer Protocol (SMTP) email delivery
53 Domain Name System (DNS) service
67, 68 Dynamic Host Configuration Protocol (DHCP)
80 Hypertext Transfer Protocol (HTTP) used in the World Wide Web
110 Post Office Protocol (POP3)
119 Network News Transfer Protocol (NNTP)
123 Network Time Protocol (NTP)
143 Internet Message Access Protocol (IMAP) Management of digital mail
161 Simple Network Management Protocol (SNMP)
194 Internet Relay Chat (IRC)
443 HTTP Secure (HTTPS) HTTP over TLS/SSL
546, 547 DHCPv6 IPv6 version of DHCP

The port numbers are divided into three ranges: the well-known ports, the registered ports, and
the dynamic or private ports.

The well-known ports are those numbered from 0 through 1023.


The registered ports are those from 1024 through 49151.
The dynamic or private ports are those from 49152 through 65535

3) what is listner?
Oracle Net Listener is a separate process that runs on the database server computer. It
receives incoming client connection requests and manages the traffic of these requests to
the database server

The Listener Control utility enables you to administer listeners. You can use its commands
to perform basic management functions on one or more listeners. Additionally, you can
view and change parameter settings. The basic syntax of Listener Control utility
commands is as follows: lsnrctl command [listener_name]
What is alias?
alias command instructs the shell to replace one string with another string while executing the
commands. 
When we often have to use a single big command multiple times, in those cases, we create
something called as alias for that command. Alias is like a shortcut command which will have
same functionality as if we are writing the whole command. 

Syntax:
alias [-p] [name[=value] ... ]
  
Creating an alias : 

Syntax: 
alias name="value"

Creating an Unalias : Removing an existing alias is known as unaliasing. 


Syntax: 
unalias [alias name]
Options for Alias command: 
•-p option : This option prints all the defined aliases is reusable format. 
Syntax: 
alias -p

•–help option : It displayes help Information. 


Syntax: 
alias --help
How to remove an alias? 
We use unailas command for this purpose. 
SHELL is a program which provides the interface between the user and an operating system.
When the user logs in OS starts a shell for user. Kernel controls all essential computer
operations, and provides the restriction to hardware access, coordinates all executing utilities,
and manages Resources between process. Using kernel only user can access utilities provided
by operating system.
Types of Shell:
•The C Shell –
Denoted as csh
Bill Joy created it at the University of California at Berkeley. It incorporated features such
as aliases and command history. It includes helpful programming features like built-in
arithmetic and C-like expression syntax.

In C shell:

Command full-path name is /bin/csh,

Non-root user default prompt is hostname %,

Root user default prompt is hostname #.

•The Bourne Shell –


Denoted as sh
It was written by Steve Bourne at AT&T Bell Labs. It is the original UNIX shell. It is faster
and more preferred. It lacks features for interactive use like the ability to recall previous
commands. It also lacks built-in arithmetic and logical expression handling. It is default
shell for Solaris OS.

For the Bourne shell the:

Command full-path name is /bin/sh and /sbin/sh,

Non-root user default prompt is $,

Root user default prompt is #.

•The Korn Shell


It is denoted as ksh
It Was written by David Korn at AT&T Bell LabsIt is a superset of the Bourne shell.So it
supports everything in the Bourne shell.It has interactive features. It includes features like
built-in arithmetic and C-like arrays, functions, and string-manipulation facilities.It is faster
than C shell. It is compatible with script written for C shell.

For the Korn shell the:

Command full-path name is /bin/ksh,

Non-root user default prompt is $,

Root user default prompt is #.

•GNU Bourne-Again Shell –


Denoted as bash
It is compatible to the Bourne shell. It includes features from Korn and Bourne shell.

For the GNU Bourne-Again shell the:

Command full-path name is /bin/bash,

Default prompt for a non-root user is bash-g.gg$

(g.ggindicates the shell version number like bash-3.50$),

Root user default prompt is bash-g.gg#.

The default editor that comes with the UNIX operating system is called vi (visual editor). Using
vi editor, we can edit an existing file or create a new file from scratch. we can also use this
editor to just read a text file.
Syntax:
vi filename

Input:
Output:
Modes of Operation in vi editor There are three modes of operation in vi:

•Command Mode: When vi starts up, it is in Command Mode. This mode is where vi


interprets any characters we type as commands and thus does not display them in the
window. This mode allows us to move through a file, and to delete, copy, or paste a piece of
text.
To enter into Command Mode from any other mode, it requires pressing the [Esc] key. If we
press [Esc] when we are already in Command Mode, then vi will beep or flash the screen.
•Insert mode: This mode enables you to insert text into the file. Everything that’s typed in
this mode is interpreted as input and finally, it is put in the file. The vi always starts in
command mode. To enter text, you must be in insert mode. To come in insert mode you
simply type i. To get out of insert mode, press the Esc key, which will put you back into
command mode.
•Last Line Mode(Escape Mode): Line Mode is invoked by typing a colon [:], while vi is in
Command Mode. The cursor will jump to the last line of the screen and vi will wait for a
command. This mode enables you to perform tasks such as saving files, executing
commands.
SQL JOIN
A JOIN clause is used to combine rows from two or more tables, based on a related
column between them.

Different Types of SQL JOINs


Here are the different types of the JOINs in SQL:

•(INNER) JOIN: Returns records that have matching values in both tables
•LEFT (OUTER) JOIN: Returns all records from the left table, and the matched
records from the right table
•RIGHT (OUTER) JOIN: Returns all records from the right table, and the matched
records from the left table
•FULL (OUTER) JOIN: Returns all records when there is a match in either left or
right table

       

 
INNER JOIN
This JOIN returns all records from multiple tables that satisfy the specified join condition. It is the
simple and most popular form of join and assumes as a default join. If we omit the INNER
keyword with the JOIN query, we will get the same output.
The following visual representation explains how INNER JOIN returns the matching records
from table1 and table2:

INNER JOIN Syntax


The following syntax illustrates the use of INNER JOIN in SQL Server:

1. SELECT columns    
2. FROM table1    
3. INNER JOIN table2 ON condition1    
4. INNER JOIN table3 ON condition2    

Table: Student
Table: Fee

We can demonstrate the INNER JOIN using the following command:

1. SELECT Student.admission_no, Student.first_name, Student.last_name, Fee.course, Fee.amount_p
aid  
2. FROM Student  
3. INNER JOIN Fee  
4. ON Student.admission_no = Fee.admission_no;  

This command gives the below result:


LEFT OUTER JOIN
The LEFT OUTER JOIN retrieves all the records from the left table and matching rows from
the right table. It will return NULL when no matching record is found in the right side table. Since
OUTER is an optional keyword, it is also known as LEFT JOIN.
The below visual representation illustrates the LEFT OUTER JOIN:

LEFT OUTER JOIN Syntax


The following syntax illustrates the use of LEFT OUTER JOIN in SQL Server:

1. SELECT column_lists  
2. FROM table1    
3. LEFT [OUTER] JOIN table2    
4. ON table1.column = table2.column;    
Example
We can demonstrate the LEFT OUTER JOIN using the following command:

1. SELECT Student.admission_no, Student.first_name, Student.last_name, Fee.course, Fee.amount_p
aid  
2. FROM Student  
3. LEFT OUTER JOIN Fee  
4. ON Student.admission_no = Fee.admission_no;  
This command gives the below result:
RIGHT OUTER JOIN
The RIGHT OUTER JOIN retrieves all the records from the right-hand table and matched
rows from the left-hand table. It will return NULL when no matching record is found in the left-
hand table. Since OUTER is an optional keyword, it is also known as RIGHT JOIN.
The below visual representation illustrates the RIGHT OUTER JOIN:

RIGHT OUTER JOIN Syntax


The following syntax illustrates the use of RIGHT OUTER JOIN in SQL Server:

1. SELECT column_lists    
2. FROM table1    
3. RIGHT [OUTER] JOIN table2    
4. ON table1.column = table2.column;    
Example
The following example explains how to use the RIGHT OUTER JOIN to get records from both
tables:

1. SELECT Student.admission_no, Student.first_name, Student.last_name, Fee.course, Fee.amount_p
aid  
2. FROM Student  
3. RIGHT OUTER JOIN Fee  
4. ON Student.admission_no = Fee.admission_no;  
This command gives the below result:

In this output, we can see that no column has NULL values because all rows in the Fee table are
available in the Student table based on the specified condition.

FULL OUTER JOIN


The FULL OUTER JOIN in SQL Server returns a result that includes all rows from both tables.
The columns of the right-hand table return NULL when no matching records are found in the left-
hand table. And if no matching records are found in the right-hand table, the left-hand table column
returns NULL.
The below visual representation illustrates the FULL OUTER JOIN:

FULL OUTER JOIN Syntax


The following syntax illustrates the use of FULL OUTER JOIN in SQL Server:

1. SELECT column_lists    
2. FROM table1    
3. FULL [OUTER] JOIN table2    
4. ON table1.column = table2.column;    
Example
The following example explains how to use the FULL OUTER JOIN to get records from both
tables:

1. SELECT Student.admission_no, Student.first_name, Student.last_name, Fee.course, Fee.amount_p
aid  
2. FROM Student  
3. FULL OUTER JOIN Fee  
4. ON Student.admission_no = Fee.admission_no;  

This command gives the below result:


In this output, we can see that the column has NULL values when no matching records are found in
the left-hand and right-hand table based on the specified condition.

You might also like