Search results

How to check if port is in use on Linux or Unix ?

How do I determine if a port is in use under Linux or Unix-like system? How can I verify which ports are listening on Linux server?

It is important you verify which ports are listening on the server’s network interfaces. You need to pay attention to open ports to detect an intrusion. Apart from an intrusion, for troubleshooting purposes, it may be necessary to check if a port is already in use by a different application on your servers. For example, you may install Apache and Nginx server on the same system. So it is necessary to know if Apache or Nginx is using TCP port # 80/443. This quick tutorial provides steps to use the netstat, nmap and lsof command to check the ports in use and view the application that is utilizing the port.

How to check the listening ports and applications on Linux:
  • Open a terminal application i.e. shell prompt.
  • Run any one of the following command:

sudo lsof -i -P -n | grep LISTEN 
sudo netstat -tulpn | grep LISTEN
sudo nmap -sTU -O IP-address-Here
Let us see commands and its output in details.

Option #1: lsof command

The syntax is:
$ sudo lsof -i -P -n
$ sudo lsof -i -P -n | grep LISTEN
$ doas lsof -i -P -n | grep LISTEN ### [OpenBSD] ###

eg o/p:

sshd    85379     root    3u  IPv4 0xffff80000039e000      0t0  TCP (LISTEN)

  • sshd is the name of the application.
  • is the IP address to which sshd application bind to (LISTEN)
  • 22 is the TCP port that is being used (LISTEN)
  • 85379 is the process ID of the sshd process

Option #2: netstat command

You can check the listening ports and applications with netstat as follows.

Linux netstat syntax

$ netstat -tulpn | grep LISTEN

FreeBSD/MacOS X netstat syntax

$ netstat -anp tcp | grep LISTEN
$ netstat -anp udp | grep LISTEN

OpenBSD netstat syntax

$ netstat -na -f inet | grep LISTEN
$ netstat -nat | grep LISTEN

Option #3: nmap command

The syntax is:
$ sudo nmap -sT -O localhost
$ sudo nmap -sU -O ##[ list open UDP ports ]##
$ sudo nmap -sT -O ##[ list open TCP ports ]##

You can combine TCP/UDP scan in a single command:
$ sudo nmap -sTU -O

Difference between SQL and NoSQL | SQL vs NoSQL | SQL Vs NoSQL with Examples

Difference between SQL and NoSQL  :

From last 5 years the total data in the world is tripled and data is growing so rapidly.In this world of data there is need to change in database technology also.Traditionally we are using SQL as database language which is working with the  structured data only.Now a days we need to work on non structured data also so to handle this kind of Structured as well as non structured data NoSQL database comes to the picture.It is nothing but so called Big Data Technology which is growing widely day by day.Now a days NoSQL databases widely used in different businesses.In this article i will try to explain difference Between SQL and NoSQL.

SQL Databases :

SQL stands for “Structured Query Language”;in the name itself you will get idea that SQL database contains Structured data.SQL is traditional language used to manage data in different database management systems like Oracle,Mysql,MSSQL e.t.c.SQL Databases are also known as Relational Database Management System(RDBMS) in which tables are connected with each other with specific relation you can say it with constraints and joins.SQL Databases are integral part of any project because data which is relational data needs to be used in every project.
“SQL Databases are Heart of Any Application or Software or System…”
Examples Of SQL Databases :
1.MS SQL :
MS SQL is also known as Microsoft SQL which is well known SQL database which is used by so many mid and large scale applications.Microsoft SQL is very widely used database management system throughout the world to create not only stand-alone software but also distributed web applications.
Following are Advantages of MSSQL:
1.High Speed
2.Large data volume
3.Low code apporach
4.Concurency control mechanism
5.Easy Tuning
6.Easy Reporting and Analytics facility
There are other SQL databases also.If you want to check the information about different SQL databasesClick on Database names below:
1.Oracle :One of the most popular SQL database

2.Mysql:Popular and Open Source Database

3.MSSQL:Microsoft Supported Database

NoSQL Databases :

NoSQL is unstructured database which is referring as “Non Relational” or “Non SQL” database.It means the database.The storage and retrieval of a data in NoSQL is modeled not in tabular format.NoSQL does not involve a structured Query Language or SQL.NoSQL Databases are used in many large scale distributed databases.The websites like google,twitter,facebook uses big data technology rather than using the traditional technology.
Difference Between SQL and NoSQL
NoSQL database is nothing but Non Relational and Non SQL database
Following are some advantages of NoSQL database:
1.More Scalable than traditional database
2.High Performance
3.Faster than traditional database
4.Worked with rapidly changing datatypes-Structured,Non-Structured,unstructured,Polymorphic data.
5.Less ETL need
These are some aadvatages of NoSQL database.Lets discuss one example of NoSQL database.
There are following NoSQL databases:
MongoDB,CouchDB,Redis,ccumulo,Cassandra, Druid, HBase, Vertica, SAP HANA. Document: Apache CouchDB, ArangoDB, Clusterpoint, Cosmos DB, HyperDex, IBM Domino, MarkLogic, OrientDB, Qizx, RethinkDB.
MongoDB :
MongoDB is one of the popular NoSQL Databases.It stores data in JSON  documents. It is non-relational database which has dynamic schema.
Following are some Advantages of MongoDB:
MongoDB is good database for performance tuning as it eliminates lot of complex queries and complex join structure.
2.Scalable :
It is horizontally scalable i.e. you can reduce the workload by increasing the number of servers in your resource pool instead of relying on a stand alone resource.
It is easy to use for both developers and administrators. This also gives the ability to shard database.
4.Dynamic Schema:
Its gives you the flexibility to evolve your data schema without modifying the existing data.
This is one of the best NoSQL databases.

Difference between SQL and NoSQL  :
Following is Difference between SQL and NoSQL databases in Tabular format:
(Author-Abhisek Bose)
Examples: DB2, MySQL, Oracle, Postgress, SQL serverExamples: CouchDb MongoDB, RavenDb, Redis,  Cassandra, Hbase, Neo4j,BigTable
These are called RDBMS.These are called not only SQL database.
Based on ACID properties i.e.   Atomicity, Consistency, Isolation and DurabilityBased on CAP properties i.e. ( Consistency, Availability and Partition tolerance )
These are table based database i.e. the data
are stored in a table with rows and columns.
These databases are document based, key-value pairs or graph based etc.
These are standard schema based (predefined schema)These are not standard schema based( dynamic schema)
These are scaled vertically. Load can be managed by increasing CPU, RAM etc in the same server.These are scaled horizontally. A few servers can be added to manage large traffic.
Not preferred for large/big data sets.Preferred for large/big data sets.
Preferred for complex query executionNot preferred for complex query execution

Hope you like this article of Difference between SQL and Nosql.

ORA-12154: TNS:could not resolve the connect identifier specified

ORA-12154: TNS:could not resolve the connect identifier specified :

While working with different  functionalities ; the oracle developers are facing different types of errors.The most common error coming while connecting database is ORA-12154: TNS:could not resolve the connect identifier specified .In this article i will explain how ORA-12154 error will solve and why this error will come.This is the most common error and most searched error by developers and DBAs.This error will come while trying to establish connection first time.So this is most common error in oracle.
“ORA-12154 error has been searched on google approximately 1 lakh times per month”

The error is displayed in the above images.

Why ORA-12154 error will come?

ORA-12154 error is very common error related to ‘tnsnames.ora’ file.This error will come when oracle is unable to locate the service name specified in ODBC data source.ORA-12154 error will come at local service when application tries to connect with remote server.This error will come in following situations :
Situation 1 :
When Application tries to connect with database.
Situation 2 :
When one database will try to  connect with other database via database link.
Situation 3 :
Just after installing the oracle database and tries to connect system user.
In above situations this error will occur.There should be multiple reasons for this error.The following should be the reasons of this error. So If this error will come then DBA or developer needs to do first check i.e. tnsnames.ora.
Following needs to check to resolve this error :
1.The Service name entry is missing from tnsnames.ora
Make sure that the service name we are using is the same for which the listener is listening for.
2.The Entry is wrong in tnsnames.ora file
3.tnsnames.ora is in wrong ORACLE_HOME location
4.Your Service name might have an alias.Check that in global entries as well as local entries.

Location for tnsnames.ora :

5.Check for global_name settings with SQL.
Select *  from global_name; 
This query value should match the init.ora parameters db_name and db_value. If the value is not matching you can change that value using alter command of database.
Alter Database Rename global_name to ‘New Name’;

Resolution of Error :

ORA-12154: TNS:could not resolve the connect identifier specified
For Local naming : (tnsnames.ora file issue)
  1. Kindly check the tnsnames.ora file is present in specified location or not.
  2. Check that tnsnames.ora is accessible to database
  3. The Service name which are using should present as connect identifier in tnsnames.ora
  4. Make sure that tnsnames is listed as one of the values of the names.directory_path parameter in the sqlnet.ora Oracle Net profile.
  5. Check for the syntax errors in tnsnames.ora file.If there is error in this file then this file is unusable.

TNSNAMES.ORA file sample :

Database_name =
(ADDRESS = (PROTOCOL = TCP)(HOST = my_host)(PORT = 1521))
(SERVICE_NAME = Database_name)
If you are using instant client method rather than tnsnames.ora file then database attribute name needs an connect URL rather than service name.
Syntax :

Where host is the host_name or ip address and port will be the oracle port and service name is the service name specified.
For Directory Naming :
1.LDAP must be there in names.directory_path parameter of sqlnet.ora file.
2.Verify LDAP directory server is up and accessible.
3.Verify that service name and database name is configured in directory or not.
I have specified some ways to resolve the error ‘ORA-12154: TNS:could not resolve the connect identifier specified’ which is frequent error on Oracle. Hope you like this article.If you like this article don’t forget to share it.

