Volumetry

DBA Geral (instalação, configuração do banco, scripts do Sql*Plus, shell scripts, batch scripts, etc...)
Post Reply
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Personal, good afternoon.

I need to carry out a survey at Banco Oracle (I'm not DBA) in the following scenario:
I have The quantity of rows, after deleting some tables in the database.

This value, reaches approximately 50 million records that I will perform the "purge".

Doubt:
  • For not having access to dba_segments , I can, make a calculation, converting the Quantity of lines in bytes? [/ list]

    Thank you.
ruibarros
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 93
Joined: Thu, 29 Jan 2009 11:44 am
Location: Cuiabá
Rui Barros
OCP - Oracle Certified Professional

Good afternoon,
as you are not DBA, you can use A (User_Segments).
I was kind of in doubt in your doubt, but I will try to help ...

bytes by type of segments:

Select all

select o.segment_type, SUM(o.BYTES) from user_segments o  
group by o.segment_type
Number of lines:

Select all

select t.TABLE_NAME, t.NUM_ROWS from user_tables t

Hugs.
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Rui, beleza BROTHER?

Dude, I even tried User_segments , but I'm not the Owner of the objects, then, the view does not return anything rs ..

But thanks for the return ...
ruibarros
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 93
Joined: Thu, 29 Jan 2009 11:44 am
Location: Cuiabá
Rui Barros
OCP - Oracle Certified Professional

Beauty my brother hehe ...: -The

, consult from another Owner gets complicated without permission ...

Hugs!
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Then Brother ...

As for the view all_tables , in it the information of num_rows .
So far without problems.

What I would like to know is: [/ u]
With this information of the quantity of lines, can you make any conversion to bytes?
ruibarros
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 93
Joined: Thu, 29 Jan 2009 11:44 am
Location: Cuiabá
Rui Barros
OCP - Oracle Certified Professional

So brother ...
I, in my knowledge, I think it's kind of impossible ... you turn a huge amount into bytes ...
What is the purpose of this?

usually if I want to see the amount of records of the table I check that way, and if I want to see the size of the segment, I see the other way ...
ruibarros
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 93
Joined: Thu, 29 Jan 2009 11:44 am
Location: Cuiabá
Rui Barros
OCP - Oracle Certified Professional

Try to explain what you need better than I see ...

Do you need an export? I could not understand why to convert like this ...
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

then brother,

on the conversion, until I found on a site, but, as I am a little bit, I preferred to act otherwise (climb to a team with permission DBA_SEGMENTS, even if it slows longer than I do the queries myself).

About the survey?
I am in a project of "purged" base, that is, dozens of bank objects will suffer delete, Others, trucize and there goes.

What happens is that the client wants to know in size (Storage), how much he will save.
That's why I need the information.

But, thanks for the help.
ruibarros
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 93
Joined: Thu, 29 Jan 2009 11:44 am
Location: Cuiabá
Rui Barros
OCP - Oracle Certified Professional

I understand, the best thing really is to pass on to a DBA to do this survey.

Embrace Brother!
User avatar
madmax
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 293
Joined: Wed, 13 Dec 2006 5:02 pm
Location: São Paulo
Contact:
________________________________
Douglas - Madmax.

Hello Trevisolli,

This volumetry script would help you?

It checks the size of the tables by MB

Select all

– Tamanho de Cada Tabela 
 
SELECT owner, tablespace_name, segment_name, 
round(sum(bytes/1024/1024),2) as Tamanho_MB –, extents as Num_extents 
FROM dba_segments 
WHERE owner = ‘SCOTT’ 
AND segment_type = ‘TABLE’ 
– AND segment_name like ‘DEPT%’ 
GROUP BY owner, tablespace_name, segment_name 
 
– Tamanho das Tabelas Por Usuário 
 
SELECT owner, round(sum(bytes/1024/1024),2) as Tamanho_MB –, extents as Num_extents 
FROM dba_segments 
GROUP BY owner 
 
– Tamanho Total das Tabelas 
 
SELECT round(sum(bytes/1024/1024),2) as Tamanho_MB –, extents as Num_extents 
FROM dba_segments 
I hope I have helped.

ABS.
ruibarros
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 93
Joined: Thu, 29 Jan 2009 11:44 am
Location: Cuiabá
Rui Barros
OCP - Oracle Certified Professional

It's like he said, he would help, but he is not allowed to run as DBA ...
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Then brothers,

on dba_segments does not really help me very much, by the facts of permissions, etc.

I would like to know if there is any script, which I can, for example, through 1 record of the databases, calculate your size, having this record columns number, varchar2, date etc .

Why?
I need to do a partial cleaning of a table and, before cleaning, inform the client the "gain" that he will have.

Thank you very much
ruibarros
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 93
Joined: Thu, 29 Jan 2009 11:44 am
Location: Cuiabá
Rui Barros
OCP - Oracle Certified Professional

Brother,
Would not you duplicate this somewhere?
So you would raise the current size ... After that deleting the data, etc. You would raise the new size
then yes you did the calculation, graphic, percentage for the customer showing ...

is what I would give to be done, since you do not administer the database.

Embrace.
ruibarros
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 93
Joined: Thu, 29 Jan 2009 11:44 am
Location: Cuiabá
Rui Barros
OCP - Oracle Certified Professional

In my point of view, you should ask the DBA to verify, that he will know what to do ...
Join with him ...

He will be able to do any kind consultation, seeing segment size, Datafile, tablespace, blob, etc ...
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest