Sunteți pe pagina 1din 3

Normal command to start Database

----------------------------------
startup or
startup mount(it will directly start the db into mount stage)

Normal command to stop Database


----------------------------------
shutdown or
shutdown immediate(it will directly start the db into immediate mode)

STOP DATABASE
---------------
srvctl stop database -d PRODB -o normal

START DATABASE
----------------
srvctl start database -d PRODB -o nomount

STOP AN INSTANCE(specially for RAC database)


------------------
srvctl stop instance -d PRODB -i PRODB1

START AN INSTANCE(specially for RAC database)


--------------------
srvctl start instance -d PRODB -i PRODB1

--------------------------------------------------------------
To know location of alert log
--------------------------------------------------------------

show parameter back or show parameter dump;(applicable upto 11g )


cd background_dump_dest;
go to location of background_dump_dest
ls -al*

select value from v$diag_info;(applicable for version above 11g )

%%%%%%%%To verify either instances are running or not%%%%%%%%%%%%%%%%%%%%


--------------------------------------------------------------------------
select name,open_mode from v$database;

%%%%5%%To check the sessions%%%%%%%%%%%%%%%%%%

select SID,serial# from v$session;

---------------------------------------------------------
To check freespace in Tablespace
---------------------------------------------------------
SELECT Total.name "Tablespace Name",total_space,
round(nvl(total_space-Free_space, 0),2) Used_space,
round(nvl(Free_space, 0),2) Free_space,
round((nvl(total_space-Free_space, 0)/ total_space)*100,2) "UsedPCT%"
FROM
(select tablespace_name, sum(bytes/1024/1024) Free_Space
from sys.dba_free_space
group by tablespace_name
) Free,
(select b.name, sum(bytes/1024/1024) TOTAL_SPACE
from sys.v_$datafile a, sys.v_$tablespace B
where a.ts# = b.ts#
group by b.name
) Total
WHERE Free.Tablespace_name(+) = Total.name
ORDER BY 5 desc;

%%%%%%%%%%%%%%%%%%%% To check the datafile path & Partition of Tbl Space %%%%%%%%%%
%%%%%%%%%%%%

2 nd step :
#############

set lines 999 pages 999


col file_name for a65
select
file_name,tablespace_name,BYTES/1024/1024/1024,AUTOEXTENSIBLE,MAXBYTES/1024/1024/10
24 from dba_data_files where tablespace_name='DIGITALTBLS';

select
file_name,tablespace_name,BYTES/1024/1024/1024,AUTOEXTENSIBLE,MAXBYTES/1024/1024/10
24 from dba_data_files order by 3;

%%%%%%%%%%%%%%%%%3rd step : Add datafile or resize the datafiles%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%

alter database datafile '+DATA15/ccuat/datafile/users.296.783383801' resize 25m;

alter tablespace TBS_DIGPRDUSR add datafile '+DATDIG1' size 30G AUTOEXTEND ON;

ALTER TABLESPACE users ADD DATAFILE '/u02/oracle/rbdb1/users03.dbf' SIZE 10M

%%%%%Query to monitor the active sessions%%%%%%%%%%%%%

set lines 190


set pages 500
col STATE form a15
col WAIT_CLASS form a20
col EVENT form a30
col ACTION form a15
col USER form a10
col sid form 9999
col username form a10
col OSUSER form a10
col username form a20
set lines 190
select sid, USERNAME, OSUSER, status, sql_id, prev_sql_id, event, wait_class,
state, LOGON_TIME
from v$session where status = 'ACTIVE' and type != 'BACKGROUND'
order by user;

%%%%%%%%%%%%To check the status of LISTENER%%%%%%%%%%

LSNRCTL status <listener_name>;

S-ar putea să vă placă și