View video tutorial

ORACLE Query From DB

ORACLE

To Query from the database you need to connect to the Oracle Container database(CDB) or Plugable Database(PDB).

Update in progress and will be completed shortly.

Thanks for being with us.

Step 01: As Admin Set the container to plugable database, Set writable, Login as user.

Open Command Line Interface Window as a Administrator, now issue command sqlplus

Note**: As Administrator set the container from CDB$ROOT to pluggable database (orclpdb)
C:\Users\devi>sqlplus

SQL*Plus: Release 12.2.0.1.0 Production on Wed Mar 30 21:56:44 2022

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Enter user-name: sys as sysdba
password:******

Note**: As Administrator Set database to pluggable database;
SQL> alter session set container=orclpdb;

Session altered.

Note**: As admin change con_name mode from MOUNTED to READ/WRITE if not already;
SQL> alter pluggable database open;

Pluggable database altered.

Note**: Now Login to hr to work with
SQL> conn hr/hr@ORCLPDB
Connected.
SQL>exit;

Enter user-name: hr@orclpdb
Enter password:  hr
Last Successful login time: Wed Mar 30 2022 23:34:03 +06:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> select * from departments;

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
           10 Administration                        200        1700
           20 Marketing                             201        1800
           30 Purchasing                            114        1700