Create Database In Sqlplus

Inside this directory locate the SQL.Plus utility and from here you can launch this tool. Step 3: Connect to the Database using SQL.Plus. In Oracle, you can connect to the database by using Users also known as Schemas. There are several types of users in the Oracle database. $ sqlplus Enter User: / as sysdba SQLstartup nomount. Step 4: Give the create database command Here I am not specifying optional setting such as language, characterset etc. For these settings oracle will use the default values. I am giving the bare minimum command to create the database to keep it simple. Creating a database can also erase information in an existing database and create a new database with the same name and physical structure. Creating a database includes the following operations: creating new datafiles or erasing data that existed in previous datafiles.

SQLplus is a command line utility to manage Oracle Database. It is a powerful tool that all Oracle database administrator must have. In this tutorial, I am going to install the SQLplus Utility 9.5 in Windows 10. The new version of sqlplus 19.5 is available alongside the new Oracle Database 19c. On the previous article, I have shown how to install Oracle Database 19c on CentOS 8.

Create

The CREATE DATABASE statement must run in autocommit mode (the default transaction management mode) and is not allowed in an explicit or implicit transaction. You can use one CREATE DATABASE statement to create a database and the files that store the database. SQL Server implements the CREATE DATABASE statement by using the following steps.

Once the connection is made between the client and the server using sqlplus, we can perform many database administration, query, user management and so on.

Steps to Install SQLplus on Windows 10

Step 1. Install Oracle Instant Client

Create database in sqlplus

How To Create Database In Sqlplus

Before we can install and run the sqlplus utility, we need to configure the Oracle Instant Client Utility first. So, I would suggest you to read this article to Install Oracle Instant Client 19.5 on Windows 10.

Create Database In Sqlplus

Step 2. Download SQLplus software package

Once you’ve setup the instant client correctly, now we need to download the sqlplus package from the following link

So this is the sqlplus software package for Windows 10 64 bit edition.

Create

Step 3. Install the Package

From the previous step, you should have a zip file called : instantclient-sqlplus-windows.zip. Now extract the file to your instant client directory you created on the Step 1. Here is the screenshot of my instant client folder looks like:

Database

Notice that there is sqlplus application in this instant client folder. Now we are ready to go.

How to Connect to Oracle Database via SQLplus Command

In the following example, I will show you how to connect to remote oracle database via sqlplus command. Before we connect, we need to configure the user in the Oracle database. Skip the user creating step if you already have a database user that can connect to the pluggable database.

Create a new user

Create Database In Sqlplus

In the database server host, we need to connect to the database using sqlplus in order to create a new user for the pluggable database. In this case, my container database called cdb1 and the pluggable database is called pdb1.

Login as oracle user and then execute this command.

Now let’s show the current database we connected

As you can see now we are connected to the root database. We need to switch to the pluggable database (pdb1).

Now check again using show command

As you can see, now we are connected to PDB1, the pluggable database. Next, we need to open the database so we can create a new user for it.

Create Database In Sqlplus

Then, we can create a new user

The command will create a new user called “manjaro” and password “thePassword”. After that, we need to grant “CONNECT” privileges to manjaro user so user can connect to the database. You can also add multiple roles to the new users. For example:

Create A Database

Done. Please note that this new user only exist in the pluggable database. So, to connect, we need to specify the username as manjaro@pdb1 in the Connect command.

Connect to the Database

Ok, so now we have a new user setup in the pdb1 database. Let’s try to connect to the database.

Create Database Sqlplus Oracle 11g

From the other computer (in this case Windows 10 where sqlplus is installed using above steps), open command prompt and execute the following command:

Create Pluggable Database In Sqlplus

Output:

Where:

  • 192.168.100.50 is the Oracle database host IP address
  • pdb1.griyaku.lan is the Oracle database service

You can check your Oracle database services and instances with the following command. Make sure you execute this command on the database host as oracle user.

Create Database Statement Sqlplus

Output:

Thank you for reading this how to install sqlplus 19.5 on Windows 10. I hope you enjoy it and leave us comments for any queries. Cheers.