Oracle 18c advantages and disadvantages

Oracle 18c advantages and disadvantages :

In previous articles i have explained about the new age database system i.e Oracle 18c database version.We discussed about the advantages as well as disadvantages of this new age database and DBA impact as well.In this article i will try to explain the roadmap of the new release of oracle and how the oracle new versions will be released  step by step.Oracle has released the new database version which is worlds first autonomous database and has automated different tasks like performance tuning tasks and operational tasks in this new version.Oracle has released 18c version but it has also subversions in the version.Oracle 18c Release is not a single release;it has different sub-releases.In this article i will try to explain the roadmap of how oracle will release the subversions of Oracle 18c version and how it will impact of different database developers and DBAs.In my previous article i have explained the advantages as well as disadvantages of oracle 18c database.In this article also i will try to Oracle 18c advantages and disadvantages. I will try to explain the plans of future oracle releases which has explained by CTO of oracle Larry Ellison.

Oracle Releases and its roadmap :

Oracle has announced the new version of Oracle database in october 2017.If we studied the roadmap of previous versions of oracle releases just like that the new version will release by releasing the versions in different fragments. kindly check the diagrammatic representation of Oracle releases happened up to now.
Oracle 18c advantages and disadvantages
Oracle 11 c version has been launched at 2007 and still oracle is supporting the oracle 11g release and different patches are still released for oracle 11 g.The overall life set for oracle 11g version by oracle s up to 2021 oracle will support oracle 11g.If you see now a days oracle 12c releases support is started and oracle has released Oracle version oracle wants to release version but  oracle has chosen the new way to of oracle release which will indicate the release year in oracle version.Now a days industry is following agile methodology and cloud computing is booming.Oracle has added bunch of new features and come up with new Database which is worlds first autonomous database.So Release which is originally planned as become Oracle 18c in which version will indicate the release year and will become Oracle 19 c which will be launched in 2019.And the last release of Oracle 12.2 will become Oracle 20.In between the 3 major releases i.e. Oracle 10g,Oracle 11 g and Oracle 12 c the new release is Oracle 18 c which will come up with bunch of new features like:
3.Advanced Compression
5.In Memory
6.Advanced Indexing using Artificial Intelligence
Oracles change to annual releases addresses both the delay in getting new features out and amount of changes done in new versions.The new release also changes the way of releasing the patches which will introduce new terminology to DBAs and developers.The sample version  of how the releases will happened are shown in following diagram :
Oracle 18c
The major release of Oracle will be 18c and There will be 3 Release updates of oracle 18c which are 18.1 to 18.3.The third tier is nothing but the release update revision of the RU versions.Because of this DBAs and developers will quickly identify the versions of database.Because of the smaller number of changes in upgrade it will be simple for DBAs to upgrade and doing patching and DBAs and developers will solve problems fast.

Oracle 18c Advantages :

Oracle 18c has come up with lot of Oracle 18c advantages and disadvantages.It is worlds first autonomous database which will remove human interventions which will remove the complexity of database operations.
1.Self Driving database
2.Reduces the complexity of database
3.Reduces Human Efforts
4.Upgrades and patching is easy
5.Automated Performance Tuning of database
6.Reduces operational cost of database
7.Highly Relible and secure database
8.Most efficient consumption of resources.
9.Reduces the human interventions
These are some advantages of Oracle 18c.It is self driving,reliable and highly secured database.

Oracle 18c Disadvantages :

Each coin has two sides so the oracle 18 c will come up with bunch of disadvantages also.This technology is totally new technology so that the following kind of DBAs which are doing only day to day patching activities needs to be frightened because lot of things will do automatically in this version of oracle.
1.Operational DBA Checking backups
2.DBAs who are only checking storage
3.DBAs not involved in Performance Tuning activities
4.DBAs doing only installation and patching activities manually
5.DBAs who are creating duplicate environments
These are some disadvantages of this new agee database named oracle 18c.I  tried to explain the Oracle 18c advantages and disadvantages in single article.Hope you will like this article.

What is New in Oracle 18c?

1.Tables in 18c will be created with no constraints.The not null constraint is mandatory for the not null columns.
2.You don’t need to create partition at the time of table creation for Performance Tuning.
3.Provisioning time for new instance is 10-20 secs.
4.Primary key,Foreign keys are defined with RELY DISABLE NOVALIDATE.
5.There is no Physical Structure like indexes.
6.Parallel Statement Queuing is enabled and cloud interface allows you to monitor it.
7.Query result cache is always enabled so second time query response time fast.
8.You can not create indexes and partitioning table strategies.The Artificial Intelligence Engine is responsible for creating it.