Tuesday, August 26, 2008

To know the object in the tablespace

select S.tablespace_name, s.owner, s.segment_name, s.segment_type,
sum(s.bytes) size_in_bytes,
round(sum(s.bytes) / 1024 / 1024, 2) size_in_m,
f.file_name
from sys.dba_segments s, sys.dba_data_files f
where f.tablespace_name = s.tablespace_name
and f.file_id = s.header_file
and s.tablespace_name in ('tablespace_name')
-- A good thing to check is for objects in the SYSTEM tablespace that have s.owner <> 'SYS'
group by s.tablespace_name, s.owner, s.segment_name, s.segment_type, f.file_name
Order by s.tablespace_name, s.owner, s.segment_name

Loader Script

sqlldr username/passwd data=file_name.txt control=control_file_name.ctl log=log_file_name.log errors=50000000

Control File

load data
infile *
into table table_name
Append
fields terminated by '|' optionally enclosed by '"' TRAILING NULLCOLS
(
field 1 ,
field 2 ,
field 3 ,
)

RAC Maintenance

For 10g RAC

a) ./crsctl stop crs responsable for stop all services
b) ./crsctl start crs responsable for start all services
c) ./crs_stat -* to check the service status


to stop one perticuler service
1. get the service name from C
2. ./crs stop SERVICE_NAME

to start one perticuler service
1.check the service which one is OFFLINE useing c
./crs start SERVICE_NAME

For 9i RAC
stop all service nod by nod
login to sqlplus as sysdba in nod1
shutdown immediate
lsnrctl stop
gsdctl stop