Chiappa, segue o trecho que coloquei no emal passado do livro que estou lendo, é um livro ficado para certificação OCA 10G, o livro é o
Sybex - OCA Oracle 10g Administration I Study Guide acho que tem lá no amazom.com Choosing Extent Management You can use tablespaces with either local extent management or the older technique of dictionary extent management. With dictionary extent management, the database tracks free and used extents in the data dictionary, changing the FET$ and UET$ tables with recursive SQL. With local extent management, the database tracks extents through the use of bitmaps, eliminating the recursive SQL. Local extent management is the default if not specified and is generally the preferred technique. With locally managed tablespaces, you have two options for how extents are allocated: UNIFORM or AUTOALLOCATE. The UNIFORM option tells the database to allocate and deallocate extents in the tablespace with the same unvarying size that you can specify or let extents default to 1MB. UNIFORM is the default for temporary tablespaces and cannot be specified for undo tablespaces. To create consistent 100MB extents, use the clause EXTENT MANAGEMENT LOCAL UNIFORM SIZE 100M in the CREATE TABLESPACE statement. Here is an example: CREATE TABLESPACE hist2004apr DATAFILE '/ORADATA/PROD/HIST2004APR.DBF' SIZE 25G EXTENT MANAGEMENT LOCAL UNIFORM SIZE 100M; AUTOALLOCATE, on the other hand, tells the database to vary the size of extents for each segment. For example, on Windows and Linux with 8KB data blocks, each segment starts out with 140 Chapter 3 Database Storage and Schema Objects 64KB extents for the first 16 extents, and then extents increase in size to 1MB for the next 63 extents. The size then increases to 8MB for the next 120 extents, then 64MB, and so on as the segment grows. This algorithm allows small segments to remain small and large segments to grow without gaining too many extents. AUTOALLOCATE is best used for a general-purpose mixture of small and large tables. Here is an example of creating a tablespace using AUTOALLOCATE: CREATE TABLESPACE hist2004apr DATAFILE '/ORADATA/PROD/HIST2004APR.DBF' SIZE 25G EXTENT MANAGEMENT LOCAL AUTOALLOCATE; You can convert a tablespace from dictionary extent management to local extent management and back with the Oracle-supplied PL/SQL package DBMS_SPACE_ADMIN. The SYSTEM tablespace and any temporary tablespaces, however, cannot be converted from local to the older style dictionary management. Choosing Segment Space Management For tablespaces that have local extent management, you can use either manual or automatic segment space management. Manual segment space management exists for backward compatibility and uses free block lists to identify the data blocks available for inserts together with the parameters PCT_FREE and PCT_USED, which control when a block is made available for inserts. After each INSERT or UPDATE, the database compares the remaining free space in that data block with the segments PCT_FREE setting. If the data block has less than PCT_FREE free space (meaning that it is almost full), it is taken off the free block list and is no longer available for inserts. The remaining free space is reserved for update operations that may increase the size of rows in that data block. After each UPDATE or DELETE, the database compares the used space in that data block with that segments PCT_USED setting. If the data block has less than PCT_USED used space, the data block is deemed empty enough for inserts and is placed on the free block list. To specify manual segment space management, use the SEGMENT SPACE MANAGEMENT MANUAL clause of the CREATE TABLESPACE statement, or simply omit the SEGMENT SPACE MANAGEMENT clause. Although Oracle strongly recommends AUTOMATIC segment space management for permanent, locally managed tablespaces, the default behavior of Oracle 10g is MANUAL. Here is a statement that creates a tablespace with manual segment space management: CREATE TABLESPACE hist2004apr DATAFILE '/ORADATA/PROD/HIST2004APR.DBF' SIZE 25G EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT MANUAL; When automatic segment space management is specified, bitmaps are used instead of free lists to identify which data blocks are available for inserts. The parameters PCT_FREE and PCT_USED are ignored for segments in tablespaces with automatic segment space management. Automatic segment space management is available only on tablespaces configured for local extent management; it is not available for temporary or system tablespaces. Automatic segment space management performs better and reduces your maintenance tasks, making it the preferred technique. Managing Tablespaces 141 To specify automatic segment space management, use the SEGMENT SPACE MANAGEMENT AUTO clause of the CREATE TABLESPACE statement, like this: CREATE TABLESPACE hist2004apr DATAFILE '/ORADATA/PROD/HIST2004APR.DBF' SIZE 25G EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO; --- jlchiappa <[EMAIL PROTECTED]> escreveu: > Cara, afirmar de cara limpa, SEM nenhuma restrição, > que X é melhor, > independente de qual aplicativo se usa, de quaisquer > condições, como > dá a entender a citação que vc faz desse tal livro, > é no mínimo > arriscado : de curiosodade, que livro é esse ?? > Bom, vamos pingar os Is aí : pro Extent Management > é isso mesmo, > pode ser UNIFORM ou AUTO. A opção de UNIFORM indica > que os extents > vão ser sempre do mesmo tamanho, PORTANTO vc a usará > quando SABER que > esse tamanho é bom e apropriado, e isso INDEPENDE em > grande porção > de "tamanho de tabela", ok ? Tranquilamente vc PODE > ter uma tabela > pequena, de alguns poucos milhares de registros que > seja mas que seja > de tamanho previsível e que vc QUEIRA obter um Full > table scan o mais > eficiente possível, E onde vc queira ter uma > previsão bem exata do > espaço que será consumindo, então num caso desses > faria TODO O > SENTIDO usar UNIFORM, confere ?? A outra opção numa > tablespace LMT, > a AUTO ou SYSTEM allocated (vc não diz mas pelo > contexto tá claro que > é LMT que vc, corretamente, está usando), realmente > inicialmente cria > primeiro extents de 64 Kb, depois nas próximas vezes > que o segmento > pedir mais espaço vai paulatinamente aumentando o > tamanho dos > extents : ela é mais indicada imho pros casos onde > vc NÃO tem como > saber nem o tamanho ótimo de extent pra favorecer > I/Os nem o tamanho > máximo/mínimo da tabela. > > ==> Só para constar, a questão do tamanho do extent > pega nos > seguintes pontos : > > a) o I/O multiblock no Oracle é feito por extent, > se vc tiver um > extent menor do que o tamanho do seu I/O multiblock > vc está tendo aí > um uso ineficiente da sua capacidade de I/O > > b) um extent muito grande pode levar a desperdício > de espaço, pois > assim que vc cria um segmento (ainda sem dados!!) o > bd já aloca um > extent, então extent de vários Mbs prum segmento que > vai ter tipo > meia dúza de linhas é desperdício TOTAL de espaço > > Já pro ASSM (Auto Segment Space Management) > realmente ele funciona > como descrito, mas ele TEM SIM implicações e > consequências, acho meio > irresponsável tascar num livro "ah, usa ele que é > melhor e mais > fácil" sem explicar o que vc pode encontrar, vc o > pode usar SE e > apenas SE for nos casos onde as implicações não te > tragam > complicações ;) Por exemplo, preenchimento dos > blocos : embora o > algoritmo seja absolutamente não-documentado, com > certeza ele deve > mudar o preenchimento dos blocos cfrme o uso da > tabela, é responsivo, > e não há como ser pró-ativo, naquelas tabelas de > históricos, coisa do > tipo, onde vc SABE que só haverá INSERTs, e portanto > quer ZERO espaço > reservado para UPDATEs, faz todo sentido ter > alocação manual e > especificar PCTFREE 1 PCTUSED 99, ou mesmo 100% se > aceitar. > ==> Agora, coisas como acima são execeções, imho o > ponto (algumas > vezes contrário) principal do ASSM é : com espaço > administrado por > bitmap, é comum que diferentes bits apontem pra > diferentes blocos, > sobe bem a chance de vc ter diferentes INSERTs no > mesmo segmento > sendo alocados para blocos diferentes, aí é mais > provável de vc ter > (digamos) o insert do cliente 45 caindo no bloco X, > o INSERT do > cliente 46 no bloco Y, cliente 47 no bloco Z, assim > por diante... E > daí ? Daí que (cfrme o mecanismo de I/O do banco que > todos nós já > conhecemos, ou falei aqui em vão ;), o bd Oracle ** > NÃO ** faz I/O de > uma linha, mas sim de um bloco todo, no caso > proposto se os clientes > todos fosse lidos após o INSERT, se eles estivessem > num só bloco só > um bloco de dados iria pro cache, já se estiverem em > nn blocos > diferentes serão os nn blocos que vão subir pro > cache, PORTANTO > exigindo muito mais espaço no cache e PORTANTO > talvez até num caso > extremo tendo que tirar outros blocos de outros > segmentos do cache > pra fazer espaço... O Jonathan Lewis fala disso no > livro de CBO mais > recente dele, que estou lendo, por isso q fiquei > sabendo desse cara, > já que no meu banco só uso tablespaces non-ASSM . > Fica ESPERTO com > isso, teste BEM antes de sair usando... > > []s > > Chiappa > > --- Em oracle_br@yahoogrupos.com.br, Welvis Douglas > Silva Moreto > <[EMAIL PROTECTED]> escreveu > > > > Olá pessial, estou com algumas duvida e não seu > quando > > vou utilizar isso algume podeira me ajudar dizendo > se > > entendi correto e me explicar se possivel quando > devo > > utilizar. > > > > Extent Management > > > > UNIFORM - Vai alocar de desalocar extents > do > > mesmo tamenho. Se não for especificado na criação > vai > > ser de 1M. > > AUTOALLOCATE - Os tamanhos dos Extents são > > diferentes é recomendado ou melhor utilizado para > > proposito geral "tabelas grandes e pequenas". > > > > Segment Space Management > > MANUAL - Usa Free List Bloks para inserir > > junto com os parametos pct_free e pct_used, no > caso de > > Update e Delete usa o pct_used. > > AUTO - Usa Bitmaps para gerenciar a free > list > > para ver qual qual bloco é valido para insert. Os > > parametros pct_free e pct_used são ignorados, e > não > > são validos para temporary tablespaces ou system > > tablespaces Automatic segment space management é > > melhor e reduz sua atarefa de manutenção. Técnica > > preferida "diz o livro que estou estudando". > > > > Bom, bem resumido acho que é isso. > > > > muito obrigado . > > > > att > > > > Welvis Douglas. > > > > > > > > > _______________________________________________________ > > > O Yahoo! está de cara nova. Venha conferir! > > http://br.yahoo.com > > > > > > > __________________________________________________ Fale com seus amigos de graça com o novo Yahoo! Messenger http://br.messenger.yahoo.com/ -------------------------------------------------------------------------------------------------------------------------- Atenção! As mensagens deste grupo são de acesso público e de inteira responsabilidade de seus remetentes. Acesse: http://www.mail-archive.com/oracle_br@yahoogrupos.com.br/ --------------------------------------------------------------------------------------------------------------------------__________________________________________________________________ OPORTUNIDADES DE TRABALHO, VAGAS, EMPREGOS PARA PROFISSIONAIS ORACLE VISITE: http://www.oraclebr.com.br/ __________________________________________________________________ Este Grupo recebe o apoio da SQL Magazine - www.devmedia.com.br/sqlmagazine Links do Yahoo! Grupos <*> Para visitar o site do seu grupo na web, acesse: http://br.groups.yahoo.com/group/oracle_br/ <*> Para sair deste grupo, envie um e-mail para: [EMAIL PROTECTED] <*> O uso que você faz do Yahoo! Grupos está sujeito aos: http://br.yahoo.com/info/utos.html