domingo, 14 de julio de 2013

TIPS ESSBASE

Entering TEXT data in Essbase using Text List

Hi All,

  In essbase 11 onwards there is an option to have planning smartlist like functionality in Essbase cube .. This new functionality is called Text List .. Just like planning smartlist, using essbase text list you can enter Text data in essbase also, you can restrict entries as in smartlist. Following is the process for having textlists in Essbase.

1. Enable type measures for essbase database : Go to Outline Properties and enable Typed measures.

Add caption

2. Creating Text List : Just like planning smartlist , create Essbase text list by going into Text List Manager Tab. In below screenshot I have created a text list for inserting ratings.



3. Apply data type as Text and assign TextList : In below example I have assigned Rating Textlist to Rating account.


Now your Essbase tasklist is ready for use .. You can use it just like Smartlist from smartview. Also, using excel ad-in you can simply lock n send text data into Essbase. For calculation purpose just like Smartlist you can use id value ..


Cheerz!
-Chinmay Joshi

SATURDAY, JULY 17, 2010

Block creation Issue

Hi All,

  Many times while writing Essbase calc scripts you must have encountered an issue of block creation i.e. you are not able to see any results for your simple calculations !...

 Essbase normally create blocks when data is loaded, during aggregation of sparse dimensions
and as a result of a DATACOPY command.

Essbase does not create blocks as a result of most dense member assignment calculations. For
example based on the Sample.Basic outline, assume that “Sales” is a dense dimension member
and actual is a sparse dimension member. The following formula will fail because it will not
create new blocks for Budget.
FIX (budget)
"Sales"="Sales"->"Actual"*1.1;
ENDFIX

 So, in short if you are performing some basic arithmatic calculations, essbase won't create new block for sparse dimensions.. This is done by essbase to improve it's calculation performance but  it is a headache for developer..

 Ways to tackle this issue are:

1.DATACOPY into Sparse Member:
You can use the data copy command to create blocks in the same pattern as the actual
blocks. In above example you can do DATACOPY ACTUAL TO BUDGET prior to writing calc. command... It will first create a block for Budget and then will overwrite a calculated value into it.. You can also fix some combination and always enter some dummy data into it as a part of your essbase process and can use this combination for block creation.

e.g. You can always enter '1' in Actual->Test_Acc and can use it for all block creation datacopy commands..



2. CALCULATION COMMANDS TO ENABLE BLOCK CREATION
You can also use  SET CREATEBLOCKONEQ and SET CREATENONMISSINGBLK commands for block creation. But these commands are bit heavy on your calculation and degrades calc script performance so for big calc scripts it is always advisable to use DATACOPY approach...

 Cheerz!
--CJ

FRIDAY, JANUARY 15, 2010

Design Essbase ASO aggregation

Hi,

ASO cubes are by default dynamic in nature i.e. in ASO all aggregations happen on the fly .. So data is stored only at Lev 0 .. For small ASO cubes it gives pretty good performance in reporting, but for huge ASO cubes ( Generally which is the case) report performance is a concern ..

'Design Aggregation' feature of ASO is a good option provided by Essbase .. In aggregation data is calculated at upper level and stored, so data retrieval becomes much faster.. Following are the steps for designing aggregation for ASO cubes

1. Enable 'Query Tracking' :  Query tracking will track data  combinations which have more data values and which requires Agg to improve performance..
e.g. If you have 2 parents with 100 children each, then Query tracking will keep track of which all children have data for some combinations and will suggest in future required aggregate views .







2. Go to 'Design Aggregation'



3.  First select  Use recommended views to materialize aggregation .. It will show all the views selected by system .. It is a good practice to include them first in Agg view definition ... Select all these views and save and materialize them .


 
 
4. Go back to 'Design Aggregation' and now select second option .


5. Select  'Select all recommended aggregate views' .. You can specify total storage space in this screen


 
 
6. Select 'Use query Tracking data during view selection' (Option present at bottom) and click on Start .. It will show all views tracked by system using Query tracking ..


7. Save and materialize views..


 
 
 
8. Repeat these steps once you load any new data and save new aggregate views in existing saved aggregation..

If you change any dimension name or change property of member like if stored becomes Label Only or calculated one , then entire Aggregation becomes invalid and you need to re-do this process..

-Cheerz -- :)





SUNDAY, JUNE 28, 2009

Book on Essbase Implementation

Hey all,

Check this : New book for essbase implementation:




For more info..Check this link :

http://www.packtpub.com/oracle-essbase-9-implementation-guide




A great new book by Joseph Sydney Gomez, Sarma Anantapantula on Oracle Essbase 9 Implementation .. Looks impressive.. I think it is first of it's kind implementation guide on Hyperion Essbase ... Must buy for Hyperion practitioners and people who wants to jump into Essbase Space ! :)

Cheerz!
-CJ-

TUESDAY, JANUARY 27, 2009

Committed access in Essbase

Hi,

Committed access option provided by Hyperion essbase proves very helpful in many cases.First letz understand what is committed and uncommitted access... Committed access means while loading data into essbase , it first stores data in memory and once wait period is over it loads data into physical disk. It is synonymous to Commit access in SQL.Essbase works in similar fashion..You can set committed/uncommitted access in DB properties under transactions.



There are some real scenarios when data load if interrupted between needs to restart from beginning, in essbase we can achieve this by setting committed access and then click on "Abort on error" while data loading.

WEDNESDAY, JANUARY 21, 2009

Restoring Data from Backups

Restoring Data from Backups


To restore data from backup:
1.Stop OpenLDAP service or process.

2.Using a command prompt window, navigate to /server/scripts and execute the following command.

Windows:
recover.bat 

UNIX:
recover.sh 

In this command,
Path_backup_directory indicates the path of the directory where the backup is stored.

3.Monitor the utility to ensure that it runs successfully.

4.Start OpenLDAP.

5.Restart Shared Services.

WEDNESDAY, JANUARY 14, 2009

Rules for Base and Attribute Dimensions and Members

Rules for Base and Attribute Dimensions and Members

There are several important rules regarding members of attribute dimensions and their base
dimensions.
● You can tag only sparse dimensions as attribute dimensions.
● Before you can save an outline to the server, each attribute dimension must be associated
with a standard, sparse dimension as its base dimension.
● Attribute dimensions must be the last dimensions in the outline.
● Attribute dimensions have a type setting—text, numeric, Boolean, or date. Text is the default
setting. Although assigned at the dimension level, the type applies only to the level 0 members
of the dimension.
● If you remove the attribute tag from a dimension, Essbase removes prefixes or suffixes from
its member names. Prefixes and suffixes are not visible in the outline. For more information,
● A base dimension member can have many attributes, but only one attribute from each
particular attribute dimension.
For example, product 100-10 can have size and packaging attributes, but only one size and only one type of packaging.
● You cannot associate an attribute with an implied shared member the child of which is tagged as shared.
● Essbase does not support attributes for Hybrid Analysis-enabled members.
You can use attribute values in calculations in the following comparisons:
● > (greater than)
● >= (greater than or equal to)
● < (less than)
● <= (less than or equal to)
● = = (equal to)
● <> or != (not equal to)
● IN

SATURDAY, JANUARY 3, 2009

Fine Tuning Hyperion Essbase Cache Settings

Fine Tuning Cache Settings

After using a database at your site with typical data, user access, and standard environment (including server machines, network, etc.), check to see how Essbase performs. It is difficult to predict optimal cache sizes without testing. You may need to adjust your cache settings.
Understanding Cache Settings

The sizes of the index cache and the data file cache (when direct I/O is used) are the most critical Essbase cache settings. In general, the larger these caches, the less swapping activity occurs; however, it does not always help performance to set cache sizes larger and larger. Read this entire section to understand cache size considerations.
Index Cache

The advantages of a large index cache start to level off after a certain point. Whenever the index cache size equals or exceeds the index size (including all index files on all volumes), performance does not improve. However, to account for future growth of the index, you can set the index cache size larger than the current index size. Because the index cache is filled with index pages, for optimum use of storage, set the size of the index cache to be a multiple of the size of the index page (8 KB). See Index Files for an example of estimating index size.
Data File Cache

