Calculating the size of the database in memory
Hi,
I am using BDB 5.1.19 with BTREE as an access method.
I would like to calculate the memory footprint that would be needed for that.
I followed the following doc:
useful-bytes-per-page = (page-size - page-overhead) * page-fill-factor
bytes-of-data = n-records *
(bytes-per-entry + page-overhead-for-two-entries)
n-pages-of-data = bytes-of-data / useful-bytes-per-page
total-bytes-on-disk = n-pages-of-data * page-size
I am not interested in calculating the size on disk but just in memory.
Would the following be enough:
bytes-of-data = n-records *(bytes-per-entry + page-overhead-for-two-entries)
Since the rest is only for space on disk i don't need it, is that correct?
Would this calculation help me also to calculate the cache size or is the cache size influenced by the page size?
Thx.
This is not a replication question and those of us monitoring this forum are not the best people to answer this question. You'll probably get a better and faster answer if you post it to the general Berkeley DB forum:
Berkeley DB
Paula Bingham
Oracle
Similar Messages
-
How to find out the size of a database?
I'm not an oracle dba but a report developer. I'd like to find out the size of my database.
Is this possible using simple query?An oracle database consists of data files, redo log files, control files, temporary files. Whenever you say the size of the database this actually means the summation of these files.
select a.data_size+b.temp_size+c.redo_size+d.controlfile_size "total_size in MB"
from
( select sum(bytes)/1024/1024 data_size from dba_data_files ) a,
( select nvl(sum(bytes),0)/1024/1024 temp_size from dba_temp_files ) b,
( select sum(bytes)/1024/1024 redo_size from sys.v_$log ) c,
( select sum(BLOCK_SIZE*FILE_SIZE_BLKS)/1024/1024 controlfile_size from v$controlfile) d;
here
a is megabytes allocated to ALL datafiles
b is megabytes allocated to ALL TEMP files
c is megabytes allocated to ALL redo-logs
d is megabytes allocated to ALL control files
Nimish Garg
Software Developer
*(Oracle & ASP.NET)*
Indiamart Intermesh Limited, Noida
To Get Free Oracle & ASP.NET Code Snippets
Follow: http://nimishgarg.blogspot.com -
Hi All,
I am trying to extend the size of c3k database in my system.
I tried like the above screen short but it could not work because the increament button is disable.
how can i increase the size?
can any one help at this?Hi,
From Central go to devices, find the C3000Device, right click and add space on it and then retry what you just posted.
Regards,
Kimon -
Hi gurus,
Can some one suggest me in finding the size of complete database and the free space left in the database .
as i am doing the refresh just need to gather the statistics .
thanks790072 wrote:
Hi gurus,
Can some one suggest me in finding the size of complete database and the free space left in the database .
as i am doing the refresh just need to gather the statistics .
thanks
1 select round(sum(df.bytes/(1024*1024))+sum(tf.bytes/(1024*1024))) TOTAL,
2 round(sum(fs.bytes/(1024*1024))) FREE
3* from dba_data_files df, dba_temp_files tf, dba_free_space fs
SQL> /
TOTAL FREE
6839688 56127 -
Can change the size of the redolog files while the database is running.
How the size of the redolog files will hurt your database performance ?
Can change the size of the redolog files while the database is running in oracle 9i. ?
What will be its impact on the standby database ?
Thanks in advance.redo logs that are too small can cause waits on the switches for heavily utilized systems. logs that are too large are a pain the a$$ during recovery. check v$loghist to see how often switches occur - an average of 20 minutes is good; if you have many switches happening back-to-back, that's a bad sign.
you can change the sizes while the db is up. choose a redo group that is INACTIVE, drop it, delete the files, and recreate it with larger files. then force a switch ("alter system switch logfile;"), and do another inactive group. I actually prefer to do as many switches as necessary to make the new group active so I can verify that I didn't screw up before dropping the next group.
not sure of impact on standby database. -
How to calculate the size of the heap memory? its urgent pls
i had a task in which i need to calculate the size of the heap memory can anybody help me its urgent pls
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
Specifically:
max/total/freeMemory()
http://javaalmanac.com/egs/java.lang/GetHeapSize.html?l=new -
How to reduce the size of a database ?
Hi,
I would like to know what are the possibilities for reducing the size of a database storage.
I have thought about compressing big indexes and tables.
Have you others ideas ?
thxuser4865031 wrote:
Hi,
I would like to know what are the possibilities for reducing the size of a database storage.
I have thought about compressing big indexes and tables.
Have you others ideas ?
thxIt depends. Have you evaluated what takes up the space? Do you have data that can be archived? Do you have high water marks that will never be reached? Do you have sparse data that could have free space removed, just leaving expansion space in new or updateable blocks? Do you have unused indices or tables? What type of systems do you have, OLTP, DW, DSS? Is your data normal? Is your app software enterprise? Are your datatypes correct? Is your storage cheap?
So many possibilities! -
How to find the size of a database?
I'm not an oracle dba but a report developer. I'd like to find out the size of my database.
Is this possible using simple query?francislazaro wrote:
I'm not an oracle dba but a report developer. I'd like to find out the size of my database.
Is this possible using simple query?There are many threads related to the same topic,
http://forums.oracle.com/forums/search.jspa?threadID=&q=How+to+find+the+size+of+a+database&objID=f61&dateRange=all&userID=&numResults=15&rankBy=10001
HTH
Aman.... -
How to know the Size of the Database?
Hi All,
Is there a Transaction which will give me the size of the Database. The Database System which we have is MS Sql Server 2000. Will the Transaction have the option where I could select the Client so that I could get the exact size of the Production Systems Database, will this also provide the size of the Data & Log file.
Thanks,
Kishancheck transaction db16/db17
here are db related tx:
DB01 Analyze exclusive lock waits
DB02 Analyze tables and indexes
DB03 Parameter changes in database
DB11 Early Watch Profile Maintenance
DB12 Overview of Backup Logs
DB13 Database administration calendar
DB14 Show SAPDBA Action Logs
DB15 Data Archiving: Database Tables
DB16 DB System Check: Monitor
DB17 DB System Check: Configuration
DMIG Start Transaction for Data Migration
DB2 Select Database Activities
DB20 DB Cost-Based Optimizer: Tab. Stats
DB21 DB Cost-Based Optimizer: Config.
DB24 Database Operations Monitor
DB26 DB Profile:Monitor and Configuration
DB2J Manage JCL jobs for OS/390
DBCO Database Connection Maintenance
check them may be they help you to some extent.
regards. -
How to reduce the size of the database
Hi
My recent observation on my DB size and the population of it. Apparently the DB is very fragmented and I have actual data upto 800GB but the container size is more 1.1TB.
Could you kindly recommend me what to do in order to reduce the size of the allocated container space?
I appriciate value suggestions and URLs.
thanks
RajRangarajan wrote:
b) re-organise and then shrink tablespaces.
Means..?In case you are not familiar with the instructions that came with your Oracle database
http://tahiti.oracle.com/
Pick your version, e.g.
http://www.oracle.com/pls/db112/homepage
Type shrink tablespace in the search box at the top of the page
http://www.oracle.com/pls/db112/search?remark=quick_search&word=shrink+tablespace
And pick a link that looks promising and read it, e.g.
http://download.oracle.com/docs/cd/E11882_01/server.112/e10897/storage.htm#ADMQS12071 -
How to control the size of the database
Hi all
Database size will gradually increase day by day is there any tool or possibility to control the size of the database.
Thanks in advance
Gowtham
Moderator message: not directly related to ABAP development, standard "basis" functionality, please have a look in the Netweaver forums.
Edited by: Thomas Zloch on May 23, 2011 9:16 AMHi,
You can control the database size at technical setting level based on ur requirement. Field name is Size category.
Thanks. -
I want to know the size of of database
hi, iam using HP-UX with oracle10G so that, i want to know the size of of database in my system, for that i can use the follwing queries is this is correct or not?
1. select sum(bytes) as total_size from dba_data_files;
ANS is:
TOTAL_SIZE
29718740992
2.select sum(bytes) as free_size from dba_free_space;
ANS is:
FREE_SIZE
6940393472
3. select sum(bytes) as used_size from dba_segments;
ANS is:
USED_SIZE
25215827968
i GOT like this iam not getting is this TOTAL size is 28 GB?????????????
4.select * from DBA_FREE_SPACE_COALESCED;
ANS for this ????????????????
please help me anyone......i want to know the size of of database in my systemDefine "size":
- The total size of the dbf files?
- The total data space used?
- The total tablespace size?
For example, this show the size of a single table, in meg:
select
segment_name table_name,
sum(bytes)/(1024*1024) table_size_meg
from
user_extents
where
segment_type='TABLE'
and
segment_name = 'MYTAB' ;
Mike Ault has a script collection that measures all possible ways to measure database size:
http://www.oracle-script.com
Hope this helps. . .
Don Burleson
Oracle Press author
Author of “Oracle Tuning: The Definitive Reference”
http://www.dba-oracle.com/bp/s_oracle_tuning_book.htm -
Increasing the size of the SGA
I'm using the Oracle Enterprise Manager Database Control on a 10.2.0.4 instance running on Redhat Enterprise Linux. One of the recommendations that the AWR\ADDM always seems to give is: "Increase the size of the SGA by setting the parameter SGA_TARGET to N". I've gone through the process twice already by upping the SGA_MAX_SIZE and SGA_TARGET parameters. It's currently recommending to up it to 6176M, I have not done this yet.
(1) Is this one of the recommendations that you would ignore within the DBCA if performance of the database seemed acceptable?
(2) Why does it always come back from the AWR\ADDM as a recommendation?
(3) What SQL or performance statistics does it do to determine whether the SGA is undersized and how does Oracle determine the SGA recommended size that shows up in the ADDM feedback?
Thanks in advance...Truely new questions do deserve new threads. Questions that are a direct result of responses to the initial question should be asked on the same thread.
If there has been a time gap between the last post on the initial thread and the new question coming to mind then a new thread is probably the better choice.
To answer the question asked if the database is not suffering ORA-04031 errors and performance is OK then I would ignore the recommendation to increase the size of the SGA yet again.
What you might want to do first is reivew how the sga is being used (v$sgastat) and look for bad code technique that leads to needing memory, i.e., the use of SQL that passes constants to Oracle in what would otherwise be the same SQL statement if a bind variable was used and excessive use of Dynamic SQL when again bind variables could have been used in the SQL.
IMHO -- Mark D Powell -- -
To Limiting the size of the attached document in a "Purchase order"
Does anyone knows how to limit the size of the document indexing in an "Purchase order"?
Let me explain:
By the tcode me23n I can create an annex to attach a file to the Purchase order,
right now there is no limitation on the size of it,
is there any way to limit that someone attach a giant file to a purchase order and leave me the Database trembling?
thanks in advance.No cross posting
Read the "Rules of Engagement" -
How to change the size of the caret in a JTextPane
I have text of different font sizes and the default caret height is the height of the text with the maximum font size. How do I change the caret height so that it matches the height of the text with the specified font size ?
This has been a real pain in the butt to figure out, but I think I finally got it. If you create your own caret (subclass of DefaultCaret) then you override its paint() and damage() methods. I was having all kinds of problems with this though. I was getting pieces of carets left behind when I moved with the arrow keys, etc... from the helps I found. The arrow keys were my big problem.
I think I finally figured out that the damage() simply does need to specify an area a little bigger than the old caret so it can blank it out. Then I think others had a logic problem, and Sun does not make this problem clear. What happens it that I think repaint() calls paint() who then uses the bigger x, y, height and width parameters that got set in damage(), which was causing my problems because the damage size was bigger than the size I wanted to create my caret with. What I do is figure out my area from the font I am using (another trick) and make them (the charWd and charHt) variables class variables. I calculate them in damage, use a bigger area to blank out my old caret in damage, and then used the correct caret size I calculated in damage() in paint(), instead of the rectangle values that seem to get passed from damage() to paint(). That was the problem in other examples.
Here is my code:
run with java caretPain
run with java caretPain -1 to see my fixed version
run with java caretPain -2 to see some problems
// written by: Stan Towianski
import java.awt.*;
import java.awt.event.*;
import java.util.Hashtable;
import java.util.ArrayList;
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.event.*;
import javax.swing.undo.*;
import javax.swing.plaf.basic.*;
import javax.swing.text.*;
import javax.swing.plaf.*;
import java.net.URL;
import java.io.*;
import java.beans.*;
public class caretPain extends JFrame {
static caretPain CRTP2;
JPanel contentPane;
JTextPane textPane;
JTextPane textPane2;
JScrollPane scrollPane;
JSplitPane splitPane;
String newline = "\n";
static final int MAX_CHARACTERS = 300100;
static int FrameWidth = 500;
static int FrameHeight = 300;
String caretType = "blockOutline";
static int useSpecialCaret = 0;
DefaultCaret useCaret = new MyCaret();
public caretPain() {
textPane = new JTextPane( new DefaultStyledDocument() );
textPane2 = new JTextPane( new DefaultStyledDocument() );
if ( useSpecialCaret == 1 )
System.out.println( "using special caret 1" );
textPane.setCaret( useCaret );
else if ( useSpecialCaret == 2 )
System.out.println( "using special caret 2" );
textPane.setCaret( new WsCaret() );
textPane.setCaretPosition(0);
textPane.setMargin(new Insets(5,5,5,5));
scrollPane = new JScrollPane(textPane);
textPane.setPreferredSize(new Dimension(FrameWidth, FrameHeight));
JScrollPane scrollPane = new JScrollPane(textPane);
//Create a split pane for the change log and the text area.
splitPane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT,
textPane, textPane2 );
splitPane.setOneTouchExpandable(true);
//Add the components to the frame.
contentPane = new JPanel(new BorderLayout());
contentPane.add(splitPane, BorderLayout.CENTER);
setContentPane(contentPane);
class MyCaret extends DefaultCaret
int charWd = 30;
int charHt = 30;
// draw the caret
public void paint(Graphics g)
System.err.println( "entered MyCaret.paint()" );
if ( ! isVisible() )
System.err.println( "exiting because not visible" );
return;
try {
JTextComponent c = getComponent();
int dot = getDot();
Rectangle r = c.modelToView(dot);
System.err.println("caret: text position: " + dot +
", view location = [" +
r.x + ", " + r.y + "]" +
newline);
g.setColor(c.getCaretColor());
//g.drawLine(r.x, r.y + r.height - 1, r.x + 14, r.y + r.height - 1);
System.err.println( "caretType =" + caretType ); //+ " component =" + c.toString() );
if ( caretType.equals( "blockOutline" ) )
g.drawRect( r.x, r.y, charWd, charHt );
else if ( caretType.equals( "block" ) )
g.fillRect( r.x, r.y, charWd, charHt );
else if ( caretType.equals( "bar" ) )
g.drawLine( r.x, r.y, r.x, r.y + charHt );
catch (BadLocationException e) {
System.err.println( "bad caret loc" + e);
// specify the size of the caret for redrawing
// and do repaint() -- this is called when the
// caret moves
//protected synchronized void damage(Rectangle r)
public synchronized void damage(Rectangle r)
System.err.println( "entered MyCaret.damage()" );
System.err.println("caret.damage(): text position: " + getDot() +
", view location = [" +
r.x + ", " + r.y + "]" +
newline);
//FontMetrics fm = g.getFontMetrics();
//System.out.println( "textPane getfont =" + textPane.getFont() );
//System.out.println( "\n\n read in attribs font size =" + textPane.getInputAttributes().getAttribute(StyleConstants.FontSize) + "\n\n" );
//int ii = Integer.parseInt( (String) textPane.getInputAttributes().getAttribute( StyleConstants.FontSize ) );
int ii = Integer.parseInt( String.valueOf( textPane.getInputAttributes().getAttribute( StyleConstants.FontSize ) ) );
//System.out.println( "textPane input attrib font size =" + ii );
Font f = new Font( "ff", Font.PLAIN, ii );
//System.out.println( "textPane input attrib font =" + f );
FontMetrics fm = getFontMetrics( f );
//FontMetrics fm = g.getFontMetrics();
//FontMetrics fm = getFontMetrics( textPane.getInputAttributes().getAttribute( StyleConstants.FontSize ) );
//MutableAttributeSet inputAttributes = getInputAttributes();
//String fs = textPane.getAttribute( "FontSize" );
//System.out.println( "\n\n read font size =" + textPane.getCharacterAttributes().getAttribute(StyleConstants.FontSize) + "\n\n" );
charWd = fm.charWidth( 'k' );
charHt= fm.getHeight();
//System.out.println( "font width =" + charWd + " font height =" + charHt + " font =" + fm.toString());
if ( r == null )
System.err.println( "caret.damage() return on rectangle == null" );
return;
x = r.x - 2;
y = r.y - 2; // + r.height - 2;
width = charWd + 4; //textPane.getColumnWidth();
height = charHt + 4; //textPane.getRowHeight();
System.err.println("caret.damage(): set caret width, height, x, y =" + width + "," + height + "," + x + "," + y );
repaint();
//repaint();
public class WsCaret extends DefaultCaret {
transient private int[] flagXPoints = new int[3];
transient private int[] flagYPoints = new int[3];
public WsCaret() {
this.setBlinkRate(500);
public void paint(Graphics g) {
if(isVisible()) {
JTextComponent component = this.getComponent();
TextUI mapper = component.getUI();
Rectangle r = null;
try {
r = mapper.modelToView(component, this.getDot());
catch(BadLocationException exc) {}
//System.out.println( "rect r =" + r.toString() );
//g.drawLine(r.x, r.y, r.x, r.y + r.height - 1);
//g.drawLine(r.x+1, r.y, r.x+1, r.y + r.height - 1);
g.drawRect( r.x, r.y, 10, r.height );
Document doc = component.getDocument();
if (doc instanceof AbstractDocument) {
Element bidi = ((AbstractDocument)doc).getBidiRootElement();
if ((bidi != null) && (bidi.getElementCount() > 1)) {
// there are multiple directions present.
flagXPoints[0] = r.x;
flagYPoints[0] = r.y;
flagXPoints[1] = r.x;
flagYPoints[1] = r.y + 4;
flagYPoints[2] = r.y;
flagXPoints[2] = (true) ? r.x + 5 : r.x - 4;
System.out.println( "going g.fillPolygon" );
g.fillPolygon(flagXPoints, flagYPoints, 3);
protected synchronized void damage(Rectangle r) {
if (r != null) {
this.x = r.x - 4;
this.y = r.y;
//there must be a better way to doing this, but for now you
//just increase the width so that it will cover the new caret's size
this.width = 20; // the original width is 10
this.height = r.height;
//this.height = r.height + 20;
//this.height = 10;
repaint();
//The standard main method.
public static void main(String[] args) {
if ( args.length > 0 )
System.out.println( "found arg so will use special caret." );
if ( args[0].equals( "-1" ) )
useSpecialCaret = 1;
else if ( args[0].equals( "-2" ) )
useSpecialCaret = 2;
else
System.out.println( "found no arg so will standard caret." );
System.out.println( "give arg: -1 to get Stan\'s working caret" );
System.out.println( "give arg: -2 to get another example\'s caret" );
try
CRTP2 = new caretPain();
catch (Exception ex)
System.out.println("Error creating CRTP2: " + ex);
ex.printStackTrace();
System.exit(0);
CRTP2.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
public void windowActivated(WindowEvent e) {
CRTP2.textPane.requestFocus();
CRTP2.setTitle( "This is my title you" );
CRTP2.pack();
CRTP2.setVisible(true); -
The size of the target table grows abnormaly
hi all,
I am curently using OWB (version 9 2.0 4 to feed some tables.
we have created a new database 9.2.0.5 for a new datawarehouse.
I have an issue that I really can not explain about the increase size of the target tables.
I take the exemple of a parameter table that contains 4 fields and only 12 rows.
CREATE TABLE SSD_DIM_ACT_INS
ID_ACT_INS INTEGER,
COD_ACT_INS VARCHAR2(10 BYTE),
LIB_ACT_INS VARCHAR2(80 BYTE),
CT_ACT_INS VARCHAR2(10 BYTE)
TABLESPACE IOW_OIN_DAT
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 1M
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
LOGGING
NOCACHE
NOPARALLEL;
this table is feed by a mapping and I use the update/insert option, which generates a Merge.
first the table is empty, I run the maping and I add 14 lines.
the size of the table is now 5 Mo !!
then I delete 2 lines by sql with TOAD
I run a again the mapping. It updates 12 lines and add 2 lines.
at this point,the size of the table has increased of 2 Mo (1 Mo by line !!)
the size of the table is now 7 Mo !!
I do the same again and I get a 9 Mo table
when I delete 2 lines with a SQL statement and create them manually, the size of the table does not change.
when I create a copy of the table with an insert select sql statement the size becomes equal to 1 Mo which is normal.
Could someone explain me how this can be possible.
is it a problem with the database ? with the configuration of OWB ?
what should I check ?
Thank you for your help.Hi all
We have found the reason of the increasing.
Each mapping has a HINT which is defaulted to PARALLEL APPEND. as I understand it, it is use by OWB to determine if an insert allocates of not new space for a table when it runs and insert.
We have changed each one to PARALLEL NOAPPEND and now, it's correct.
Maybe you are looking for
-
JVM Crash on Unix (Solaris)
Hi, I have an application which works fine on Windows environment. If the ear prepared on Windows is deployed on Unix it works fine. But when the application is build in Unix, the application gets deployed but when accessing the application it crashe
-
I am trying to get the last column in an Excel sheet using the Report Generation toolkit. The function "Excel Get Last Row" does not give last column info. Is there a function that will do this? Thanks
-
Hello, I have an smartform who recibes a table of char255 lines. The only thing I do is a loop over it and show each line. My problem is I have some lines with a lot of blank spaces (for example"01 7,50 10,30") and on the scree
-
Hi all, I am creating folder in MENu tab in PFCG tcode for workbooks.But its always RED , and iam new to authorisation , can anybody tell me how to activate it or make it as RED. Pts will be ssigned..
-
OSD display of Brightness fixed
Hi, Download Lenovos version of the Intel Graphics driver http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=MIGR-73677 This will fix the OSD display of brightness issue. The overall screen brightness will also be reduced