Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Redo a Tablespace
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_000_01C04F38.6117F83C
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C04F38.6117F83C"
------_=_NextPart_001_01C04F38.6117F83C
Content-Type: text/plain;
charset="iso-8859-1"
Then you can definitely have it!!!
Laura
-----Original Message-----
From: Anandarao, KrishnamurthyX [mailto:krishnamurthyx.anandarao_at_intel.com]
Sent: Wednesday, November 15, 2000 11:01 AM
To: Multiple recipients of list ORACLE-L
Subject: RE: Redo a Tablespace
Laura, I would definitely be interested in it. Can you forward me those scripts please.
Thanks
Krish
<snip>
------_=_NextPart_001_01C04F38.6117F83C
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>RE: Redo a Tablespace</TITLE>
<META content='"MSHTML 4.72.3110.7"' name=GENERATOR>
</HEAD>
<BODY>
<DIV><SPAN class=406321319-15112000><FONT color=#0000ff face=Arial size=2>Then
you can definitely have it!!!</FONT></SPAN></DIV>
<DIV><SPAN class=406321319-15112000><FONT color=#0000ff face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=406321319-15112000><FONT color=#0000ff face=Arial
size=2>Laura</FONT></SPAN></DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader><FONT face="Times New Roman" size=2>-----Original Message-----<BR><B>From:</B> Anandarao, KrishnamurthyX [mailto:krishnamurthyx.anandarao_at_intel.com]<BR><B>Sent:</B> Wednesday, November 15, 2000 11:01 AM<BR><B>To:</B> Multiple recipients of list ORACLE-L<BR><B>Subject:</B> RE: Redo a Tablespace<BR><BR></FONT></DIV> <DIV><FONT color=#0000ff face="MS Sans Serif"><SPAN class=860375916-15112000>Laura, I would definitely be interested in it. Can you forward me those scripts please.</SPAN></FONT></DIV> <DIV><FONT color=#0000ff face="MS Sans Serif"><SPAN class=860375916-15112000></SPAN></FONT> </DIV> <DIV><FONT color=#0000ff face="MS Sans Serif"><SPAN class=860375916-15112000>Thanks</SPAN></FONT></DIV> <DIV><FONT color=#0000ff face="MS Sans Serif"><SPAN class=860375916-15112000>Krish</SPAN></FONT></DIV> <BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV align=left class=OutlookMessageHeader dir = ltr> </DIV> <DIV align=left class=OutlookMessageHeader dir = ltr><SPAN class=406321319-15112000><FONT color=#0000ff face=Arial size=2><snip></FONT></SPAN></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C04F38.6117F83C--
------_=_NextPart_000_01C04F38.6117F83C
Content-Type: application/octet-stream;
name="SAFEcheck.sql"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="SAFEcheck.sql"
set termout on
spool c:\SafeCheck.txt
set heading OFF
select 'Database Queried =3D=3D=3D> '||d.name, ' Date =3D=3D=3D> =
'||s.logon_time=20
from v$database D, V$SESSION S
where s.username =3D 'LAURAB'
/
set heading ON
prompt RULE 1 - 3 .... RULE 1 - 3 .... RULE 1 - 3 .... RULE 1 - 3 .... =
RULE 1 - 3
prompt *** Data tablespaces should have uniform extent size (128K, 4M, =
128M) ***
prompt=20
prompt Tablespaces which do not have an initial extent as indicated =
above, or=20
prompt equal to the minimum extent length, or equal to the next extent. =
Also=20
prompt lists tablespaces where pctincrease is not equal to 0.
prompt
prompt
select tablespace_name, initial_extent, next_extent, pct_increase, =
min_extlen
from dba_tablespaces
where (initial_extent not in (128*1024, 4*1024*1024, 128*1024*1024)
or next_extent !=3D initial_extent
or pct_increase !=3D 0
or min_extlen !=3D initial_extent)
and contents =3D 'PERMANENT'
and tablespace_name !=3D 'SYSTEM'
and tablespace_name not in (select tablespace_name from =
dba_rollback_segs)
/
prompt
prompt RULE 4 ... RULE 4 ... RULE 4 ... RULE 4 ... RULE 4 ... RULE 4 =
... RULE 4
prompt *** Monitor and potentially relocate segments having > 1024 =
extents ***
prompt=20
prompt Segments having more than 1024 extents=20
prompt
prompt
select owner, segment_name, extents=20
from dba_segments
where extents > 1024=20
and segment_type !=3D 'TEMPORARY'
/
prompt
prompt RULE 5 ... RULE 5 ... RULE 5 ... RULE 5 ... RULE 5 ... RULE 5 =
... RULE 5
prompt ******* Max single segment size should be between 4G and 128G =
( select tablespace_name tbspc, sum(bytes) tbspc_sz, count(*) num_files, sum(bytes) / sum(blocks) blk_sz from dba_data_files group by tablespace_name) f
or initial_extent > (tbspc_sz - blk_sz * num_files) / 1024 or next_extent !=3D initial_extent or pct_increase !=3D 0 or min_extlen !=3D initial_extent) and tablespace_name =3D tbspc
or tablespace_name in (select tablespace_name from =
dba_rollback_segs))
/
prompt
prompt RULE 10 ..... RULE 10 ..... RULE 10 ..... RULE 10 ..... RULE 10 =
..... RULE 10=20
prompt *** Never place User Data in the System tablespace = ***
where tablespace_name =3D 'SYSTEM' and owner !=3D 'SYS' and owner !=3D 'SYSTEM'
prompt *** Datafile size should be a multiple of extent size + = 1 ***
and f.tablespace_name =3D =t.tablespace_name
prompt *** Never defragment the space within a uniform extent = tablespace ***
where next_extent =3D initial_extent and pct_increase =3D 0 and min_extlen =3D initial_extentReceived on Wed Nov 15 2000 - 13:15:04 CST