If possible, set the data file cache to equal the size of the stored data, which is the combined size of all ess*.pag files. Otherwise, the data file cache should be as large as possible. If you want to account for future growth of stored data, you can set the data file cache size larger than the current size of stored data.
Note:

The data file cache is used only if you are using direct I/O.
Data Cache

The data cache should be about 0.125 times the data file cache. However, certain calculations require a larger data cache size. If many concurrent users are accessing different data blocks, this cache should be larger.

In general, if you have to choose between allocating memory to the data file cache or allocating it to the data cache, choose the data file cache if you are using direct I/O. If you are upgrading from a previous version of Essbase, see the Hyperion Essbase - System 9 Installation Guide.
Checking Cache Hit Ratios

Every cache has a “hit ratio.” The hit ratio indicates the percentage of time that a requested piece of information is available in the cache. You can check the hit ratio of the index cache, the data cache, and the data file cache to determine whether you need to increase the cache size.

* To check cache hit ratios, see “Checking Cache Hit Ratios” in Essbase Administration Services Online Help.

*

The cache hit ratio indicates the percentage of time that a requested piece of information is already in the cache. A higher hit ratio indicates that the data is in the cache more often. This improves performance because the requested data does not have to be retrieved from disk for the next process. A hit ratio of 1.0 indicates that every time data is requested, it is found in the cache. This is the maximum performance possible from a cache setting.
*

The Hit Ratio on Index Cache setting indicates the Essbase Kernel success rate in locating index information in the index cache without having to retrieve another index page from disk.
*

The Hit Ratio on Data File Cache setting indicates the Essbase Kernel success rate in locating data file pages in the data file cache without having to retrieve the data file from disk.
*

The Hit Ratio on Data Cache setting indicates the Essbase success rate in locating data blocks in the data cache without having to retrieve the block from the data file cache.
*

Check memory allocation. Add smaller amounts of memory at a time , if needed, because a smaller increment may have the same benefit as a large one. Large, incremental allocations of memory usually result in very little gain in the hit ratio.

Hyperion Essbase Caches

Essbase uses five memory caches to coordinate memory usage:


Index cache


The index cache is a buffer in memory that holds index pages. How many index pages are in memory at one time depends upon the amount of memory allocated to the cache.

Data file cache


The data file cache is a buffer in memory that holds compressed data files (.pag files). Essbase allocates memory to the data file cache during data load, calculation, and retrieval operations, as needed. The data file cache is used only when direct I/O is in effect.

Data cache


The data cache is a buffer in memory that holds uncompressed data blocks. Essbase allocates memory to the data cache during data load, calculation, and retrieval operations, as needed.

Calculator cache


The calculator cache is a buffer in memory that Essbase uses to create and track data blocks during calculation operations.

Dynamic calculator cache


The dynamic calculator cache is a buffer in memory that Essbase uses to store all of the blocks needed for a calculation of a Dynamic Calc member in a dense dimension (for example, for a query).

Fuente: http://hyperionism.blogspot.com/search/label/Hyperion%20Essbase

martes, 9 de julio de 2013

