Multiple Blocksizes
hi everyone, can someone put some light to clear some points
i am reading about having mutiple blocksizes in database, i want some clarification on these points
1> Moving Oracle indexes into a fully-cached 32k buffer will ensure that Oracle favors index access, reducing unnecessary full-table scans and greatly reducing logical I/O because adjacent index nodes will reside within the larger, 32k block.
2>Tables with heavy write activities will benefit from smaller block sizes.
Thanks
Shrma wrote:
hi everyone, can someone put some light to clear some points
i am reading about having mutiple blocksizes in database, i want some clarification on these points
1> Moving Oracle indexes into a fully-cached 32k buffer will ensure that Oracle favors index access, reducing unnecessary full-table scans and greatly reducing logical I/O because adjacent index nodes will reside within the larger, 32k block.
2>Tables with heavy write activities will benefit from smaller block sizes.
ThanksSee the [note here.|http://download.oracle.com/docs/cd/E11882_01/server.112/e10821/iodesign.htm#PFGRF94404] [See here|http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/physical.htm#sthref529] about when they are primarily useful.
Unless you carefully prove that there is an advantage in your exact situation, don't bother.
Similar Messages
-
Hi
When I use multiple block size tablespaces.(32K)
I have to set DB_32K_CACHE_SIZE parameter.
Assume the size of the buffer cache is 500m.
If I set DB_32K_CACHE_SIZE to 200M.
Will there be only 300m available in buffer cache? how is the allocation works?The vast majority of databases do not need to deploy multiple blocksizes.
As noted here it is not for all databases only specific: http://www.dba-oracle.com/t_multiple_blocksizes_summary.htm
I have some doubts in this issue...When in doubt consult the official documentation and metalink.
Here is IBM's Oracle documentation on multiple blocksizes: http://www-03.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/WP100883
While most customers only use the default database block size, it is possible to use up to 5 different database block sizes for different objects within the same database.
Having multiple database block sizes adds administrative complexity and (if poorly designed and implemented) can have adverse performance consequences. Therefore, using multiple block sizes should only be done after careful planning and performance evaluation. -
to_date('03-23-2010','mm-dd-yyyy')
to_date('2008-06-08','yyyy-mm-dd')
DBMS_OUTPUT.PUT_LINE(' 4th Where clause: ' || WHERE_CLAUSE);
HKey_Local Machine -> Software -> Microsoft -> MSLicensing
topas
Removing batch of Files in linux:
=====================================
find . -name "*.arc" -mtime +20 -exec rm -f {} \;
find . -name "*.dbf" -mtime +60 -exec mv {} /backup/Arch_Bkp_02May11/ \;
ALTER DATABASE
SET STANDBY DATABASE TO MAXIMIZE {AVAILABILITY | PERFORMANCE | PROTECTION};
================================================================================
Find top N records:
===================
select * from (select ename from emp order by sal)
where rownum <=n;
Find top Nth record: (n=0 for 1st highest)
=========================================
select * from emp a
where (n =
(select count(distinct b.sal) from emp b
where b.sal > a.sal));
Query for Listing last n records from the table
=================================================
select * from (select * from emp order by rownum desc) where rownum<4
HOW TO tablespace wise and file wise info
============================
col file_name for a45
col tablespace_name for a15
set linesize 132
select a.tablespace_name,a.file_name,a.AUTOEXTENSIBLE,----a.status,
round(a.bytes/1024/1024,2) Total_MB,
round(sum(b.bytes)/1024/1024,2) Free_MB,
round((a.bytes/1024/1024 - sum(b.bytes)/1024/1024),2) Used_MB
from dba_data_files a,dba_free_space b
where a.file_id=b.file_id
and a.tablespace_name=b.tablespace_name
group by a.tablespace_name,b.file_id,a.file_name,a.bytes,a.AUTOEXTENSIBLE--,a.status
order by tablespace_name;
col tablespace_name for a15
SELECT tablespace_name,ts_#,num_files,sum_free_mbytes,count_blocks,max_mbytes,
sum_alloc_mbytes,DECODE(sum_alloc_mbytes,0,0,100 * sum_free_mbytes /sum_alloc_mbytes ) AS pct_free
FROM (SELECT v.name AS tablespace_name,ts# AS ts_#,
NVL(SUM(bytes)/1048576,0) AS sum_alloc_mbytes,
NVL(COUNT(file_name),0) AS num_files
FROM dba_data_files f,v$tablespace v
WHERE v.name = f.tablespace_name (+)
GROUP BY v.name,ts#),
(SELECT v.name AS fs_ts_name,ts#,NVL(MAX(bytes)/1048576,0) AS max_mbytes,
NVL(COUNT(BLOCKS) ,0) AS count_blocks,
NVL(SUM(bytes)/1048576,0) AS sum_free_mbytes
FROM dba_free_space f,v$tablespace v
WHERE v.name = f.tablespace_name(+)
GROUP BY v.name,ts#)
WHERE tablespace_name = fs_ts_name
ORDER BY tablespace_name;
==================================
col file_name for a45
col tablespace_name for a15
set linesize 132
select a.tablespace_name,a.file_name,a.AUTOEXTENSIBLE,----a.status,
round(a.bytes/1024/1024,2) Total_MB,
round(sum(b.bytes)/1024/1024,2) Free_MB,
round((a.bytes/1024/1024 - sum(b.bytes)/1024/1024),2) Used_MB
from dba_data_files a,dba_free_space b
where a.file_id=b.file_id
and a.tablespace_name=b.tablespace_name
group by a.tablespace_name,b.file_id,a.file_name,a.bytes,a.AUTOEXTENSIBLE--,a.status
order by file_name;
=============================================================
HOW TO FIND CHILD TABLES
===========================================
col column_name for a30
col owner for a10
set linesize 132
select --a.table_name parent_table,
b.owner,
b.table_name child_table
, a.constraint_name , b.constraint_name
from dba_constraints a ,dba_constraints b
where a.owner='LEIQA20091118'
and a.constraint_name = b.r_constraint_name
--and b.constraint_type = 'R'
and a.constraint_type IN ('P','U')
and a.table_name =upper('&tabname');
List foreign keys and referenced table and columns:
======================================================
SELECT DECODE(c.status,'ENABLED','C','c') t,
SUBSTR(c.constraint_name,1,31) relation,
SUBSTR(cc.column_name,1,24) columnname,
SUBSTR(p.table_name,1,20) tablename
FROM user_cons_columns cc, user_constraints p,
user_constraints c
WHERE c.table_name = upper('&table_name')
AND c.constraint_type = 'R'
AND p.constraint_name = c.r_constraint_name
AND cc.constraint_name = c.constraint_name
AND cc.table_name = c.table_name
UNION ALL
SELECT DECODE(c.status,'ENABLED','P','p') t,
SUBSTR(c.constraint_name,1,31) relation,
SUBSTR(cc.column_name,1,24) columnname,
SUBSTR(c.table_name,1,20) tablename
FROM user_cons_columns cc, user_constraints p,
user_constraints c
WHERE p.table_name = upper('PERSON')
AND p.constraint_type in ('P','U')
AND c.r_constraint_name = p.constraint_name
AND c.constraint_type = 'R'
AND cc.constraint_name = c.constraint_name
AND cc.table_name = c.table_name
ORDER BY 1, 4, 2, 3
List a child table's referential constraints and their associated parent table:
==============================================================
SELECT t.owner CHILD_OWNER,
t.table_name CHILD_TABLE,
t.constraint_name FOREIGN_KEY_NAME,
r.owner PARENT_OWNER,
r.table_name PARENT_TABLE,
r.constraint_name PARENT_CONSTRAINT
FROM user_constraints t, user_constraints r
WHERE t.r_constraint_name = r.constraint_name
AND t.r_owner = r.owner
AND t.constraint_type='R'
AND t.table_name = <child_table_name>;
parent tables:
================
select constraint_name,constraint_type,r_constraint_name
from dba_constraints
where table_name ='TM_PAY_BILL'
and constraint_type in ('R');
select CONSTRAINT_NAME,TABLE_NAME,COLUMN_NAME from user_cons_columns where table_name='FS_FR_TERMINALLOCATION';
select a.OWNER,a.TABLE_NAME,a.CONSTRAINT_NAME,a.CONSTRAINT_TYPE
,b.COLUMN_NAME,b.POSITION
from dba_constraints a,dba_cons_columns b
where a.CONSTRAINT_NAME=b.CONSTRAINT_NAME
and a.TABLE_NAME=b.TABLE_NAME
and a.table_name=upper('TM_GEN_INSTRUCTION')
and a.constraint_type in ('P','U');
select constraint_name,constraint_type,r_constraint_name
from dba_constraints
where table_name ='TM_PAY_BILL'
and constraint_type in ('R');
===============================================
HOW TO FIND INDEXES
=====================================
col column_name for a30
col owner for a25
select a.owner,a.index_name, --a.table_name,a.tablespace_name,
b.column_name,b.column_position
from dba_indexes a,dba_ind_columns b
where a.owner='SCE'
and a.index_name=b.index_name
and a.table_name = upper('&tabname')
order by a.index_name,b.column_position;
col column_name for a40
col index_owner for a15
select index_owner,index_name,column_name,
column_position from dba_ind_columns
where table_owner= upper('VISILOGQA19') and table_name ='TBLTRANSACTIONGROUPMAIN';
-- check for index on FK
===============================
set linesize 121
col status format a6
col columns format a30 word_wrapped
col table_name format a30 word_wrapped
SELECT DECODE(b.table_name, NULL, 'Not Indexed', 'Indexed' ) STATUS, a.table_name, a.columns, b.columns from (
SELECT SUBSTR(a.table_name,1,30) table_name,
SUBSTR(a.constraint_name,1,30) constraint_name, MAX(DECODE(position, 1,
SUBSTR(column_name,1,30),NULL)) || MAX(DECODE(position, 2,', '|| SUBSTR(column_name,1,30),NULL)) || max(DECODE(position, 3,', '|| SUBSTR(column_name,1,30),NULL)) || max(DECODE(position, 4,', '|| SUBSTR(column_name,1,30),NULL)) || max(DECODE(position, 5,', '|| SUBSTR(column_name,1,30),NULL)) || max(DECODE(position, 6,', '|| SUBSTR(column_name,1,30),NULL)) || max(DECODE(position, 7,', '|| SUBSTR(column_name,1,30),NULL)) || max(DECODE(position, 8,', '|| SUBSTR(column_name,1,30),NULL)) || max(DECODE(position, 9,', '|| SUBSTR(column_name,1,30),NULL)) || max(DECODE(position,10,', '|| SUBSTR(column_name,1,30),NULL)) || max(DECODE(position,11,', '|| SUBSTR(column_name,1,30),NULL)) || max(DECODE(position,12,', '|| SUBSTR(column_name,1,30),NULL)) || max(DECODE(position,13,', '|| SUBSTR(column_name,1,30),NULL)) || max(DECODE(position,14,', '|| SUBSTR(column_name,1,30),NULL)) || max(DECODE(position,15,', '|| SUBSTR(column_name,1,30),NULL)) || max(DECODE(position,16,', '|| SUBSTR(column_name,1,30),NULL)) columns
from user_cons_columns a, user_constraints b
WHERE a.constraint_name = b.constraint_name
AND constraint_type = 'R'
GROUP BY SUBSTR(a.table_name,1,30), SUBSTR(a.constraint_name,1,30) ) a, (
SELECT SUBSTR(table_name,1,30) table_name,
SUBSTR(index_name,1,30) index_name, MAX(DECODE(column_position, 1,
SUBSTR(column_name,1,30),NULL)) || MAX(DECODE(column_position, 2,', '||SUBSTR(column_name,1,30),NULL)) || max(DECODE(column_position, 3,', '||SUBSTR(column_name,1,30),NULL)) || max(DECODE(column_position, 4,', '||SUBSTR(column_name,1,30),NULL)) || max(DECODE(column_position, 5,', '||SUBSTR(column_name,1,30),NULL)) || max(DECODE(column_position, 6,', '||SUBSTR(column_name,1,30),NULL)) || max(DECODE(column_position, 7,', '||SUBSTR(column_name,1,30),NULL)) || max(DECODE(column_position, 8,', '||SUBSTR(column_name,1,30),NULL)) || max(DECODE(column_position, 9,', '||SUBSTR(column_name,1,30),NULL)) || max(DECODE(column_position,10,', '||SUBSTR(column_name,1,30),NULL)) || max(DECODE(column_position,11,', '||SUBSTR(column_name,1,30),NULL)) || max(DECODE(column_position,12,', '||SUBSTR(column_name,1,30),NULL)) || max(DECODE(column_position,13,', '||SUBSTR(column_name,1,30),NULL)) || max(DECODE(column_position,14,', '||SUBSTR(column_name,1,30),NULL)) || max(DECODE(column_position,15,', '||SUBSTR(column_name,1,30),NULL)) || max(DECODE(column_position,16,', '||SUBSTR(column_name,1,30),NULL)) columns
from user_ind_columns group by SUBSTR(table_name,1,30), SUBSTR(index_name,1,30) ) b
where a.table_name = b.table_name (+) and b.columns (+) like a.columns || '%';
==================================================
HOW TO FIND unique keys
===========================
col column_name for a30
col owner for a10
set linesize 132
select a.owner , --a.table_name,
a.constraint_name,a.constraint_type,
b.column_name,b.position
from dba_constraints a, dba_cons_columns b
where a.table_name = upper('&tabname')
and a.constraint_name = b.constraint_name
and a.constraint_type in ('P','U')
and a.owner=b.owner
order by a.owner,a.constraint_name,b.position;
==================================
HOW TO FIND ROWlocks
======================
col object_name for a30
col terminal for a20
set linesize 1000
col spid for a10
col osuser for a15
select to_char(logon_time,'DD-MON-YYYY HH24:MI:SS'),OSUSER,--owner,
s.sid, s.serial#,p.spid,
s.terminal,l.locked_mode,o.object_name,l.ORACLE_USERNAME --,o.object_type
from v$session s, dba_objects o,v$locked_object l, V$process p
where o.object_id=l.object_id
and s.sid=l.session_id
and s.paddr=p.addr
order by logon_time;
SELECT OWNER||'.'||OBJECT_NAME AS Object, OS_USER_NAME, ORACLE_USERNAME,
PROGRAM, NVL(lockwait,'ACTIVE') AS Lockwait,DECODE(LOCKED_MODE, 2,
'ROW SHARE', 3, 'ROW EXCLUSIVE', 4, 'SHARE', 5,'SHARE ROW EXCLUSIVE',
6, 'EXCLUSIVE', 'UNKNOWN') AS Locked_mode, OBJECT_TYPE, SESSION_ID, SERIAL#, c.SID
FROM SYS.V_$LOCKED_OBJECT A, SYS.ALL_OBJECTS B, SYS.V_$SESSION c
WHERE A.OBJECT_ID = B.OBJECT_ID AND C.SID = A.SESSION_ID
ORDER BY Object ASC, lockwait DESC;
SELECT DECODE(request,0,'Holder: ','Waiter: ')||sid sess,
id1, id2, lmode, request, type
FROM V$LOCK
WHERE (id1, id2, type) IN
(SELECT id1, id2, type FROM V$LOCK WHERE request>0)
ORDER BY id1, request;
find locks
=====================
set linesize 1000
SELECT --osuser,
a.username,a.serial#,a.sid,--a.terminal,
sql_text
from v$session a, v$sqltext b, V$process p
where a.sql_address =b.address
and a.paddr = p.addr
and p.spid = '&os_pid'
order by address, piece;
select sql_text
from V$sqltext_with_newlines
where address =
(select prev_sql_addr
from V$session
where username = :uname and sid = :snum) ORDER BY piece
set pagesize 50000
set linesize 30000
set long 500000
set head off
select s.username su,s.sid,s.serial#,substr(sa.sql_text,1,540) txt
from v$process p,v$session s,v$sqlarea sa
where p.addr=s.paddr
and s.username is not null
and s.sql_address=sa.address(+)
and s.sql_hash_value=sa.hash_value(+)
and spid=&SPID;
privileges
===========
select * from dba_sys_privs where grantee = 'SCE';
select * from dba_role_privs where grantee = 'SCE'
select * from dba_sys_privs where grantee in ('CONNECT','APPL_CONNECT');
Check high_water_mark_statistics
===================================
select * from DBA_HIGH_WATER_MARK_STATISTICS;
Multiple Blocksizes:
=========================
alter system set db_16k_cache_size=64m;
create tablespace index_ts datafile '/data1/index_ts01.dbf' size 10240m blocksize 16384;
11g default profiles:
========================
alter profile default limit password_lock_time unlimited;
alter profile default limit password_life_time unlimited;
alter profile default limit password_grace_time unlimited;
logfile switch over:
select GROUP#,THREAD#,SEQUENCE#,BYTES,MEMBERS,ARCHIVED,
STATUS,to_char(FIRST_TIME,'DD-MON-YYYY HH24:MI:SS') switch_time
from v$log;
Temporary tablespace usage:
============================
SELECT b.tablespace,
ROUND(((b.blocks*p.value)/1024/1024),2)||'M' "SIZE",
a.sid||','||a.serial# SID_SERIAL,
a.username,
a.program
FROM sys.v_$session a,
sys.v_$sort_usage b,
sys.v_$parameter p
WHERE p.name = 'db_block_size'
AND a.saddr = b.session_addr
ORDER BY b.tablespace, b.blocks;
SELECT A2.TABLESPACE, A2.SEGFILE#, A2.SEGBLK#, A2.BLOCKS,
A1.SID, A1.SERIAL#, A1.USERNAME, A1.OSUSER, A1.STATUS
FROM V$SESSION A1,V$SORT_USAGE A2 WHERE A1.SADDR = A2.SESSION_ADDR;
========================================
ALTER SYSTEM KILL SESSION 'SID,SERIAL#';
Inactive sessions killing:
SELECT 'ALTER SYSTEM KILL SESSION ' || '''' || SID || ',' ||
serial# || '''' || ' immediate;' text
FROM v$session
WHERE status = 'INACTIVE'
AND last_call_et > 86400
AND username IN (SELECT username FROM DBA_USERS WHERE user_id>56);
Procedure:
CREATE OR REPLACE PROCEDURE Inactive_Session_Cleanup AS
BEGIN
FOR rec_session IN (SELECT 'ALTER SYSTEM KILL SESSION ' || '''' || SID || ',' ||
serial# || '''' || ' immediate' text
FROM v$session
WHERE status = 'INACTIVE'
AND last_call_et > 43200
AND username IN (SELECT username FROM DBA_USERS WHERE user_id>60)) LOOP
EXECUTE IMMEDIATE rec_session.text;
END LOOP;
END Inactive_Session_Cleanup;
sequence using plsql
=========================
Declare
v_next NUMBER;
script varchar2(5000);
BEGIN
SELECT (MAX(et.dcs_code) + 1) INTO v_next FROM et_document_request et;
script:= 'CREATE SEQUENCE et_document_request_seq
MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH '||
v_next || ' INCREMENT BY 1 CACHE 20';
execute immediate script;
end;
===========================
Terminal wise session
select TERMINAL,count(*) from v$session
group by TERMINAL;
total sessions
select count(*) from v$session
where TERMINAL not like '%UNKNOWN%'
and TERMINAL is not null;
HOW TO FIND DUPLICATE TOKEN NUMBERS
===========================================
select count(distinct a.token_number) dup
from tm_pen_bill a,tm_pen_bill b
where a.token_number = b.token_number
and a.bill_number <> b.bill_number
and a.token_number is not null;
when Block Corruption occurs:
select * from DBA_EXTENTS
WHERE file_id = '13' AND block_id BETWEEN '44157' and '50649';
select BLOCK_ID,SEGMENT_NAME,BLOCKS from dba_extents where FILE_ID='14'
and BLOCK_ID like '%171%';
select BLOCK_ID,SEGMENT_NAME,BLOCKS from dba_extents where FILE_ID='14'
and SEGMENT_NAME = 'TEMP_TD_PAY_ALLOTMENT_NMC';
DBVERIFY:
dbv blocksize=8192 file=users01.dbf log=dbv_users01.log
==============================================================
DBMS_REPAIR:(Block Corruption)
exec dbms_repair.admin_tables(table_name=>'REPAIR_TABLE',table_type=>dbms_repair.repair_table,action=>dbms_repair.create_action,tablespace=>'USERS');
variable v_corrupt_count number;
exec dbms_repair.check_object('scott','emp',corrupt_count=>:v_corrupt_count);
print v_corrupt_count;
==============================================================
Password:
select login,substr(utl_raw.cast_to_varchar2(utl_raw.cast_to_varchar2(password)),1,30) password
from mm_gen_user where active_flag = 'Y' and user_id=64 and LOGIN='GOPAL' ;
CHARACTERSET
select * from NLS_DATABASE_PARAMETERS;
SELECT value$ FROM sys.props$ WHERE name = 'NLS_CHARACTERSET' ;
select value from nls_database_parameters where parameter='NLS_CHARACTERSET';
==========================================================
EXPLAIN PLAN TABLE QUERY
========================
EXPLAIN PLAN SET STATEMENT_ID='5'
FOR
"DML STATEMENT"
PLAN TABLE QUERY
===============================
set linesize 1000
set arraysize 1000
col OBJECT_TYPE for a20
col OPTIMIZER for a20
col object_name for a30
col options for a25
select COST,OPERATION,OPTIONS,OBJECT_TYPE,
OBJECT_NAME,OPTIMIZER
--,ID,PARENT_ID,POSITION,CARDINALITY
from plan_table
where statement_id='&statement_id';
Rman settings: disk formats
%t represents a timestamp
%s represents the backup set number
%p represents the piece number
The dbms_workload_repository.create_snapshot procedure creates a manual snapshot in the AWR as seen in this example:
EXEC dbms_workload_repository.create_snapshot;
Calculation of a table the size of the space occupied by
========================================================
select owner, table_name,
NUM_ROWS,
BLOCKS * AAA/1024/1024 "Size M",
EMPTY_BLOCKS,
LAST_ANALYZED
from dba_tables
where table_name = 'XXX';
Finding statement/s which use lots of shared pool memory:
==========================================================
SELECT substr(sql_text,1,40) "SQL", count(*) , sum(executions) "TotExecs"
FROM v$sqlarea
WHERE executions < 5
GROUP BY substr(sql_text,1,40)
HAVING count(*) > 30
ORDER BY 2;
See a table size table
=========================================
select sum (bytes) / (1024 * 1024) as "size (M)" from user_segments
where segment_name = upper ('& table_name');
See a index size table
=========================================
select sum (bytes) / (1024 * 1024) as "size (M)" from user_segments
where segment_name = upper ('& index_name');
monitoring table space I / O ratio
====================================
select B.tablespace_name name, B.file_name "file", A.phyrds pyr,
A.phyblkrd pbr, A.phywrts pyw, A.phyblkwrt pbw
from v $ filestat A, dba_data_files B
where A.file # = B.file_id
order by B.tablespace_name;
monitor the file system I / O ratio
=====================================
select substr (C.file #, 1,2) "#", substr (C.name, 1,30) "Name",
C.status, C.bytes, D.phyrds, D.phywrts
from v $ datafile C, v $ filestat D
where C.file # = D.file #;
the hit rate monitor SGA
=========================
select a.value + b.value "logical_reads", c.value "phys_reads",
round (100 * ((a.value + b.value)-c.value) / (a.value + b.value)) "BUFFER HIT RATIO"
from v $ sysstat a, v $ sysstat b, v $ sysstat c
where a.statistic # = 38 and b.statistic # = 39
and c.statistic # = 40;
monitoring SGA in the dictionary buffer hit ratio
==================================================
select parameter, gets, Getmisses, getmisses / (gets + getmisses) * 100 "miss ratio",
(1 - (sum (getmisses) / (sum (gets) + sum (getmisses ))))* 100 "Hit ratio"
from v $ rowcache
where gets + getmisses <> 0
group by parameter, gets, getmisses;
monitoring SGA shared cache hit ratio should be less than 1%
=============================================================
select sum (pins) "Total Pins", sum (reloads) "Total Reloads",
sum (reloads) / sum (pins) * 100 libcache
from v $ librarycache;
select sum (pinhits-reloads) / sum (pins) "hit radio", sum (reloads) / sum (pins) "reload percent"
from v $ librarycache;
monitoring SGA in the redo log buffer hit ratio should be less than 1%
=========================================================================
SELECT name, gets, misses, immediate_gets, immediate_misses,
Decode (gets, 0,0, misses / gets * 100) ratio1,
Decode (immediate_gets + immediate_misses, 0,0,
immediate_misses / (immediate_gets + immediate_misses) * 100) ratio2
FROM v $ latch WHERE name IN ('redo allocation', 'redo copy');
control memory and hard disk sort ratio, it is best to make it smaller than .10, an increase sort_area_size
=============================================================================================================
SELECT name, value FROM v$sysstat WHERE name IN ('sorts (memory)', 'sorts (disk)');
monitoring what the current database who are running SQL statements?
===================================================================
SELECT osuser, username, sql_text from v $ session a, v $ sqltext b
where a.sql_address = b.address order by address, piece;
monitoring the dictionary buffer?
=====================================
SELECT (SUM (PINS - RELOADS)) / SUM (PINS) "LIB CACHE" FROM V $ LIBRARYCACHE;
SELECT (SUM (GETS - GETMISSES - USAGE - FIXED)) / SUM (GETS) "ROW CACHE" FROM V $ ROWCACHE;
SELECT SUM (PINS) "EXECUTIONS", SUM (RELOADS) "CACHE MISSES WHILE EXECUTING" FROM V $ LIBRARYCACHE;
The latter divided by the former, this ratio is less than 1%, close to 0% as well.
SELECT SUM (GETS) "DICTIONARY GETS", SUM (GETMISSES) "DICTIONARY CACHE GET MISSES"
FROM V $ ROWCACHE
see the table a high degree of fragmentation?
=================================================
SELECT owner,segment_name table_name, COUNT (*) extents
FROM dba_segments WHERE owner NOT IN ('SYS', 'SYSTEM') GROUP BY owner,segment_name
HAVING COUNT (*) = (SELECT MAX (COUNT (*)) FROM dba_segments GROUP BY segment_name);
=======================================================================
Fragmentation:
=================
select table_name,round((blocks*8),2)||'kb' "size"
from user_tables
where table_name = 'BIG1';
Actual Data:
=============
select table_name,round((num_rows*avg_row_len/1024),2)||'kb' "size"
from user_tables
where table_name = 'BIG1';
The establishment of an example data dictionary view to 8I
=======================================================
$ ORACLE_HOME / RDBMS / ADMIN / CATALOG.SQL
The establishment of audit data dictionary view with an example to 8I
======================================================
$ ORACLE_HOME / RDBMS / ADMIN / CATAUDIT.SQL
To establish a snapshot view using the data dictionary to 8I Case
=====================================================
$ ORACLE_HOME / RDBMS / ADMIN / CATSNAP.SQL
The table / index moving table space
=======================================
ALTER TABLE TABLE_NAME MOVE TABLESPACE_NAME;
ALTER INDEX INDEX_NAME REBUILD TABLESPACE TABLESPACE_NAME;
How can I know the system's current SCN number?
=================================================
select max (ktuxescnw * power (2, 32) + ktuxescnb) from x$ktuxe;
Will keep a small table into the pool
======================================
alter table xxx storage (buffer_pool keep);
Check the permissions for each user
===================================
SELECT * FROM DBA_SYS_PRIVS;
=====================================================================
Tablespace auto extend check:
=================================
col file_name for a50
select FILE_NAME,TABLESPACE_NAME,AUTOEXTENSIBLE from dba_data_files
order by TABLESPACE_NAME;
COL SEGMENT_NAME FOR A30
select SEGMENT_NAME,TABLESPACE_NAME,BYTES,EXTENTS,INITIAL_EXTENT,
NEXT_EXTENT,MAX_EXTENTS,PCT_INCREASE
from user_segments
where segment_name in ('TD_PAY_CHEQUE_PREPARED','TM_PAY_BILL','TD_PAY_PAYORDER');
select TABLESPACE_NAME,INITIAL_EXTENT,NEXT_EXTENT,MAX_EXTENTS,PCT_INCREASE
from dba_tablespaces;
alter tablespace temp default storage(next 5m maxextents 20480 pctincrease 0);
ALTER TABLE TD_PAY_CHEQUE_PREPARED
default STORAGE ( NEXT 10 M maxextents 20480 pctincrease 0);
Moving table from one tablespace to another
===============================================
alter table KHAJANE.TEMP_TM_PAY_ALLOTMENT_NMC move tablespace khajane_ts;
==============================================
for moving datafiles location:
========================================
alter database rename file a to b;
======================================================================
for logfile Clearence:
select * from global_name;
col member for a50
set linesize 132
set trimspool on
select 'alter database clear logfile ' || '''' || member || '''' || ';'
from v$logfile where status ='STALE';
logfile switch over:
select GROUP#,THREAD#,SEQUENCE#,BYTES,MEMBERS,ARCHIVED,
STATUS,to_char(FIRST_TIME,'DD-MON-YYYY HH24:MI:SS') switch_time
from v$log;Answered
-
Relative logical structure of 4K size....
Hi ,
I want to create a block size other than the default one (8K : db_block_size=8192), for example a 4K block size.
How is it called(if any) that parameter representing this logical structure(analogous to db_block_size... db_4k_block_size does not exist) which would stored in the db_4k_cache_size of the sga memory..????
I think there is no way to define it via a parameter... but only when i want to create a tablespace via the command: create tablespace....... blocksize size 4K...
Isn't it correct...???
I use 10g v.2
Thank you...
Sim
Message was edited by:
sgalaxyHi Sim,
I want to create a block size other than the default one Why a smaller blocksize?
There are very specific conditions for a shop to benefit from multiple blocksizes:
http://www.dba-oracle.com/t_multiple_blocksizes_summary.htm
Can you justify this proposed change by testing it with a real-world workload? -
hello,
i need your help, I m creating a database, who is difeence in block size 8 y 16 k
i take value 16 for creating tablespaces of 30GB
thanksDbb wrote:
The diference is the size...
There are not relation between size of block and size of tablespace...
The block size is use to performance the I/O in relation of the rows size and the objects type.
Look this:
http://www.dba-oracle.com/s_oracle_block_size.htm
http://www.nextre.it/oracledocs/blocksize.html
http://www.rampant-books.com/t_oracle_blocksize_disk_i_o.htm
The third link contains a few vague generalities and some irrelevant and misleading material. The first link contains a number of bits cut-n-pasted from Metalink and the Oracle manuals which show how easy it is for even the official documentation to produce contradictory points without any intelligent support. The first link does, however, contain the following note:
<ul>
+"Using multiple blocksizes effectively requires expert-level Oracle skills and an intimate knowledge of your I/O landscape. While deploying multiple blocksizes can greatly reduce I/O and improve response time, it can also wreak havoc in the hands of inexperienced DBA's. Using non-standard blocksizes is not recommended for beginners."+
</ul>
It's a wild exaggeration, of course - but it contains an important element of truth. If you're a beginner you won't really know why it might be a good idea to pick a special block size for some of your data; and you probably won't be able to make an informed decision about the single best block size for you data. In such circumstances it's probably best to stick to the default block size offered by the DBCA - which is usually 8KB
The middle article contains some interesting ideas and thoughts on testing - but the results (apart from one) seem to be rather inconclusive. (larger block sizes can do better if you're using DD, but slightly worse if you're trying to do tpc-c, and so on).
There is one interesting anomaly with the tests of imp and sql*plus with the 200MB and 500MB cases tested against 4KB and 32KB - the load times for the different block sizes are so different that there's obviously a flaw in the test (which is a comment I make because (a) the laws of physics don't change with blocksize and (b) on every occasion to date when someone has demonstrated anything more than a slight variation I've been able to point out the flaw in the test.)
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk
A general reminder about "Forum Etiquette / Reward Points": http://forums.oracle.com/forums/ann.jspa?annID=718
If you never mark your questions as answered people will eventually decide that it's not worth trying to answer you because they will never know whether or not their answer has been of any use, or whether you even bothered to read it.
It is also important to mark answers that you thought helpful - again it lets other people know that you appreciate their help, but it also acts as a pointer for other people when they are researching the same question, moreover it means that when you mark a bad or wrong answer as helpful someone may be prompted to tell you (and the rest of the forum) what's so bad or wrong about the answer you found helpful. I'm going to see if I can get close to emulating the test. -
Can we decrease the size of existing datafile?
Hi,
can we decrease the size of existing datafile?
Thanks,It is a very nice script.
But it does not deal with something that appears to be being 'pushed' by some contributors (OK, one, really) to this forum as a suitable 'fix' for some performance problems: using multiple block sizes in one database. It's not surprising the script doesn't deal with this, though, because Tom Kyte has never particularly approved of using multiple blocksizes like that.
Being specific, the script at Ask Tom queries for the setting of db_block_size parameter and uses that to work out what a datafile can be shrunk to. If you have datafiles using non-standard block sizes, however, then that script will not work correctly for them.
It's always potentially dangerous making use of 5-year old scripts found on the internet, even somewhere as good as Ask Tom.
It's also a good demonstration as to why, for at least one reason, it's potentially dangerous following Mr. Burleson's advice on multiple block sizes. -
Blocks have much more free space specified by pctfree moved off freelist.
We have a table with pctfree=0 and pctused=90 and experienced high session against it. During the high session, we saw lots of "read by other session", cbc chain, and "buffer busy wait" caused by the same sql (INESRT). The row size of of an average 4K with long raw. After got the block info for the "read by other session" and "buffer busy wait", I dumped the block. The strange thing is that all the of blocks dumped are not in the freelist and the available free space is over 1K.
My idea is: When the session named waiting_a experienced "read by other session" to find the block to insert data, that block must be in the freelist, otherwise the waiting_a wouldn't try to read it in buffer and wouldn't be waiting for it to be ready. Very shortly other session reading_b which was reading the block put the data in buffer and did the insert operation, and the reading_b completed its work of insert. My dump should be after reading_b completed. So the dumped block should contain the data inserted by reading_b. After that the block was got off from freelist.
But why blocks with 0x520 (1312)and 0x104c (4172) freespace got off from freelist? As pctuse is 90, a block will be got off from freelist when free space is less than 10% of the block size, and these two blocks have much more freespace.
TEST-prod-test$> grep tosp TEST_ora_23095.trc
tosp=0x2a2
tosp=0x104c
tosp=0x520
TEST-prod-TEST$> grep avsp TEST_ora_23095.trc
avsp=0x2a2
avsp=0x104c
avsp=0x520
TEST-prod-test$> grep flg TEST_ora_23095.trc
scn: 0x0328.47520b02 seq: 0x02 flg: 0x04 tail: 0x0b020602
seg/obj: 0x14e05 csc: 0x328.47520b02 itc: 1 flg: - typ: 1 - DATA
scn: 0x0328.47520f41 seq: 0x02 flg: 0x04 tail: 0x0f410602
seg/obj: 0x14e11 csc: 0x328.47520f41 itc: 1 flg: - typ: 1 - DATA
scn: 0x0328.4752153a seq: 0x02 flg: 0x04 tail: 0x153a0602
seg/obj: 0x14e0d csc: 0x328.4752153a itc: 1 flg: - typ: 1 - DATAknowing Oracle specifically warns against using multiple blocksizes
Nope. Oracle does not warn against using multiple blocksizes, anywhere in the documentation.
The only warnings I've seen (By Daniel Morgan, and unverified) claims that Oracle was negligent and only tested the SQL optimizer with an 8k blocksize.
I'm not sure that this is true, since it would constitute misfeasance.
I know that Oracle does extensive tesing on their new features, and the docs offer the multiple blocksize feature without reservation.
Uisng multiple blocksizes is a well established, proven concept.
DBA's have been using them for decades with IMS, IDMS and DB2 before Oracle came along.
I first saw multiple blocksized used with great success in the 1980's, and they are still in use today on many large databases.
provide a measurable idea what 'lots' constitute, and how much I/O is reduced in the shops you saw?There is load of verifiable evidence out there:
http://www.google.com/search?&q=site%3Awww.tpc.org+db_16k_cache_size
This UNISYS Oracle benchmark used multiple blocksizes to achieve optimal performance
db_cache_size = 4000M
db_recycle_cache_size = 500M
db_8k_cache_size = 200M
db_16k_cache_size = 4056M
db_2k_cache_size = 35430M
http://www-03.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/WP100883
The IBM Oracle Technical Brief titled "Oracle Architecture and Tuning on AIX" (November 2006) notes that careful evaluation is required before implementing multiple blocksizes:
While most customers only use the default database block size, it is possible to use up to 5 different database block sizes for different objects within the same database.
Having multiple database block sizes adds administrative complexity and (if poorly designed and implemented) can have adverse performance consequences. Therefore, using multiple block sizes should only be done after careful planning and performance evaluation.
https://metalink.oracle.com/metalink/plsql/f?p=130:14:4123909781200375285::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,46757.1,1,1,1,helvetica
Metalink Note:46757.1 titled "Notes on Choosing an Optimal DB BLOCK SIZE" says that there are some benefits from having larger blocksizes -
'Input data length not a multiple of blocksize' error in CUP
Hello All
I receive the error below when trying to configure CUP. I got this error whilst trying to define the password for the RFC user created in the Connector screen in CUP. CUP doesn't accept the SAP password maintained in SU01. CUP only allows a 4 character password but SU01 is configured to only accept 8 characters. Full error message below.
'com.virsa.ae.commons.utils.StringEncrypter$EncryptionException: Input data length not a multiple of blocksize.'
Can anyone shed any light on this?Hi All,
This issue is in Version 5.3 SP 7.1 of CUP. It occurs when we are trying to change the password for the CUP connector.
Please note that testing the connectors within the Content Administrator --> Maintain JCO Connections screens works fine and the risk analysis from RAR also works without issue. However, whenever we attempt to enter the password for CUP connecotr setup, it returns an error saying "Action Failed" with the 'Input data length not a multiple of blocksize' error showing in the trace logs.
We seem to be able to store a password of 4 characters e.g. 1234 but this then naturally fails the connection test.
Can anyone suggest a parameter setting to check or a resolution for this particular issue?
Thanks,
Simon -
Hi, I am trying to do export into multiple files with expdp but it failed because of following errors (I guess):
ORA-31693: Table data object "MYSYS"."TABLE" failed to load/unload and is being skipped due to error:
ORA-31643: unable to close dump file "/backup/oracle/prd_mysys01.dmp"
ORA-19502: write error on file "/backup/oracle/prd_mysys01.dmp", blocno 524262 (blocksize=4096)
ORA-27072: File I/O error
Additional information: 4
Additional information: 524262
Additional information: 110591
This is happening in all files (7 in total).
My backup is in a external drive.
My DB 10GR2df -h:
linux:/ # df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 131G 121G 9.3G 93% /
tmpfs 2.4G 8.0K 2.4G 1% /dev/shm
/dev/sdb1 137G 96G 42G 70% /mnt/sdb1
//10.1.1.3/backup 1.9T 1.6T 231G 88% /backup
ls -la /backup/oracle:
total 6673487876
drwxrwxr-x 1 98 dba 0 Jun 8 03:40 .
drwxr-xr-x 1 oracle oinstall 4096 Jun 8 01:00 ..
drwxrwxr-x 1 98 dba 0 May 10 16:08 2008
drwxrwxr-x 1 98 dba 0 May 10 16:08 2009
drwxrwxr-x 1 98 dba 0 Jun 4 08:27 2010
-rw-rw-r-- 1 98 dba 829821 Jun 8 03:51 prd_mysys.log
-rw-rw---- 1 98 dba 2147483647 Jun 8 02:29 prd_mysys01.dmp
-rw-rw---- 1 98 dba 2147483647 Jun 8 02:42 prd_mysys02.dmp
-rw-rw---- 1 98 dba 2147483647 Jun 8 02:54 prd_mysys03.dmp
-rw-rw---- 1 98 dba 2147483647 Jun 8 03:13 prd_mysys04.dmp
-rw-rw---- 1 98 dba 2147483647 Jun 8 03:26 prd_mysys05.dmp
-rw-rw---- 1 98 dba 2147483647 Jun 8 03:43 prd_mysys06.dmp
-rw-rw---- 1 98 dba 461119488 Jun 8 03:48 prd_mysys07.dmp -
hi
db_cache_size
dba_keep_cache_size
db_recycle_cache_size
above parameters are used to set multiple caches for default blocksize....
if we set db_8k_cache_size then how will we specify keep and recycle caches for this ..because oracle says that is we have multiple tablespaces with different block sizes then we can have all three above caches for all different blocksize tablespaces
RegardsMultiple buffer pools are only available for the standard block size. Non-standard block size caches have a single DEFAULT pool.
See
http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10743/memory.htm#i16408 -
Javax.crypto.IllegalBlockSizeException: Input data length not a multiple
Hi All ,
M worknig with NWCE 7.1.1. I have written code for decryption for decryption. Earlier my web dynpro application was on CE7.1. We migrated it to CE 7.1.1 just week ago after migrating to CE 7.1.1 , on execution of decryption code m gtting as
javax.crypto.IllegalBlockSizeException: Input data length not a multiple of blocksize
i have written following code for decryption.
public String decrypt( String encryptedString, String encryptionKey )
String UNICODE_FORMAT = "UTF8";
try
if ( encryptedString == null || encryptedString.trim().length() <= 0 )
throw new IllegalArgumentException( "encrypted string was null or empty" );
byte[] keyAsBytes = encryptionKey.getBytes(UNICODE_FORMAT);
keySpec = new DESKeySpec(keyAsBytes);
keyFactory = SecretKeyFactory.getInstance( "DES" );
cipher = Cipher.getInstance( "DES" );
SecretKey key = keyFactory.generateSecret( keySpec );
cipher.init( Cipher.DECRYPT_MODE, key );
BASE64Decoder base64decoder = new BASE64Decoder();
byte[] cleartext = base64decoder.decodeBuffer( encryptedString );
byte[] ciphertext = cipher.doFinal( cleartext );
return new String( ciphertext );
}catch (Exception e){
IWDMessageManager messageManager = wdComponentAPI.getMessageManager();
messageManager.reportException("Error while Decryption");
e.printStackTrace();
return "";
This code was working fine in CE 7.1 . After migrating to CE 7.1.1 it started giving this error.Thank you for your answer
how the code is usedI have hardcoded key, example
byte[] key = "123456789abcdefg".getBytes();and String for crypt (Example, String in = "green";)
Then I encrypt string in with code above (in qwestion body) and get exception IllegalBlockSizeException: Input data length not a multiple of blocksize
String encrypt(String in) throws Exception{
String out="";
byte[] key = "123456789abcdefg".getBytes();
Cipher ecipher = Cipher.getInstance("AES");
ecipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "AES"));
byte[] utf8 = in.getBytes("UTF8");
byte[] enc = ecipher.doFinal(utf8);
out = (new sun.misc.BASE64Encoder().encode(enc)).toString();
return out;
}Clients use JRE1.4 or high. I have JRE1.4 and all work correctly. Also, many clients have 1.4, but only part of they get exception. Code is in the server (this is part of servlet)
This function run in one thread and doesn't use shared resources -
How do multiple family members use iTunes.? One account or multiple?
How do multiple family members use iTunes. One account right now but apps gets added to all devices and iTunes messages go to all devices. Can multiple accounts be setup and still have ability to share purchased items?
Hey Ajtt!
I have an article for you that can help inform you about using Apple IDs in a variety of ways:
Using your Apple ID for Apple services
http://support.apple.com/kb/ht4895
Using one Apple ID for iCloud and a different Apple ID for Store Purchases
You can use different Apple IDs for iCloud and Store purchases and still get all of the benefits of iCloud. Just follow these steps:
iPhone, iPad, or iPod touch:
When you first set up your device with iOS 5 or later, enter the Apple ID you want to use with iCloud. If you skipped the setup assistant, sign in to Settings > iCloud and enter the Apple ID you’d like to use with iCloud.
In Settings > iTunes and App Stores, sign in with the Apple ID you want to use for Store purchases (including iTunes in the Cloud and iTunes Match). You may need to sign out first to change the Apple ID.
Mac:
Enter the Apple ID you want to use for iCloud in Apple () menu > System Preferences > iCloud.
Enter the Apple ID you want to use for Store purchases (including iTunes in the Cloud and iTunes Match) in Store > Sign In. In iTunes 11, you can also click iTunes Store > Quick Links: Account.
PC (Windows 8):
Enter the Apple ID you want to use for iCloud in the Control Panel. To access the iCloud Control Panel, move the pointer to the upper-right corner of the screen to show the Charms bar, click the Search charm, and then click the iCloud Control Panel on the left.
Enter the Apple ID you want to use for Store purchases (including iTunes in the Cloud and iTunes Match) in iTunes. In iTunes 10, select Store > Sign In. In iTunes 11, click iTunes Store > Quick Links: Account.
PC (Windows 7 and Vista):
Enter the Apple ID you want to use for iCloud in Control Panel > Network and Internet > iCloud.
Enter the Apple ID you want to use for Store purchases (including iTunes in the Cloud and iTunes Match) in iTunes 10 in Store > Sign In. In iTunes 11, click iTunes Store > Quick Links: Account.
Note: Once a device or computer is associated with your Apple ID for your iTunes Store account, you cannot associate that device or computer with another Apple ID for 90 days. Learn more about associating a device or computer to your Apple ID.
Thanks for using the Apple Support Communities!
Cheers,
Braden -
How do I move multiple dimension members up one level in planning?
I can't figure out how to select multiple members.
I hope I don't have to cut and paste them individually.ODI maybe ?
Cheers
John
http://john-goodwin.blogspot.com/ -
How can I setup a mail-specific passcode/restriction on iPad used by multiple family members?
Have an Exchange mail account setup and accessible in my mail on iPad... however my kids use it and i would like to restrict them from accessing this specific portion of the device. I tried viewing restriction options and do not see that i can apply a restriction specifically to Mail. Thanks for your help.Not a feature of iOS. Check the AppStore to see if there are other
mail apps that allow passcode protection.
Or use Safari to log onto your email via a web-based interface and
enter your credentials each time. A bit slower, but the kids will
not know the details to login. -
How can a family with multiple existing accounts use Home Sharing?
I'd like to use the new Home Sharing feature, but it appears to be restricted to families in which all of the family members share a single user account.
We already have separate accounts for each family member. Is there some way for us to use Home Sharing without abandoning most of our existing accounts, along with all of the purchases made by those accounts? I don't think anyone in this situation would be willing to do that.Eh. I am not too sure since I have not messed with it much but I do have a great deal of experience with multiple accounts. Each computer can be authorized for multiple accounts. As can iPods. iPods can sync songs/videos/apps from multiple accounts as long as the computer is authorized with them. What I have set up here, is I buy my stuff I want, my parents buy what they want and so do my brothers. When my bro gets something I want I just move it to my computer. That way all our accounts are separate, but if there is something I want I can get it. Also, since the music no longer has DRM, it won't matter. It will play on any computer. What you should see is if you can just do the shared library with multiple accounts. Then if you don't have videos or such, you can get apps or music. Hope this helps!
Maybe you are looking for
-
So I have been working on a flash-based Website using ActionScript 2.0. I have been able to export it fine up until about a day ago. The file is only 4,330KB and when exporting as a SWF it will export about halfway and then it stops with no error or
-
Computer monitor affected by studio monitors?
Recently I have been trying to record some audio and I had to change the midi settings. Now whenever I turn on my studio monitors (m-audio av40) the computer monitor glitches or turns off for a moment. I never had this behavior before when turning on
-
How To Edit Failed IDocs Through Report ?
Hi I have the requirement of editing (Modifying) IDocs through a report program.. ( My program displays the content of a specified segment of failed IDocs in the ALV format.. Then the changes made to those fields in ALV have to be updated in those fa
-
C4380 Trouble printing wirelessly MAC
Photosmart C3480 My MacAir is not able to print to my C3480 printer. This is a new issue. I've been printing wirelessly since January from this computer. OS 10.9 Message I'm seeing is "The printer is not connected" and in the que under the doc name
-
IPad Mail app crashing upon launch
Have tried restarting multiple times but Mail keeps crashing instantly upon launch.