0% found this document useful (0 votes)
71 views

Account in Oracle: Commonly Used Oracle Database Command

This document provides instructions for common Oracle database administration tasks like unlocking user accounts, adding datafiles to tablespaces, finding datafile information, checking active session counts, determining database size, and shutting down the database. It includes the SQL commands needed to unlock user accounts, add datafiles, find datafile names and tablespace information, check active session counts, and get the total database size. It also outlines the steps to shutdown the database, including checking the database open mode and backup status, ending any backups, and forcing an immediate shutdown.

Uploaded by

satyavaninaidu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

Account in Oracle: Commonly Used Oracle Database Command

This document provides instructions for common Oracle database administration tasks like unlocking user accounts, adding datafiles to tablespaces, finding datafile information, checking active session counts, determining database size, and shutting down the database. It includes the SQL commands needed to unlock user accounts, add datafiles, find datafile names and tablespace information, check active session counts, and get the total database size. It also outlines the steps to shutdown the database, including checking the database open mode and backup status, ending any backups, and forcing an immediate shutdown.

Uploaded by

satyavaninaidu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Commonly Used Oracle Database Command 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; Database Shutdown Process - Oracle 1. Connect to O/S (UNIX) using ora(SID) 2. Connect database #sqlplus "/as sysdba" 3. Check database name and database open mode SQL) select name, open_mode from v$database; 4. Check database backup status using following command SQL) select * from v$backup; If status in not active then you may shutdown database using command SQL) shutdown immediate If status is active state then first cancel backup using command SQL) alter database end backup; after successful execution of this command database can be shutdown using command

SQL ) shutdown immediate; 5. Check any backint process in O/S level using command $ps -ef grep backint grep ora(SID) 6. If there exists any process kill using following command #kill -9 (PID)

You might also like