essbase IF (@ISMBR(@IDESCENDANTS

essbase IF (@ISMBR(@IDESCENDANTS( question

Esta pregunta no se respondió.
649268Newbie
I have a cross dimension calc script that I need to put in limit for

IF (@ISMBR(@IDESCENDANTS(the member limit)))


example:
FIX ("May")
"Cost"(    
     IF (@ISMBR("jan"))
IF (@ISMBR(@IDESCENDANTS(expense)))
     "Cost" = "janmd"->"All Step"->"Project"->"Jan" * Hrst->"JanTotal";

ENDIF
)
ENDFIX

formula validates but it doesn't computate

If I take out the IF (@ISMBR(@IDESCENDANTS(expense)))
it computates and gives me the result expected.
  • Re: essbase IF (@ISMBR(@IDESCENDANTS( question
    _RahulS_Guru
    Hi,

    The @ISMBR function returns TRUE if any specified member matches the member being calculated.
    1) A single member, @ISMBR("Florida")
    2) a range of members, @ISMBR("New York" : "Florida")
    3) a discrete list of members may be specified,@ISMBR("Florida","Texas","New Mexico")

    BTW, why dont you directly use @ISCHILD, @ISIDESC etc?

    Cheers...!!!

    Edited by: RahulS on Jun 11, 2010 8:18 PM
    • Re: essbase IF (@ISMBR(@IDESCENDANTS( question
      649268Newbie
      two part answer

      FIX (&CurrMth)
      "Cost"(    
           IF (@ISMBR("jan"))
           "Cost" = "Jan hr"->"All Step"->"All Project"->"Jan" * Hours->"Jan Total";
           ELSEIF (@ISMBR("feb"))
      2nd part

      "Cost"(
      IF (@ISMBR(@IDESC("Other Projects")))
      IF (@ISMBR("STEP 2") OR @ISMBR("STEP 3") OR @ISMBR("STEP 5") )

      IF (@ISMBR("jan"))
      "Cost"= "jan ar" ->"All Step" -> "All Project" * Hours->"Jan Total";    
      ELSEIF (@ISMBR("feb"))
      "Cost"= "feb ar" ->"All Step" -> "All Project" * Hours->"Feb Total";    
      ELSEIF (@ISMBR("mar"))

Deploying A Planning Application For The First Time Throws Error Get HTTP/1.1 500 Internal Server Error


To BottomTo Bottom

12-Mar-2013PROBLEMPUBLISHED3
There are no commentsComments (0)Rate this documentEmail link to this documentOpen document in new windowPrintable Page
In this Document
Symptoms
Cause
Solution


Applies to:

Hyperion Planning - Version 11.1.2.1.000 and later
Information in this document applies to any platform.

Symptoms

Unable to deploy a Planning application due to the following error displayed in the Job Console:
Detail : Initiating Product Action...
Generating Headers and Callback Information...
Generating Application Data...
Posting Product Request...
HTTP/1.1 500 Internal Server Error
Action aborted.

The following error is found in the HyS9Planning-syserr.log

com.hyperion.planning.HspRuntimeException: The application MyApplicationName already exists in Essbase.
at HspAppManagerServlet.checkIfEssbaseAppAlreadyExists(Unknown Source)
at HspAppManagerServlet.Handle(Unknown Source)
at HspAppManagerServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)

Cause

An application with the same name already exists in Essbase (EAS).

Solution

Rename the existing Application in the EAS console.
Attempt deployment again.
Upon successful deployment delete the renamed application.
 

miércoles, 8 de mayo de 2013

comandos sql para oracle muy utiles para los esquemas


Para setear las configuraciones de bases de datos para expirar en un cierto tiempo:


ALTER USER user PASSWORD EXPIRE;

para cambiar password:

ALTER USER scott IDENTIFIED BY password;
para configurar los esquemas y que no caduque el password se debe crear un perfil
CREATE PROFILE my_profile LIMIT
       PASSWORD_LIFE_TIME 30;
ALTER USER scott PROFILE my_profile;

luego modificar el perfil para que nunca caduque la clave

 PROFILE my_profile LIMIT
  PASSWORD_LIFE_TIME UNLIMITED

lunes, 18 de marzo de 2013

Consultas útiles para oracle

Visto en : http://www.ots.ac.cr/tech/node/318

Algunas consultas que encontre en este blog que pueden ayudarnos en algunos casos que en que no sepamos por que un deploy no funciona o si nuestras aplicaciones de hyperion no levantan


•• Consulta Oracle SQL sobre la vista que muestra el estado de la base de datos:
select * from v$instance
•• Consulta Oracle SQL que muestra si la base de datos está abierta
select status from v$instance
•• Consulta Oracle SQL sobre la vista que muestra los parámetros generales de Oracle
select * from v$system_parameter
•• Consulta Oracle SQL para conocer la Versión de Oracle
select value from v$system_parameter where name = 'compatible'
•• Consulta Oracle SQL para conocer la Ubicación y nombre del fichero spfile
select value from v$system_parameter where name = 'spfile'
•• Consulta Oracle SQL para conocer la Ubicación y número de ficheros de control
select value from v$system_parameter where name = 'control_files'
•• Consulta Oracle SQL para conocer el Nombre de la base de datos
select value from v$system_parameter where name = 'db_name'
•• Consulta Oracle SQL sobre la vista que muestra las conexiones actuales a Oracle Para visualizarla es necesario entrar con privilegios de administrador
select osuser, username, machine, program
from v$session
order by osuser
•• Consulta Oracle SQL que muestra el número de conexiones actuales a Oracle agrupado por aplicación que realiza la conexión
select program Aplicacion, count(program) Numero_Sesiones
from v$session
group by program
order by Numero_Sesiones desc
•• Consulta Oracle SQL que muestra los usuarios de Oracle conectados y el número de sesiones por usuario
select username Usuario_Oracle, count(username) Numero_Sesiones
from v$session
group by username
order by Numero_Sesiones desc
Propietarios de objetos y número de objetos por propietario
select owner, count(owner) Numero
from dba_objects
group by owner
order by Numero desc
•• Consulta Oracle SQL sobre el Diccionario de datos (incluye todas las vistas y tablas de la Base de Datos)
select * from dictionary
•• Consulta Oracle SQL que muestra los datos de una tabla especificada (en este caso todas las tablas que lleven la cadena "XXX"
select * from ALL_ALL_TABLES where upper(table_name) like '%XXX%'
•• Consulta Oracle SQL para conocer las tablas propiedad del usuario actual
select * from user_tables
•• Consulta Oracle SQL para conocer todos los objetos propiedad del usuario conectado a Oracle
select * from user_catalog
•• Consulta Oracle SQL para el DBA de Oracle que muestra los tablespaces, el espacio utilizado, el espacio libre y los ficheros de datos de los mismos:
Select t.tablespace_name "Tablespace", t.status "Estado",
ROUND(MAX(d.bytes)/1024/1024,2) "MB Tamaño",
ROUND((MAX(d.bytes)/1024/1024) -
(SUM(decode(f.bytes, NULL,0, f.bytes))/1024/1024),2) "MB Usados",
ROUND(SUM(decode(f.bytes, NULL,0, f.bytes))/1024/1024,2) "MB Libres",
t.pct_increase "% incremento",
SUBSTR(d.file_name,1,80) "Fichero de datos"
FROM DBA_FREE_SPACE f, DBA_DATA_FILES d, DBA_TABLESPACES t
WHERE t.tablespace_name = d.tablespace_name AND
f.tablespace_name(+) = d.tablespace_name
AND f.file_id(+) = d.file_id GROUP BY t.tablespace_name,
d.file_name, t.pct_increase, t.status ORDER BY 1,3 DESC
•• Consulta Oracle SQL para conocer los productos Oracle instalados y la versión:
select * from product_component_version
•• Consulta Oracle SQL para conocer los roles y privilegios por roles:
select * from role_sys_privs
•• Consulta Oracle SQL para conocer las reglas de integridad y columna a la que afectan:
select constraint_name, column_name from sys.all_cons_columns
•• Consulta Oracle SQL para conocer las tablas de las que es propietario un usuario, en este caso "xxx":
SELECT table_owner, table_name from sys.all_synonyms where table_owner like 'xxx'
•• Consulta Oracle SQL como la anterior, pero de otra forma más efectiva (tablas de las que es propietario un usuario):
SELECT DISTINCT TABLE_NAME
FROM ALL_ALL_TABLES
WHERE OWNER LIKE 'HR'
Parámetros de Oracle, valor actual y su descripción:
SELECT v.name, v.value value, decode(ISSYS_MODIFIABLE, 'DEFERRED',
'TRUE', 'FALSE') ISSYS_MODIFIABLE, decode(v.isDefault, 'TRUE', 'YES',
'FALSE', 'NO') "DEFAULT", DECODE(ISSES_MODIFIABLE, 'IMMEDIATE',
'YES','FALSE', 'NO', 'DEFERRED', 'NO', 'YES') SES_MODIFIABLE,
DECODE(ISSYS_MODIFIABLE, 'IMMEDIATE', 'YES', 'FALSE', 'NO',
'DEFERRED', 'YES','YES') SYS_MODIFIABLE , v.description
FROM V$PARAMETER v
WHERE name not like 'nls%' ORDER BY 1
•• Consulta Oracle SQL que muestra los usuarios de Oracle y datos suyos (fecha de creación, estado, id, nombre, tablespace temporal,...):
Select * FROM dba_users
•• Consulta Oracle SQL para conocer tablespaces y propietarios de los mismos:
select owner, decode(partition_name, null, segment_name,
segment_name || ':' || partition_name) name,
segment_type, tablespace_name,bytes,initial_extent,
next_extent, PCT_INCREASE, extents, max_extents
from dba_segments
Where 1=1 And extents > 1 order by 9 desc, 3
Últimas consultas SQL ejecutadas en Oracle y usuario que las ejecutó:
select distinct vs.sql_text, vs.sharable_mem,
vs.persistent_mem, vs.runtime_mem, vs.sorts,
vs.executions, vs.parse_calls, vs.module,
vs.buffer_gets, vs.disk_reads, vs.version_count,
vs.users_opening, vs.loads,
to_char(to_date(vs.first_load_time,
'YYYY-MM-DD/HH24:MI:SS'),'MM/DD HH24:MI:SS') first_load_time,
rawtohex(vs.address) address, vs.hash_value hash_value ,
rows_processed , vs.command_type, vs.parsing_user_id ,
OPTIMIZER_MODE , au.USERNAME parseuser
from v$sqlarea vs , all_users au
where (parsing_user_id != 0) AND
(au.user_id(+)=vs.parsing_user_id)
and (executions >= 1) order by buffer_gets/executions desc
•• Consulta Oracle SQL para conocer todos los tablespaces:
select * from V$TABLESPACE
•• Consulta Oracle SQL para conocer la memoria Share_Pool libre y usada
select name,to_number(value) bytes
from v$parameter where name ='shared_pool_size'
union all
select name,bytes
from v$sgastat where pool = 'shared pool' and name = 'free memory'
Cursores abiertos por usuario
select b.sid, a.username, b.value Cursores_Abiertos
from v$session a,
v$sesstat b,
v$statname c
where c.name in ('opened cursors current')
and b.statistic# = c.statistic#
and a.sid = b.sid
and a.username is not null
and b.value >0
order by 3
•• Consulta Oracle SQL para conocer los aciertos de la caché (no debería superar el 1 por ciento)
select sum(pins) Ejecuciones, sum(reloads) Fallos_cache,
trunc(sum(reloads)/sum(pins)*100,2) Porcentaje_aciertos
from v$librarycache
where namespace in ('TABLE/PROCEDURE','SQL AREA','BODY','TRIGGER');
Sentencias SQL completas ejecutadas con un texto determinado en el SQL
SELECT c.sid, d.piece, c.serial#, c.username, d.sql_text
FROM v$session c, v$sqltext d
WHERE c.sql_hash_value = d.hash_value
and upper(d.sql_text) like '%WHERE CAMPO LIKE%'
ORDER BY c.sid, d.piece
Una sentencia SQL concreta (filtrado por sid)
SELECT c.sid, d.piece, c.serial#, c.username, d.sql_text
FROM v$session c, v$sqltext d
WHERE c.sql_hash_value = d.hash_value
and sid = 105
ORDER BY c.sid, d.piece
•• Consulta Oracle SQL para conocer el tamaño ocupado por la base de datos
select sum(BYTES)/1024/1024 MB from DBA_EXTENTS
•• Consulta Oracle SQL para conocer el tamaño de los ficheros de datos de la base de datos
select sum(bytes)/1024/1024 MB from dba_data_files
•• Consulta Oracle SQL para conocer el tamaño ocupado por una tabla concreta sin incluir los índices de la misma
select sum(bytes)/1024/1024 MB from user_segments
where segment_type='TABLE' and segment_name='NOMBRETABLA'
•• Consulta Oracle SQL para conocer el tamaño ocupado por una tabla concreta incluyendo los índices de la misma
select sum(bytes)/1024/1024 Table_Allocation_MB from user_segments
where segment_type in ('TABLE','INDEX') and
(segment_name='NOMBRETABLA' or segment_name in
(select index_name from user_indexes where table_name='NOMBRETABLA'))
•• Consulta Oracle SQL para conocer el tamaño ocupado por una columna de una tabla
select sum(vsize('NOMBRECOLUMNA'))/1024/1024 MB from NOMBRETABLA
•• Consulta Oracle SQL para conocer el espacio ocupado por usuario
SELECT owner, SUM(BYTES)/1024/1024 MB FROM DBA_EXTENTS
group by owner
•• Consulta Oracle SQL para conocer el espacio ocupado por los diferentes segmentos (tablas, índices, undo, rollback, cluster, ...)
SELECT SEGMENT_TYPE, SUM(BYTES)/1024/1024 MB FROM DBA_EXTENTS
group by SEGMENT_TYPE
•• Consulta Oracle SQL para obtener todas las funciones de Oracle: NVL, ABS, LTRIM, ...
SELECT distinct object_name
FROM all_arguments
WHERE package_name = 'STANDARD'
order by object_name
•• Consulta Oracle SQL para conocer el espacio ocupado por todos los objetos de la base de datos, muestra los objetos que más ocupan primero
SELECT SEGMENT_NAME, SUM(BYTES)/1024/1024 MB FROM DBA_EXTENTS
group by SEGMENT_NAME
order by 2 desc
•• Para comparar dentro de un DECODE con parte de un texto del contenido de un campo, es decir, para poder utilizar un like u otras funciones en lugar de la igualdad que toma por defecto el DECODE se puede hacer lo siguiente:
Select
decode(CAMPO, (select CAMPO from dual where CAMPO like 'A%'), 'Campo comienza por A',
(select name from dual where name like 'B%'), 'Campo comienza por B',
'Campo no comienza ni por A ni por B')
From TABLA;
•• Cuando un tablespace se queda sin espacio se puede ampliar creando un nuevo fichero de datos, o ampliando uno de los existentes.
Para consultar el espacio ocupado por cada datafile se puede utilizar la consulta de la lista anterior:
Consulta Oracle SQL para el DBA de Oracle que muestra los tablespaces, el espacio utilizado, el espacio libre y los ficheros de datos de los mismos:
Select t.tablespace_name "Tablespace", t.status "Estado",
ROUND(MAX(d.bytes)/1024/1024,2) "MB Tamaño",
ROUND((MAX(d.bytes)/1024/1024) -
(SUM(decode(f.bytes, NULL,0, f.bytes))/1024/1024),2) "MB Usados",
ROUND(SUM(decode(f.bytes, NULL,0, f.bytes))/1024/1024,2) "MB Libres",
t.pct_increase "% incremento",
SUBSTR(d.file_name,1,80) "Fichero de datos"
FROM DBA_FREE_SPACE f, DBA_DATA_FILES d, DBA_TABLESPACES t
WHERE t.tablespace_name = d.tablespace_name AND
f.tablespace_name(+) = d.tablespace_name
AND f.file_id(+) = d.file_id GROUP BY t.tablespace_name,
d.file_name, t.pct_increase, t.status ORDER BY 1,3 DESC
Una vez que localizamos el datafile que podríamos ampliar ejecutaremos la siguiente sentencia para hacerlo:
ALTER DATABASE
DATAFILE '/db/oradata/datafiles/datafile_n.dbf' AUTOEXTEND
ON NEXT 1M MAXSIZE 4000M
Con esta sentencia, el datafile continuaría ampliándose hasta llegar a un máximo de 4Gb.
Si preferimos crear un nuevo datafile porque los que tenemos ya son demasido grandes, una sentencia que podríamos utilizar es la siguiente:
ALTER TABLESPACE "MiTablespace"
ADD
DATAFILE '/db/oradata/datafiles/datafile_m.dbf' SIZE
100M AUTOEXTEND
ON NEXT 1M MAXSIZE 1000M
Crearíamos un nuevo fichero de datos de 100 Mb, y en modo autoextensible hasta 1000 Mb. Por supuesto, el path especificado debe ser el específico de cada base de datos, y se debe utilizar para todo el proceso un usuario con privilegios de DBA.

jueves, 14 de marzo de 2013