SQL commands run on Oracle Database using sqlplus, sqldeveloper |
How to check user exists or not on Oracle DATABASE?
select username from DBA_USERS;
How to search for specific user in the Oracle Database?
SELECT username from DBA_USERS where username like '%DEMO%';
How do you know RCU users account_status expired?
set pagesize 100 column username format a25 Select username, account_status from dba_users where username like '%DEMO%' and ACCOUNT_STATUS <> 'OPEN';
How do you reset the DB users account_status expired to OPEN?
ALTER USER DEMO_OPSS IDENTIFIED BY welcome1;
Note this will work for any Oracle DB user.
alter session set container=MYPDB1;
How to check the number of PDBs present in CDB?
How to restart a PDB?
To do this first you need to connect to your CDB and then issue the following SQL command in sqlplus promptalter pluggable database PDBNAME close immediate; alter pluggable database PDBNAME open;
How to check the number of processes running in your Oracle Database?
show parameter processes
How to check the number of OPEN cursors Configured?
show parameter open_cursors
How to shutdown the Oracle Database from Oracle SQLPLUS prompt?
shutdown immediate or shut immediateNote that never leave shut command without any argument which may leads you to wait indefinite period of time.
How to clear the multiple break lines in the SQLPLUS? or How you can set page size?
set pages 200Here 200 is random value you can change according to your need.
dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname DEMODB -sid DEMODB -sysPassword manager -systemPassword manager -emConfiguration none -datafileDestination /opt/oradata/ -redoLogFileSize 100 -asmsnmpPassword manager -diskGroupName data -characterSet AL32UTF8 -totalMemory 2048
How to resolve the QUOTA for a user on tablespace?
Issue # Exception was thrown: ORA-01950: no privilleges on tablespace 'USERS'sqlplus / as sysdba2. This will be in CDB we need to switch to our PDB that is ORCLPDB1
alter session set container=ORCLPDB1;3. allocate the quota space for the USERS tablespace for your user as sample showing here as demouser
alter user demouser QUOTA 100M on USERS;that's it resolved!
How do you know Oracle APEX instalbashled version?
select VERSION from dba_registry where COMP_NAME='Oracle Application Express';
How do you know the APEX installed on CDB with PDB?
Login to the sys as sysdba into your CDB run the following SQL query:select COMP_ID, VERSION, STATUS from CDB_REGISTRY where COMP_ID='APEX' order by CON_ID; COMP_ID VERSION STATUS ------------------------------ ------------------------------ ----------- APEX 20.1.0.00.13 VALIDTo know which PDB contains this APEX installed
select r.COMP_NAME, r.VERSION, c.NAME, c.CON_ID from CDB_REGISTRY r, V$CONTAINERS c where r.CON_ID=c.CON_ID and r.COMP_ID='APEX' order by CON_ID;