Basic command for db
Oracle Database Administration: A Guide to Basic Commands
Oracle Database is a powerful relational database management system widely used in enterprise environments. As an Oracle Database administrator (DBA), understanding and executing basic commands is essential for managing databases effectively. In this guide, we will explore some fundamental commands used in Oracle Database administration, along with their explanations.

Environment Setup and Connectivity
lsnrctl start
This command starts the Oracle listener, which listens for incoming client connection requests to the database.
. oraenv:
This command is used to exchange between different Oracle database environments. It sets the environment variables to match the specified database.
sqlplus / as sysdba: This command connects to the Oracle database as a sysdba (system database administrator), providing elevated privileges for database management.
startup: This command starts the Oracle database instance.
alter pluggable database all open: This command opens all pluggable databases (PDBs) within the container database (CDB).
show pdbs: This command displays a list of all pluggable databases within the container database.
ping database_name: This command is used to test the connectivity to the specified database using TNS (Transparent Network Substrate) protocol.
show con_name: This command displays the name of the current container database.
telnet your_ip your_port: This command tests the network connectivity to the specified IP address and port number.
sqlplus sys/test123@cbs as sysdba:
This command connects to the specified database (cbs) using a username/password combination and sysdba privileges.
vi /etc & vi /etc/oratab:
These commands open the specified files for editing using the vi text editor, which is commonly used in Unix-based systems.
Managing Pluggable Databases (PDBs)
- alter pluggable database all open: This command opens all pluggable databases within the container database.
- create pluggable database pdb4 from pdb3: This command creates a new pluggable database (pdb4) based on an existing one (pdb3).
- alter pluggable database pdb4 close immediate: This command closes the specified pluggable database immediately.
- drop pluggable database pdb4 including datafiles: This command deletes the specified pluggable database and its associated datafiles.
Troubleshooting
- ORA-01078: This error indicates a failure in processing system parameters.
- LRM-00109: This error indicates that the Oracle parameter file (init.ora) could not be opened.
To resolve these issues, you may need to check the Oracle parameter file location and set the ORACLE_SID environment variable accordingly.
← PostgreSQL Blog