Commonly Used Oracle Database Command

1) Unlocking User Account in Oracle

SQL> Alter user account unlock;

Note: in the above command needs to be substituted by the user account you want to unlock.

2)Adding Datafile to tablespace from Oracle.

SQL> ALTER TABLESPACE ADD DATAFILE ''
SIZE 5000M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M;

= Tablespace name in CAPS
= Destination of datafile (Ex: /oracle/PRD/sapdata1/data_7/..)
Note: Data file added through oracle should be in correct sequence to previous one.

Also You can use BRTOOLS to do the same.

3) To Find all the datafiles of a tablespace / list of datafiles for tablespace:

SQL> select file_name from dba_data_files where tablespace_name='';

4) To get the number of active sessions in Oracle

SQL> select count(*) from v$session where status ='ACTIVE';
or
SQL> select count(*) from v$session;

5) Following command gives you the size of oracle database in GB

SQL> Select sum(bytes)/1024/1024/1024 from dba_data_files;

0 Response to "Commonly Used Oracle Database Command"

Post a Comment