Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 9

SAP BASIS

Oracle Commands

useful for day to day work

INDEX
1. Start Database
2. Shut down Database
3. To know the database startup time
4. Find out user /schema name
5. To unlock user
6. To change password from os level
7. To check which tablespaces / datafiles are in backup mode
8. Tablespace in END Backup Mode
1 List files that are in hot-backup mode
9. To check which datafile belongs to which tablespace
10. Check parameter value from db level
11. Show user info including os pid
12. Create a temporary tablespace
2 Make temporary tablespace as Default
13. To Check and Change maxextents
14. Quick datafile health check
3 List controlfiles – Locations
4 Startup Database

STARTUP NOMOUNT :
Means only memory is allocated for instance and no controlfile or datafiles are
mounted. In this state controlfile can be created
STARTUP MOUNT :
Oracle server is reading control file information but data files are not mounted.
This state can be used in case of changing mode of datafiles i.e. offline, backup
etc.
STARTUP OPEN :
Default mode means memory is allocated, control and data files are read and open
db in consistent mode

5 Shutdown Database.

SHUTDOWN IMMEDIATE :
Oracler engine will not wait for sessions to be ended. All active transactions will be
rolled back and server will be down.
SHUTDOWN FORCE :
Not recommended to use – db may become inconsistent)
SHUTDOWN TRANSACTIONAL :
Will wait for all transactions to be ended and sessions will get terminated)
SHUTDOWN NORMAL :
Default option - will wait for all sessions, and transactions to be close)

6 To know the database startup time


7 Find out user /schema name

8 To unlock user

Alter user <username> account unlock;


Alter user SAPSR3 account unlock

9 To find out whether sap user is locked or not at db level.

(If value of Uflag = 0 means unlock)

Other values for uflag


10 To change password from os level 

Here, we need to update password of user id TPSPKWS same as TPSPNBM in client


100.

Following statement will give encrypted passwd of user TPSPNBM

Give below command followed by Commit statement; (Please remove “.” As it has given
here for not to execute command).
11 To check which tablespaces / datafiles are in backup mode

12 Table Space in END Backup Mode

Alter tablespace <TABLESPACE_NAME> end backup;

13 List files that are in hot-backup mode

14 To check which datafile belongs to which tablespace


15 Check parameter value from db level

16 Show user info including OS pid


17 Create a temporary tablespace

Create temporary tablespace <TABLESPACE_NAME>


tempfile '<FILE_PATH>' size 500M ;

18 Make Temporary Tablespace as Default

Alter database default temporary tablespace <TABLESPACE_NAME> ;

19 To change maxextents

Alter table <table_name> storage(maxextents 150);

20 Show segments that are approaching max_extents


21 Quick datafile health check

You should only see online and system (maybe read-only too)

22 List Controlfiles – Locations

You might also like