Column size in a table
I have a table with 60 million rows. One of the columns is STORE (number 10) and it is part of the primary key.
The biggest number that will have a store in my database has only 6 digits, now my question is:
Should I ALTER TABLE MODIFY("STORE" NUMBER(6))?
Will I reduce space?
Will Index work faster due to a smaller number of bytes to work with?
Am I being paranoic just for deleting a bunch of bytes?
Thanks
It seems like an "asktom" question..
Took from: http://download-uk.oracle.com/docs/cd/B14117_01/server.101/b10743/datatype.htm#i16209
Oracle stores numeric data in variable-length format. Each value is stored in scientific notation, with 1 byte used to store the exponent and up to 20 bytes to store the mantissa. The resulting value is limited to 38 digits of precision. Oracle does not store leading and trailing zeros. For example, the number 412 is stored in a format similar to 4.12 x 102, with 1 byte used to store the exponent(2) and 2 bytes used to store the three significant digits of the mantissa(4,1,2). Negative numbers include the sign in their length.
So, you should save some space but the real question is "is that useful?"
Test it out.. Create two similar tabs and play with them..
Regs,
Acr
Similar Messages
-
How to know columns and table name whose column size are modified
Hi guys
I want to know which all columns in the tables are modify
i.e. list of columns and table name whose column size are modified
Step1 :
CREATE TABLE employees
( employee_number number(5) ,
employee_name varchar2(50) ,
department_id number(10)
CREATE TABLE Supplier
( Supplier_number number(5) ,
Supplier_name varchar2(50) ,
CREATE TABLE customers
( customer_id number(10) not null,
customer_name varchar2(50),
address varchar2(50),
city varchar2(50),
state varchar2(25),
zip_code varchar2(10),
Step2 :
Alter table employees
MODIFY employee_number number(10)
ALTER TABLE supplier
MODIFY supplier_name varchar2(100)
step3
query to dispaly
columnname table name
employee_number employees
supplier_name supplier
How to know columns and table name whose column size are modified
could you please provide query
Thanks in Advance09:35:50 SQL> desc dba_objects
Name Null? Type
OWNER VARCHAR2(30)
OBJECT_NAME VARCHAR2(128)
SUBOBJECT_NAME VARCHAR2(30)
OBJECT_ID NUMBER
DATA_OBJECT_ID NUMBER
OBJECT_TYPE VARCHAR2(19)
CREATED DATE
LAST_DDL_TIME DATE
TIMESTAMP VARCHAR2(19)
STATUS VARCHAR2(7)
TEMPORARY VARCHAR2(1)
GENERATED VARCHAR2(1)
SECONDARY VARCHAR2(1)
NAMESPACE NUMBER
EDITION_NAME VARCHAR2(30)LAST_DDL_TIME can be utilized -
What table column size is needed to accomodate Unicode characters
Hi guys,
I have encounter something which i dont understand and i hope gurus here will shed some light on me.
I am running a non-unicode database and i decided to port the data over to a unicode database.
So
1) i export the schema out --> data.dmp
2) then i create the unicode database + create a user
3) then i import the schema into the database
during the imp i can see that character conversion will take place.
During importing of data into the unicode database
I encounter some error
saying column size is too small
so i went to check the row that has the column value that is too large to fit in the table.
I realise it has some [][][][] data.. so i went to the live non-unicode database and find the row. Indeed it has some [][][][] rubbish data which i feel that someone has inserted other language then english into the database.
But regardless,
I went to modify the column size to a larger size, now the row can be accommodated. However the data is still [][][].
q1) why so ? since now my database is unicode, during the import, this column data [][][] should be converted to unicode already but i still have problem seeing what language it is.
q2) why at the non-unicode database, the [][][] data can fit into the table column size, but on unicode database, the same table column size need to be increase ?
q3) while doing more research on unicode, it was said that unicode character takes up 2 byte per character. Alot of my table data are exactly the same size of the table column size.
E.g Name VARCHAR2(5);
value - 'Peter'
Now if converting to unicode, characters will take 2byte instead of 1, isnt 'PETER' going to take up 10byte ( 2 byte per character ),
why is it that i can still accomodate the data into the table column ?
q4) now with unicode database up, i will be supporting different language characters around the world. How big should i set my column size to ? the longest a name can get ? or ?
Thanks guys!/// does oracle automatically "look" at the each and individual characters in a word and determine how much byte it should take.
Characters usually originate from a keyboard, which has an associated keyboard layout and an associated character set encoding (a.k.a code page, a.k.a. encoding). This means, the keyboard driver knows that when a key with a letter "á" on it is pressed on a French keyboard, and the associated character set encoding is MS Code Page 1252 (Oracle name WE8MSWIN1252), then one byte with the value 225 is generated. If the associated character set encoding is UTF-16LE (standard internal Windows encoding), two bytes 225 and 0 are generated. When the generated bytes travel through APIs, they may undergo character set conversions from one encoding to another encoding. The conversion algorithms use translation tables to find out how to translate given byte sequence from one encoding to another encoding. In case of translation from WE8MSWIN1252 to AL32UTF8, Oracle will know that the byte sequence resulting from conversion of the code 225 should be 195 followed by 161. For a Chinese characters, for example when converting it from ZHS16GBK, Oracle knows the resulting sequence as well, and this sequence is usually 3 bytes.
This is how AL32UTF8 data gets into a database. Now, when Oracle processes a multibyte string, and needs to look at individual characters, for example to count them with LENGTH, or take a substring with SUBSTR, it uses information it has about the structure of the character set. Multibyte character sets are of two type: fixed-width and variable-width. Currently, Oracle supports only one fixed-width multibyte character set in the database: AL16UTF16, which is Oracle's name for Unicode UTF-16BE encoding. It supports this character set for NCHAR/NVARCHAR2/NCLOB data types only. This character set uses two bytes per each character code. To find the next code, 2 is simply added to the string pointer.
All other Oracle multibyte character sets are variable-width character sets, including AL32UTF8. In most cases, the length of each character code can be determined by looking at its first byte. In AL32UTF8, the number of 1-bits in the most significant positions in the first byte before the first 0-bit tells how many bytes a character has. 0 such bits means 1 byte (such codes are identical to 7-bit ASCII), 2 such bits mean two bytes, 3 bits mean 3 bytes, 4 bits mean four bytes. 1 bit (e.g. the bit sequence 10) starts each second, third or fourth byte of a code.
In other ASCII-based multibyte character sets, the number of bytes is usually determined by the value range of the first byte. Bytes below 128 means a one-byte code, bytes above 128 begin a two- or three-byte sequence, depending on the range.
There are also EBCDIC-based (mainframe) multibyte character sets, a.k.a shift-sensitive character sets, where a sequence of two-byte codes is introduced by inserting the SO character (code 14=0x0e) and ended by inserting the SI character (code 15=0x0f). There are also character sets, like ISO-2022-JP, which use more complicated byte sequences to define the length and meaning of byte sequences but Oracle supports them only in limited number of places.
/// e.g i have a word with 4 character. the 3rd character will be a chinese character..the rest are ascii character
/// will oracle use 4 byte per character regardless its ascii(english) or chinese
No.
/// or it will use 1 byte per english character then 3 byte for the chinese character ? e.g.total - 6 bytes taken
It will use 6 bytes.
Thnx,
Sergiusz -
How can we find size of a table having blob columns
I have a problem in which i need to get the size of table that ishaving BLOB column in it.
How to find the size?
for ex: i am having a table DocBlob which is having a BLOB column DocObject. How to get the size of DocBlob table?
Also how one can see the data of the BLOB column. In toad or Pl/Sql dev tool, we can not see anything. here we use to store the images in it. how we can verify that what image or data is stored in these columns??
thanks..Tables are segments. LOB Segments are segments.
SELECT blocks or bytes FROM user_segments
You can also use dbms_lob.getlength to retrieve the length of a LOB.
http://www.morganslibrary.org/reference/dbms_lob.html -
Weblogic LLR tables RECORDSTR column size issues
Hi ,
We have configured the LLR (Last logging resource to emulate 2 Phase commit XA ) non XA datasouce in our weblogic 10.3.5 domain and I see that weblogic internally creates WL_LLR_<servername> tables in the schema confgured with that LLR datasouce per managed server.
But during some transactions commit we are facing an error stating that RECORDSTR column size (which is default 1000 Bytes) is too small for the COMMIT RECORD. It works fine when we increased the RECORDSTR column to 2000 bytes . But the issue is what is the criteria to increase the column size , our application have a large global transactions and will 2000 bytes will be enough to hold that.
So my question is what actually gets stored within the LLR tables for a transaction , transaction logs or COMMIT record ? , what does COMMIT RECORD actually mean?
Is there a way to specify the table and column length of LLR Tables during creation of LLR data sources itself.Maybe this can shed some light on things: http://docs.oracle.com/cd/E21764_01/web.1111/e13737/transactions.htm#i1145819
-
Report Generation excel column size
Dear,
In the project, I save the data in Excel with Report Generation. I would like change just the column size of my Excel report. There is an explanation in the labview help but I have always an error when I run the VI.
I work with labview 8.2
A VI is joined with a simple example.
Regard
Julien
Attachments:
report table graph.vi 21 KBJulien,
I realize you only want to modify columns, but you need to put in a start and stop row value other than -1. Try setting the start and stop rows to 0. -
How to fix the column width in a table in htmlb tableview control
HI Experts,
I have an issue with my htmlb table view controller. I have created a custom iView with a htmlb table view control and placed it in quick navigation window.
When data in columns exceeds, I am getting horizontal scroll bar and column,table are getting extened. I don't want column size increases when text length increses. Instead when lenght of the text incrases in a column, I want the text displyed in multiple columns.
I have tried for this as below.
<hbj:tableView
id="statTable"
model="bean.stattableModel"
design="ALTERNATING"
headerVisible="false"
footerVisible="false"
fillUpEmptyRows="false"
navigationMode="BYPAGE"
selectionMode="NONE"
headerText="Report List"
visibleFirstRow="1"
visibleRowCount="10"
width="100%">
<%
stattableModel.getColumn("D").setWidth("5px");
stattableModel.getColumn("D").setWrapping(false);//tried true aswell
stattableModel.getColumn("H").setWidth("px");
stattableModel.getColumn("H").setWrapping(false);
%>
No change happen ever after I used the above code.
Any one has the idea, how make it work.
Thanks in Advance,
Chinna.Hi Babu,
Please go through this links.
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80a7eef2-9a2c-2a10-12bb-abad552f3302
http://www.sapfans.com/forums/viewtopic.php?f=20&t=300326
Kind regards
Prabhakaran.P -
Need help in analyzing size of a table
Hi,
We have a table DUMMY_TABLE which has a clob column. We need to reduce the size of the table by updating the clob column. The table statistics before updating the clob column is showing 2MB of size as mentioned below. After we run the update script to update the clob column, the table statistics are as shown below (table size increased to 33MB). Can you please let us know, why is the table size getting increased after the update script.
Note: Before the update script the clob column has even bigger data.
Before running the update script:
Table Size - 2 MB
Blocks - 256
Extents - 17
After
running the update script:
Table Size - 33 MB
Blocks - 4224
Extents - 48
The query which we run to get the statistics is: “SELECT * FROM user_segments WHERE segment_name LIKE 'DUMMY_TABLE'”
Update script for updating clob column is:
DECLARE
data1 clob;
BEGIN
data1 :='Dear <%UserFirstName%>,
Below is the password you requested for the <%Company Name%>.
Password: <%xxx%>
To access the login page of the <%Company Name%>, please click on the following web-address:
<%ApplicationURL%><%UserIdentificationValue%>
If your email software does not support web links (i.e. clicking on the web-address does not take you directly to the <%Company Name%>), copy the above web-address into the "Address" or "Location" bar of your Internet web-browser in order to access the CareerTracker.
Sincerely,
Human Resource Department
<%Company Name%>
This is an automated email; please do not reply to this email address.';
UPDATE DUMMY_TABLE SET data = data1;
END;Take the statistics of the tables and check again.
begin
DBMS_STATS.gather_table_stats(ownname=>'syslog',tabname=>'logs');
end;
Regards
Asif Kabir -
Data type column size does not match size of values returned
I've tried searching but couldn't find what I was looking for, sorry if this has been answered or is a duplicate.
I am using the (Java) method below to get the column definitions of a table. I am doing this through an ODBC connection (using Oracle ODBC driver) and I have NO CHOICE in the matter.
The problem I am having is that one particular column has a column size is smaller than the size of the data it purportedly holds (ie attendance_code = varchar size 3 but data value is "Absent". I suspect the data is actually a look up to situation, where my attendance_code column has a value of 'ABS' and Oracle goes and fetchs the "Absent" value.
My issue is that the meta data returned from ODBC is the actual column definition (ie varchar(3) and not varchar2(10) for example).
The resultset metadata has a size of 3 for the column in question, and querying the schema also yields 3 for that column.
How do I resolve this? I do not have access to all_columns table etc. I have to do it using ODBC metadata only.
I've tried recreating the situation using the Oracle XE DB, but as I am not familiar with Oracle, I do not know how to recreate this scenario (which would then lead me to test other options with ODBC).
TIA.
The select I am using is SELECT * FROM <tableName>.
public ArrayList<SchemaColumn> getColumnsForTable(String catalog,
String schema,
String tableName) {
ArrayList<SchemaColumn> columns = new ArrayList<SchemaColumn>();
ResultSet rs = null;
try {
DatabaseMetaData metaData = connection.getMetaData();
rs = metaData.getColumns(catalog, schema, tableName, "%");
SchemaColumn column;
while (rs.next()) {
column = new SchemaColumn();
column.setName(rs.getString("COLUMN_NAME"));
column.setDataType(rs.getInt("DATA_TYPE"));
column.setTypeName(rs.getString("TYPE_NAME"));
column.setColumnSize(rs.getInt("COLUMN_SIZE")); <-------- this is the value that is coming back smaller than the data it actually returns
column.setDecimalDigits(rs.getInt("DECIMAL_DIGITS"));
column.setNumPrecisionRadix(rs.getInt("NUM_PREC_RADIX"));
column.setNullable(rs.getInt("NULLABLE"));
column.setRemarks(rs.getString("REMARKS"));
column.setDefaultValue(rs.getString("COLUMN_DEF"));
column.setSqlDataType(rs.getInt("SQL_DATA_TYPE"));
column.setSqlDateTimeSub(rs.getInt("SQL_DATETIME_SUB"));
column.setCharOctetLength(rs.getInt("CHAR_OCTET_LENGTH"));
column.setOrdinalPosition(rs.getInt("ORDINAL_POSITION"));
columns.add(column);
} catch (Exception e) {
Log.getLogger().error("Could not capture table schema");
closeResultSet(rs);
return columns;
}I can't say I've ever seen a case where a column held more data than it was declared as, and would have to file that under "see it to believe it" category.
Even if that somehow were the case, I'd expect the ODBC driver to return what the column is defined as anyway, not the data. The data changes with every row, but I'd expect the table metadata to be consistent, and refer to the table definition.
For grins though, can you provide system.out.println output of the metadata, and also a "describe xxxx" from sqlplus if you can, where xxx is the table name?
ie,
while (rs.next()) {
System.out.println("column name is " + rs.getString("COLUMN_NAME"));
System.out.println("data type is " + rs.getInt("DATA_TYPE"));
..etc..
Greg -
Create materialized view with specific column sizes
Hi all,
I'm trying to create a materialized view with a specific a column size. Something like
create materialized view test_mv
refresh force on demand
as
select id,
cast(my_compound_field as nvarchar2(50))
from ( select id,
field1 || field2 my_compound_field
from my_table);But Oracle seems to ignore the cast and takes the maximum size it finds for field1 || field2 in the select query. The resulting table has a column nvarchar2(44) instead of nvarchar2(50).
This can give a problem when the view is refreshed... there could be new data that exceeds the current size, i.e. where length(field1 || field2) > 44.
How can I override the column size of a field in a materialized view?
Edit: Some additional info to clarify my case:
field1 and field2 are defined as nvarchar2(25). field1 || field2 can theoretically have a length of 50, but there is currently no data in my table that results in that length, the max is 44. I am afraid that there will be data in the future that exceeds 44, resulting in an error when the MV is refreshed!
Edited by: Pleiadian on Jan 25, 2011 2:06 PMCannot reproduce what you are saying is happening.
SQL> create table t (a nvarchar2(50), b nvarchar2(50));
Table created.
SQL> create materialized view tmv as
2 select a, b, a || b c from t;
Materialized view created.
SQL> desc tmv
Name Null? Type
A NVARCHAR2(50)
B NVARCHAR2(50)
C NVARCHAR2(100)
SQL> drop materialized view tmv;
Materialized view dropped.
SQL> create materialized view tmv as
2 select a, b, substr(a || b, 1, 10) c from t;
Materialized view created.
SQL> desc tmv
Name Null? Type
A NVARCHAR2(50)
B NVARCHAR2(50)
C NVARCHAR2(10)
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for Linux: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
SQL>Edited by: 3360 on Jan 25, 2011 8:10 AM
And with data
SQL> insert into t values ('3123423423143hhshgvcdcvw', 'ydgeew gdfwe dfefde wfjjjjjjj');
1 row created.
SQL> commit;
Commit complete.
SQL> desc tmv
Name Null? Type
A NVARCHAR2(50)
B NVARCHAR2(50)
C NVARCHAR2(10)
SQL> select * from tmv;
A
B C
3123423423143hhshgvcdcvw
ydgeew gdfwe dfefde wfjjjjjjj 3123423423 -
How to get the size of the table
Hi All,
How to get the size of the table in Oracle 10g?
Is there any script which needs to be run?
Regards,
ApoorvHi All,
Sorry but somehow the table user_segments is not populated in my case. But we have another table SYS.ALL_TABLES whose structure is given below. Would I be able to calculate the table size based on the columns given below:
ColumnName Data Type
OWNER VARCHAR2 (30 Byte)
TABLE_NAME VARCHAR2 (30 Byte)
TABLESPACE_NAME VARCHAR2 (30 Byte)
CLUSTER_NAME VARCHAR2 (30 Byte)
IOT_NAME VARCHAR2 (30 Byte)
STATUS VARCHAR2 (8 Byte)
PCT_FREE NUMBER
PCT_USED NUMBER
INI_TRANS NUMBER
MAX_TRANS NUMBER
INITIAL_EXTENT NUMBER
NEXT_EXTENT NUMBER
MIN_EXTENTS NUMBER
MAX_EXTENTS NUMBER
PCT_INCREASE NUMBER
FREELISTS NUMBER
FREELIST_GROUPS NUMBER
LOGGING VARCHAR2 (3 Byte)
BACKED_UP VARCHAR2 (1 Byte)
NUM_ROWS NUMBER
BLOCKS NUMBER
EMPTY_BLOCKS NUMBER
AVG_SPACE NUMBER
CHAIN_CNT NUMBER
AVG_ROW_LEN NUMBER
AVG_SPACE_FREELIST_BLOCKS NUMBER
NUM_FREELIST_BLOCKS NUMBER
DEGREE VARCHAR2 (10 Byte)
INSTANCES VARCHAR2 (10 Byte)
CACHE VARCHAR2 (5 Byte)
TABLE_LOCK VARCHAR2 (8 Byte)
SAMPLE_SIZE NUMBER
LAST_ANALYZED DATE
PARTITIONED VARCHAR2 (3 Byte)
IOT_TYPE VARCHAR2 (12 Byte)
TEMPORARY VARCHAR2 (1 Byte)
SECONDARY VARCHAR2 (1 Byte)
NESTED VARCHAR2 (3 Byte)
BUFFER_POOL VARCHAR2 (7 Byte)
ROW_MOVEMENT VARCHAR2 (8 Byte)
GLOBAL_STATS VARCHAR2 (3 Byte)
USER_STATS VARCHAR2 (3 Byte)
DURATION VARCHAR2 (15 Byte)
SKIP_CORRUPT VARCHAR2 (8 Byte)
MONITORING VARCHAR2 (3 Byte)
CLUSTER_OWNER VARCHAR2 (30 Byte)
DEPENDENCIES VARCHAR2 (8 Byte)
COMPRESSION VARCHAR2 (8 Byte)
DROPPED VARCHAR2 (3 Byte) -
How to increase the column size of Alv tbale
Hi All,
I created an Alv table to display the content of my database table. In one of the column the entire data from my database are not displayed the last few characters are missing. The data type for that column in the database is char. Can any one help me how to increase the column size in my Alv table or any suggestions to resolve this issue.Hi Vadiv,
Try with this..
DATA: LR_IF_CONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE,
LR_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE,
LR_CMDL TYPE REF TO CL_SALV_WD_CONFIG_TABLE,
LR_TABLE_SETTING TYPE REF TO IF_SALV_WD_TABLE_SETTINGS.
LR_CMP_USAGE = WD_THIS->WD_CPUSE_ALV( ).
IF LR_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
LR_CMP_USAGE->CREATE_COMPONENT( ).
ENDIF.
" get reference to the ALV model
LR_IF_CONTROLLER = WD_THIS->WD_CPIFC_ALV( ).
LR_CMDL = LR_IF_CONTROLLER->GET_MODEL( ).
LR_TABLE_SETTING ?= LR_CMDL.
" Set column width
DATA LR_COL TYPE REF TO CL_SALV_WD_COLUMN.
LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'PERNR' ).
LR_COL->SET_WIDTH( '70' ) .
LR_COL = LR_CMDL->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'ENAME' ).
LR_COL->SET_WIDTH( '100' ) .
LR_TABLE_SETTING->SET_FIXED_TABLE_LAYOUT( ABAP_TRUE ).
You can refer to webdynpro component SALV_WD_TEST_TABLE_PROPS. Go to the view TABLE and look inside the method SET_COLUMN_SETTINGS. I hope this will help you.
Cheers,
Kris. -
Gather_table_stats with a method opt of "for all indexed columns size 0"
I have 9 databases I support that contain the same structure, and very similar data concentrations. We are seeing inconsistent performance in the different databases due to bind variable peeking.. I have tracked it down to the Min and Max values that are gathered during the analyze. I analyze from one cluster, and export/import those statistics into the other clusters.. I then go about locking down the stats gathered. Some of the statistics are on tables that contain transient data (the older data is purged, and new data gets a new PK sequence number).
Since I am gathering statistics with a 'FOR ALL INDEXED COLUMNS SIZE 1', a min and max value are grabbed. This value is only appropriate for a short period of time, and only for a specific database. I do want oracle to know the density to help calculate, but I don't want cardinality based on whether the current bind values fall in this range..
Example
COLUMN PK
When I analyze the min is 1 and max is 5. I then let the database run, and the new min is 100 and max is 105.. same number of rows, but different min/max. At first a select * from table where pk>=1 and pk <=5 would return a cardinality of 5.. Later, a seelct * from tables where pk>=100 and pk<=105 would return a cardinaility 1.
Any ideas how to avoid this other than trying set min and max to something myself (like min =1 max = 99999999). ??MarkDPowell wrote:
The Oracle documentation on bind variable peeking said it did not peek without histograms and I cannot remember ever seeing on 9.2 where the trace showed otherwise. Mark,
see this simple test case run on 9.2.0.8. No histograms, but bind variable peeking, as you can see that the EXPLAIN PLAN output generated by AUTOTRACE differs from the estimated cardinality of the actual plan used at runtime.
Which documentation do you refer to?
SQL>
SQL> alter session set nls_language = 'AMERICAN';
Session altered.
SQL>
SQL> drop table bind_peek_test;
Table dropped.
SQL>
SQL> create table bind_peek_test
2 as
3 select
4 100 as n1
5 , cast(dbms_random.string('a', 20) as varchar2(20)) as filler
6 from
7 dual
8 connect by
9 level <= 1000;
Table created.
SQL>
SQL> exec dbms_stats.gather_table_stats(null, 'bind_peek_test', method_opt=>'FOR ALL COLUMNS SIZE 1')
PL/SQL procedure successfully completed.
SQL>
SQL> variable n number
SQL>
SQL> variable n2 number
SQL>
SQL> alter system flush shared_pool;
System altered.
SQL>
SQL> exec :n := 1; :n2 := 50;
PL/SQL procedure successfully completed.
SQL>
SQL> set autotrace traceonly
SQL>
SQL> select * from bind_peek_test where n1 >= :n and n1 <= :n2;
no rows selected
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1000 Bytes=24
000)
1 0 FILTER
2 1 TABLE ACCESS (FULL) OF 'BIND_PEEK_TEST' (Cost=2 Card=100
0 Bytes=24000)
Statistics
236 recursive calls
0 db block gets
35 consistent gets
0 physical reads
0 redo size
299 bytes sent via SQL*Net to client
372 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
4 sorts (memory)
0 sorts (disk)
0 rows processed
SQL>
SQL> set autotrace off
SQL>
SQL> select
2 cardinality
3 from
4 v$sql_plan
5 where
6 cardinality is not null
7 and hash_value in (
8 select
9 hash_value
10 from
11 v$sql
12 where
13 sql_text like 'select * from bind_peek_test%'
14 );
CARDINALITY
1
SQL>
SQL> alter system flush shared_pool;
System altered.
SQL>
SQL> exec :n := 100; :n2 := 100;
PL/SQL procedure successfully completed.
SQL>
SQL> set autotrace traceonly
SQL>
SQL> select * from bind_peek_test where n1 >= :n and n1 <= :n2;
1000 rows selected.
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1000 Bytes=24
000)
1 0 FILTER
2 1 TABLE ACCESS (FULL) OF 'BIND_PEEK_TEST' (Cost=2 Card=100
0 Bytes=24000)
Statistics
236 recursive calls
0 db block gets
102 consistent gets
0 physical reads
0 redo size
34435 bytes sent via SQL*Net to client
1109 bytes received via SQL*Net from client
68 SQL*Net roundtrips to/from client
4 sorts (memory)
0 sorts (disk)
1000 rows processed
SQL>
SQL> set autotrace off
SQL>
SQL> select
2 cardinality
3 from
4 v$sql_plan
5 where
6 cardinality is not null
7 and hash_value = (
8 select
9 hash_value
10 from
11 v$sql
12 where
13 sql_text like 'select * from bind_peek_test%'
14 );
CARDINALITY
1000
SQL>
SQL> spool offRegards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
Checking the total size of a table with VARARRAY objects
Hi,
I have a table PEARSON_RESULTS which stores some 3-4 fields along with a VARARRAY object. I have prepared this table using a plain relational table (which contained no VARARRAY object) as input. The plain relational table has segment size of 6GB. But when I run query
sql> SELECT SUM(BYTES) FROM USER_SEGMENTS WHERE SEGMENT_NAME = 'PEARSON_RESULTS'
This query result is just 2MB . Therefore I guess that the VARARRAY objects might be stored in some other segments (other than the primary table) which I am not aware of.
Could someone please tell me how to calculate the size of a table having VARARRAY column correctly.
Thanks,
AnujIf the VARRAY is stored as a LOB, you can query DBA_LOBS to get segment_name and segment_sizes for related LOBs.
-
Resizing Column Width in Pivot Tables
Hi,
Can anyone help with adjusting the size of columns in a pivot table. I have 3 measure across 12 months on a page:
Total Volume Total Margin (%) Total Contribution
Market Jan 2010 Feb 2010 Mar 2010 Apr 2010 May 2010 Jun 2010 Jul 2010 Jan 2010 Feb 2010 Mar 2010 Apr 2010 May 2010 Jun 2010 Jul 2010 Jan 2010 Feb 2010 Mar 2010 Apr 2010 May 2010 Jun 2010 Jul 2010
The months on some measures are rolling up and the others are on one line, can the width of the column be wrapped or adjusted?
ThanksHi,
Yes,it can be.Click on a column and Go to Format Values>Additional Formatting Options>width.Try putting 50%,60% if you want them to expand.
Similiarly Format heading will work for heading size.
You have to play around with this to suit your requirements.
Thanks
Sandeep
Maybe you are looking for
-
Error when Opening a Crystal Report in a Web Application
Hi All, How are things? We are trying to open a Crystal report in a Web Application based on a Web service on Appache Tomcat. The report is in the Test Environment poiting to a SQL 2005 Database. The report opens and runs fine in Crystal Reports and
-
Java Stack is not started in SAP netweaver ABAP+JAVA Stack
Dear All, Win2003 64 bit , ECC6.0 , Oracle 10.2.0.2. Its a newly installed SAP Netweaver Dual Stack (PI) , Yesterday i have done Client copy from 001 to 999 (SAP_UCUS). Client copy also successfully completed . login/system_client=999 ,i have activa
-
Problem with search forms in master-detail structure
According to JHeadstart error message i cant generate 2 search forms in one page, BUT i generated master table in one page and master form + detail table in another so WHY i cant put search forms for both tables?? They are on the different pages! How
-
I know the iPhone does not have the copy & paste function but does anyone know if there is a program or some how to get this feature? There are quotes, spell check and other info I want to copy from web pages / notes then be able to paste via email.
-
hi i have image data in a bytearray that is in either gif or jpeg format, how can i create an image using the byte array thanks in advance have a nice time