Vous êtes sur la page 1sur 8

SAP BASIS Oracle Commands useful for day to day work

INDEX

1. 2. 3. 4. 5. 6. 7. 8.

Start Database Shut down Database To know the database startup time Find out user /schema name To unlock user To change password from os level To check which tablespaces / datafiles are in backup mode Tablespace in END Backup Mode List files that are in hot-backup mode To check which datafile belongs to which tablespace Check parameter value from db level Show user info including os pid Create a temporary tablespace Make temporary tablespace as Default To Check and Change maxextents Quick datafile health check List controlfiles Locations

9.
10. 11. 12. 13.

14.
15. 16.

17.

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

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)

To know the database startup time

Find out user /schema name

To unlock user

Alter user <username> account unlock;

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

(If value of Uflag = 0 means unlock)

Other values for uflag

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).

To check which tablespaces / datafiles are in backup mode

Table Space in END Backup Mode

Alter tablespace <TABLESPACE_NAME> end backup;

10 List files that are in hot-backup mode

11 To check which datafile belongs to which tablespace

12 Check parameter value from db level

13 Show user info including OS pid

14 Create a temporary tablespace


Create temporary tablespace <TABLESPACE_NAME> tempfile '<FILE_PATH>' size 500M ;

15 Make Temporary Tablespace as Default Alter database default temporary tablespace <TABLESPACE_NAME> ;

16 To change maxextents
Alter table <table_name> storage(maxextents 150);

17 Show segments that are approaching max_extents

18 Quick datafile health check


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

19 List Controlfiles Locations