Oracle 10g - lock statistics
What are the different situations in which Oracle will lock existing table/index statistics automatically?
As per my undrstanding to lock the statistics we must use "dbms_stats" package with lock_table_stats/lock_schema_stats procedures. I dont see any other situation where Oracle automatically locks the statistics.
Please share your experience.
I dont see any other situation where Oracle automatically locks the statistics.Oracle never locks the statistics on its own. Oracle has only given methods so that one can decide whether to collect the statistics for volatile/static tables; so that the execution plans do not change drastically.
Similar Messages
-
What is the need for locking statistics in database?
In addition to ocpdba's comment, we have three level of locking statistics.
- lock at schema level: dbms_stats.lock_schema_stats
- lock at table level: dbms_stats.lock_table_stats
- lock at partition level: dbms_stats.lock_partition_stats (not well known)
At any level, all the dependent objects like columns and indexes are also locked. -
Oracle 10g - System Statistics
Hello guys,
i've got a question foru you :-))
If i generate new system statistics (cpu load, i/o load, etc.), are the execution plans in the sga going invalid?
Some time ago i tested it with new statistics on tables/indeces and if i generate new statistics for tables/indeces, all execution plans that refer to the object (table/indeces) are going invalid.
But under 10g, what about system stats? Are all execution plans going invalid, if new system statistics are generated? The system stats are needed to decide which access path is better.. so it would be suggestive .... i believe this would cause massive parse load.
Thanks for your answers
Regards
StefanFrom the Performance Tuning Guide, Chapter 14 Managing Optimizer Statistics
Unlike table, index, or column statistics, Oracle does not invalidate already parsed SQL statements when system statistics get updated. All new SQL statements are parsed using new statistics.
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14211/stats.htm#sthref1468 -
Issue with lock file in Oracle 10g app server - MDB not running
Hi,
I have Oracle 10g & MQ 6 on my laptop. I generated JNDI bindings for app server-MQ by giving ip address of my machine first. Then i changed it to "localhost" & generated new set of .bindings file.
With this new set i am able to send messages from my program to a queue. I also have an MDB which should listen to the same queue.
However now my mdb is not listening to the queue & i suspect it is due to host address change, - because each time i start the server, i see a lock file created "OracleASRouter_store.lock" - under j2ee\home\persistance. And below is the content of the same -
"O10.1.4.245:/C:/Program Files/Oracle/oc4j_extended_101330/j2ee/home/persistence/"
As per few suggestions on this site, I deleted this file & restated app server, deleted whole content of persistance folder, restarted app server. But each time i see this file created and also see the ip address in log.xml under j2ee\home\log\oc4j
Error message in this log.xml file is
<MESSAGE>
<HEADER>
<TSTZ_ORIGINATING>2007-09-19T11:22:35.265-04:00</TSTZ_ORIGINATING>
<COMPONENT_ID>j2ee</COMPONENT_ID>
<MSG_ID>J2EE EJB-02009</MSG_ID>
<MSG_TYPE TYPE="WARNING"></MSG_TYPE>
<MSG_LEVEL>1</MSG_LEVEL>
<HOST_ID>IFLEXNY-EXT99</HOST_ID>
<HOST_NWADDR>10.1.4.245</HOST_NWADDR>
<MODULE_ID>ejb.runtime</MODULE_ID>
<THREAD_ID>10</THREAD_ID>
<USER_ID>chetanmi</USER_ID>
</HEADER>
<CORRELATION_DATA>
<EXEC_CONTEXT_ID><UNIQUE_ID>10.1.4.245:65858:1190215355296:0</UNIQUE_ID><SEQ>0</SEQ></EXEC_CONTEXT_ID>
</CORRELATION_DATA>
<PAYLOAD>
<MSG_TEXT>[STGMQ:STGMQEJB:TestMDB] Unexpected exception by JMS provider: javax.jms.MessageEOFException: initializeConnection.</MSG_TEXT>
<SUPPL_DETAIL><![CDATA[javax.jms.MessageEOFException: initializeConnection
at com.evermind.server.jms.JMSUtils.make(JMSUtils.java:1075)
at com.evermind.server.jms.JMSUtils.toJMSException(JMSUtils.java:1155)
at com.evermind.server.jms.TCPJMSRemoteServer.initializeConnection(TCPJMSRemoteServer.java:154)
at com.evermind.server.jms.TCPJMSRemoteServer.initializeConnection(TCPJMSRemoteServer.java:110)
at com.evermind.server.jms.TCPJMSRemoteServer.<init>(TCPJMSRemoteServer.java:68)
at com.evermind.server.jms.EvermindConnection.<init>(EvermindConnection.java:122)
at com.evermind.server.jms.EvermindQueueConnection.<init>(EvermindQueueConnection.java:70)
at com.evermind.server.jms.EvermindQueueConnectionFactory.unprivileged_createQueueConnection(EvermindQueueConnectionFactory.java:101)
at com.evermind.server.jms.EvermindQueueConnectionFactory.access$000(EvermindQueueConnectionFactory.java:44)
at com.evermind.server.jms.EvermindQueueConnectionFactory$1.execute(EvermindQueueConnectionFactory.java:81)
at com.evermind.server.jms.InContainerProxy.doSecureOp(InContainerProxy.java:157)
at com.evermind.server.jms.EvermindQueueConnectionFactory.createQueueConnection(EvermindQueueConnectionFactory.java:78)
at com.evermind.server.jms.EvermindQueueConnectionFactory.createQueueConnection(EvermindQueueConnectionFactory.java:69)
at com.evermind.server.ejb.MessageDrivenConsumer.createNonXAResources(MessageDrivenConsumer.java:567)
at com.evermind.server.ejb.MessageDrivenConsumer.initializeJMSResources(MessageDrivenConsumer.java:491)
at com.evermind.server.ejb.MessageDrivenConsumer.processMessages(MessageDrivenConsumer.java:208)
at com.evermind.server.ejb.MessageDrivenConsumer.run(MessageDrivenConsumer.java:169)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:358)
at com.evermind.server.jms.JMSRemoteServer.readCheck(JMSRemoteServer.java:678)
at com.evermind.server.jms.JMSRemoteServer.readProtocol(JMSRemoteServer.java:696)
at com.evermind.server.jms.TCPJMSRemoteServer.initializeConnection(TCPJMSRemoteServer.java:134)
... 16 more
]]></SUPPL_DETAIL>
</PAYLOAD>
</MESSAGE>
<MESSAGE>
<HEADER>
<TSTZ_ORIGINATING>2007-09-19T11:22:35.312-04:00</TSTZ_ORIGINATING>
<COMPONENT_ID>j2ee</COMPONENT_ID>
<MSG_ID>J2EE EJB-02014</MSG_ID>
<MSG_TYPE TYPE="WARNING"></MSG_TYPE>
<MSG_LEVEL>1</MSG_LEVEL>
<HOST_ID>IFLEXNY-EXT99</HOST_ID>
<HOST_NWADDR>10.1.4.245</HOST_NWADDR>
<MODULE_ID>ejb.runtime</MODULE_ID>
<THREAD_ID>10</THREAD_ID>
<USER_ID>chetanmi</USER_ID>
</HEADER>
<CORRELATION_DATA>
<EXEC_CONTEXT_ID><UNIQUE_ID>10.1.4.245:65858:1190215355296:0</UNIQUE_ID><SEQ>0</SEQ></EXEC_CONTEXT_ID>
</CORRELATION_DATA>
<PAYLOAD>
<MSG_TEXT>[STGMQ:STGMQEJB:TestMDB] All message consumer threads have terminated due to provider errors, stopping MDB.</MSG_TEXT>
</PAYLOAD>
</MESSAGE>
And my MDB is NOT WORKING. Please let me know how to deal with this.
Your suggestions would be much appreciated.
Regard,
ChetanLine # 127 is creating a new application object using ApplicationFactory.
ApplicationFactory aFactory =
(ApplicationFactory) FactoryFinder.getFactory(
FactoryFinder.APPLICATION_FACTORY);
application = aFactory.getApplication();
The only way that can throw a null pointer is when aFactory is NULL. I really doubt this case because, the same thing is doen in init() of FacesServlet. If it had failed there, the exception should have occured during server startup.
This leaves me more and more confused....I am desperate for some help now :((
Ramesh -
Doubt regarding automatic statistics collection in Oracle 10g
I am using Oracle 10g in Linux
Does statistic collection for tables throughout the database happen automatically or should we manually analyze the tables using
Analyze command or DBMS_STATS package ?
AWR collects statistics(snapshots) every 1 hr but does it mean it collects only session and database related statistics and not the table related statistics?I am using Oracle 10g in Linux Version and os name and version?
AWR collects statistics(snapshots) every 1 hr butIt's performance related statistics. Read about data gathering and AWR.
Note that AWR is an extra licensable feature thru Management packs. -
MBRC and SYSTEM STATISTICS in Oracle 10g database.
Hi All,
I am performing database upgrade from Oracle 8i Solaris to Oracle 10g HP-UX using exp/imp method.
But i do have some doubts regarding MBRC and System statistics.
MBRC in Oracle 10g is automatically adjusted if MBRC parameter is not set, but i found value 128 as shown below.
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for HPUX: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> sho parameter multi
NAME TYPE VALUE
db_file_multiblock_read_count integer 128Also i performed one simple full table scan to test it...but db file scattered read is performing on 128 blocks. So i dont think 128 is suitable and is automatic, i mean MBRC is not set accrodingly it always uses 128.
Does this MBRC value affects whole database performance?
Regarding SYSTEM STATISTICS i found below result:
SQL> select * from AUX_STATS$
SNAME PNAME PVAL1 PVAL2
SYSSTATS_INFO STATUS COMPLETED
SYSSTATS_INFO DSTART 11-09-2009 04:59
SYSSTATS_INFO DSTOP 11-09-2009 04:59
SYSSTATS_INFO FLAGS 1
SYSSTATS_MAIN CPUSPEEDNW 128.239557
SYSSTATS_MAIN IOSEEKTIM 10
SYSSTATS_MAIN IOTFRSPEED 4096
SYSSTATS_MAIN SREADTIM
SYSSTATS_MAIN MREADTIM
SYSSTATS_MAIN CPUSPEED
SYSSTATS_MAIN MBRC
SYSSTATS_MAIN MAXTHR
SYSSTATS_MAIN SLAVETHRNow whether NOWORKLOAD or WORKLOAD is better, and this server is still under building process....so how can i collect WORKLOAD stats as high load on this server can't be performed?? Is it really require to gather system statistics, what will happen with NOWORLOAD stats?
I have not seen single database where system stats are gathered in our organisation having more than 2000 databases.
-YasserMaybe this article written by Tom Kite helps:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:499197100346264909 -
How to genrate and check wait statistics in oracle 10g
Dear all,
how to genrate and check WAIT STATISTICS in oracle 10g on RHEL4.
Regards,
AliOracle Kernel keeps track of these statistics. Query v$waitstat for overall system level wait statistics or v$session_wait for individual session wait statistics.
-
Statistics Collection in Oracle 10g
In Oracle 10g gathering table and index statistics are automatic ?
or we have to physically gather statistics for table and indexesIt depends how your database is configured -
PARAMETER statistics_level should be set to typical and there must be a job NAMED as GATHER_STATS_JOB should be active. you can change the job parameters -
Is row locking available in Oracle 10g?
Hi,
Does anybody knows if Oracle 10g can do a row locking?
Thanks,
AmorsoloTeymur Hajiyev wrote:
amorsolo wrote:
Hi,
Does anybody knows if Oracle 10g can do a row locking?
Thanks,
AmorsoloIn my opinion locking mechanism in Oracle is one of the features/option which made Oracle the best in Database world.
Regards,
Teymur Hajiyev
Oracle 10g Certified Master
http://teymur-hajiyev.blogspot.com
http://dba.az
Agree with Teymur. As Tom Kyte said in the "Comparison between Oracle and Others" topic:
For example -- all of the above would get check marks for having "row level locking". Once you look at the implementations however, you'll find they are way different. In Oracle, the overhead of having 1 lock is the same as having 1billion locks (eg: none).
In the others there is a HUGE different between the two as locks are a scare resource in those systems, they consume memory, take up space, are stored in in-memory data structures. Our implementation of the feature is so different as to not be comparable.
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1886476148373 -
Lock types in oracle 10g with sql examples
can some body easily in simple words tell some thing about the table locks types in oracle 10g with some sql examples?
Oracle locking is a complex topic that may not easily be explained with simple words.
Please try to read above mentioned link starting from simple examples to used lock types. I don't think it's a good idea to "over simplify" the topic starting from the different lock types.
Another way to explain some lock types can be found in following OTN discussion with Tom Kyte (who is also one of the primary author of Concepts Guide 11.2): TM / TX Locks ( Tom Kyte and Oracle Docu) ; note the different points of view about what is the row lock ...
Edited by: P. Forstmann on 29 juin 2011 14:00 -
hi,
i m working on an application made in oracle 10g developer, & database is oracle 10g on aix ,
some times i get some problem when user save any data through forms it gets hanged ,
so tell me how to get rid of it , when i try to do it from sql navigator i see massges session is busy .
so y this eror i m getting & how to resolve it.
thxsHere you have some scripts:
rem
rem FUNCTION: Report all DB locks
rem
column osuser format a15 heading 'User'
column session_id heading 'SID'
column mode_held format a20 heading 'Mode|Held'
column mode_requested format a20 heading 'Mode|Requested'
column lock_id1 format a10 heading 'Lock|ID1'
column lock_id2 format a10 heading 'Lock|ID2'
column type heading 'Type|Lock'
set feedback off echo off pages 59 lines 131
start title132 'Report on All Locks'
spool rep_out\&db\locks
select nvl(a.osuser,'SYS') osuser,b.session_id,type,
mode_held,mode_requested,
lock_id1,lock_id2
from sys.v_$session a, sys.dba_locks b
where
a.sid=b.session_id
order by 2
spool off
pause press enter/return to continue
clear columns
set feedback on echo on pages 22 lines 80
set headingsep ='|'
set lines 160
set pagesize 20
ttitle 'Database Locking Conflict Report'
btitle 'Mode Held = indicates the user holding the lock|Mode Request = indicates the user waiting on the later to finish to establish lock||** End of Locking Conflict Report **'
column username format a10 heading 'User'
column terminal format a15 heading 'Application|PC'
column object format a15 heading 'Table'
column sql format a15 heading 'SQL'
column sid format 999 heading 'SID'
column lock_type format a15 heading 'Lock|Type'
column mode_held format a11 heading 'Mode|Held'
column mode_requested format a10 heading 'Mode|Request'
column lock_id1 format a8 heading 'Lock ID1'
column lock_id2 format a8 heading 'Lock ID2'
column first_load_time format a19 heading 'Requested'
break on lock_id1
select a.sid,
username,
terminal,
decode(a.type,'MR', 'Media Recovery',
'RT', 'Redo Thread',
'UN', 'User Name',
'TX', 'Transaction',
'TM', 'DML',
'UL', 'PL/SQL User Lock',
'DX', 'Distributed Xaction',
'CF', 'Control File',
'IS', 'Instance State',
'FS', 'File Set',
'IR', 'Instance Recovery',
'ST', 'Disk Space Transaction',
'IR', 'Instance Recovery',
'ST', 'Disk Space Transaction',
'TS', 'Temp Segment',
'IV', 'Library Cache Invalidation',
'LS', 'Log Start or Switch',
'RW', 'Row Wait',
'SQ', 'Sequence Number',
'TE', 'Extend Table',
'TT', 'Temp Table', a.type) lock_type,
decode(a.lmode,0, 'None', /* Mon Lock equivalent */
1, 'Null', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Exclusive', /* X */
to_char(a.lmode)) mode_held,
decode(a.request,
0, 'None', /* Mon Lock equivalent */
1, 'Null', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Exclusive', /* X */
to_char(a.request)) mode_requested,
to_char(a.id1) lock_id1, to_char(a.id2) lock_id2,
c.object object,
d.sql_text sql,
e.first_load_time
from v$lock a, v$session, v$access c, v$sqltext d, v$sqlarea e
where (id1,id2) in
(select b.id1, b.id2 from v$lock b where b.id1=a.id1 and
b.id2=a.id2 and b.request>0) and
a.sid = v$session.sid and
a.sid = c.sid and
d.address = v$session.sql_address and
d.hash_value = v$session.sql_hash_value and
d.address = e.address
order by a.id1, a.lmode desc
set headingsep ='|'
set lines 160
set pagesize 20
ttitle 'Database Locking Conflict Report'
btitle 'Mode Held = indicates the user holding the lock|Mode Request = indicates the user waiting on the later to finish to establish lock||** End of Locking Conflict Report **'
column username format a10 heading 'User'
column terminal format a15 heading 'Application|PC'
column object format a15 heading 'Table'
column sql format a15 heading 'SQL'
column sid format 999 heading 'SID'
column lock_type format a15 heading 'Lock|Type'
column mode_held format a11 heading 'Mode|Held'
column mode_requested format a10 heading 'Mode|Request'
column lock_id1 format a8 heading 'Lock ID1'
column lock_id2 format a8 heading 'Lock ID2'
column first_load_time format a19 heading 'Requested'
break on lock_id1
select a.sid,
username,
terminal,
decode(a.type,'MR', 'Media Recovery',
'RT', 'Redo Thread',
'UN', 'User Name',
'TX', 'Transaction',
'TM', 'DML',
'UL', 'PL/SQL User Lock',
'DX', 'Distributed Xaction',
'CF', 'Control File',
'IS', 'Instance State',
'FS', 'File Set',
'IR', 'Instance Recovery',
'ST', 'Disk Space Transaction',
'IR', 'Instance Recovery',
'ST', 'Disk Space Transaction',
'TS', 'Temp Segment',
'IV', 'Library Cache Invalidation',
'LS', 'Log Start or Switch',
'RW', 'Row Wait',
'SQ', 'Sequence Number',
'TE', 'Extend Table',
'TT', 'Temp Table', a.type) lock_type,
decode(a.lmode,0, 'None', /* Mon Lock equivalent */
1, 'Null', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Exclusive', /* X */
to_char(a.lmode)) mode_held,
decode(a.request,
0, 'None', /* Mon Lock equivalent */
1, 'Null', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Exclusive', /* X */
to_char(a.request)) mode_requested,
to_char(a.id1) lock_id1, to_char(a.id2) lock_id2,
c.object object,
d.sql_text sql,
e.first_load_time
from v$lock a, v$session, v$access c, v$sqltext d, v$sqlarea e
where (id1,id2) in
(select b.id1, b.id2 from v$lock b where b.id1=a.id1 and
b.id2=a.id2 and b.request>0) and
a.sid = v$session.sid and
a.sid = c.sid and
d.address = v$session.sql_address and
d.hash_value = v$session.sql_hash_value and
d.address = e.address
order by a.id1, a.lmode descCheers,
Francisco Munoz Alvarez
http://www.oraclenz.com -
Oracle 10G Expression Edition Account locked
Hi all,
My Oracle 10G Expression Edition Account locked gets locked,
where to raise the request to unlocking my account.
as my user name:system
Thanks
Koty917193 wrote:
Hi all,
My Oracle 10G Expression Edition Account locked gets locked,
where to raise the request to unlocking my account.
as my user name:system
Thanks
KotyHow do I ask a question on the forums?
SQL and PL/SQL FAQ
ask your DBA for assistance -
Oracle 10G New Feature........Part 1
Dear all,
from last couple of days i was very busy with my oracle 10g box,so i think this is right time to
share some intresting feature on 10g and some internal stuff with all of you.
Have a look :-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Oracle 10g Memory and Storage Feature.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1.Automatic Memory Management.
2.Online Segment Shrink
3.Redolog Advisor, checkpointing
4.Multiple Temporary tablespace.
5.Automatic Workload Repository
6.Active Session History
7.Misc
a)Rename Tablespace
b)Bigfile tablespace
c)flushing buffer cache
8.ORACLE INTERNAL
a)undocumented parameter (_log_blocks_during_backup)
b)X$ view (x$messages view)
c)Internal Structure of Controlfile
1.Automatic memory management
================================
This feature reduce the overhead of oracle DBA.previously mostly time we need to set diff oracle SGA parameter for
better performance with the help of own experience,advice views and by monitoring the behaviour
of oracle database.
this was just time consuming activity.........
Now this feature makes easy life for oracle DBA.
Just set SGA_TARGET parameter and it automatically allocate memory to different SGA parameter.
it focus on DB_CACHE_SIZE
SHARED_POOL_SIZE
LARGE_POOL
JAVA_POOL
and automatically set it as
__db_cache_size
__shared_pool_size
__large_pool_size
__java_pool_size
check it in alert_log
MMAN(memory manager) process is new in 10g and this is responsible for sga tuning task.
it automatically increase and decrease the SGA parameters value as per the requirement.
Benefit:- Maximum utlization of available SGA memory.
2.Online Segment Shrink.
==========================
hmmmmm again a new feature by oracle to reduce the downtime.Now oracle mainly focus on availablity
thats why its always try to reduce the downtime by intrducing new feature.
in previous version ,reducing High water mark of table was possible by
Exp/imp
or
alter table move....cmd. but on these method tables was not available for normal use for long hrs if it has more data.
but in 10g with just few command we can reduce the HWmark of table.
this feature is available for ASSM tablespaces.
1.alter table emp enable row movement.
2.alter table emp shrink space.
the second cmd have two phases
first phase is to compact the segment and in this phase DML operations are allowed.
second phase(shrink phase)oracle shrink the HWM of table, DML operation will be blocked at that time for short duration.
So if want to shrink the HWM of table then we should use it with two diff command
first compact the segment and then shrink it on non-peak hrs.
alter table emp shrink space compact. (This cmd doesn't block the DML operation.)
and alter table emp shrink space. (This cmd should be on non-peak hrs.)
Benefit:- better full table scan.
3.Redolog Advisor and checkpointing
================================================================
now oracle will suggest the size of redo log file by V$INSTANCE_RECOVERY
SELECT OPTIMAL_LOGFILE_SIZE
FROM V$INSTANCE_RECOVERY
this value is influence with the value of FAST_START_MTTR_TARGET .
Checkpointing
Automatic checkpointing will be enable after setting FAST_START_MTTR_TARGET to non-zero value.
4.Multiple Temporary tablespace.
==================================
Now we can manage multiple temp tablespace under one group.
we can create a tablespace group implicitly when we include the TABLESPACE GROUP clause in the CREATE TEMPORARY TABLESPACE or ALTER TABLESPACE statement and the specified tablespace group does not currently exist.
For example, if group1 is not exists,then the following statements create this groups with new tablespace
CREATE TEMPORARY TABLESPACE temp1 TEMPFILE '/u02/oracle/data/temp01.dbf'
SIZE 50M
TABLESPACE GROUP group1;
--Add Existing temp tablespace into group by
alter tablespace temp2 tablespace group group1.
--we can also assign the temp tablespace group on database level as default temp tablespace.
ALTER DATABASE <db name> DEFAULT TEMPORARY TABLESPACE group1;
benefit:- Better I/O
One sql can use more then one temp tablespace
5.AWR(Automatic Workload Repository):-
================================== AWR is built in Repository and Central point of Oracle 10g.Oracle self managing activities
is fully dependent on AWR.by default after 1 hr, oracle capure all database uses information and store in AWR with the help of
MMON process.we called it Memory monitor process.and all these information are kept upto 7 days(default) and after that it automatically purge.
we can generate a AWR report by
SQL> @?/rdbms/admin/awrrpt
Just like statspack report but its a advance and diff version of statspack,it provide more information of Database as well as OS.
it show report in Html and Text format.
we can also take manually snapshot for AWR by
BEGIN
DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT ();
END;
**The STATISTICS_LEVEL initialization parameter must be set to the TYPICAL or ALL to enable the Automatic Workload Repository.
[oracle@RMSORA1 oracle]$ sqlplus / as sysdba
SQL*Plus: Release 10.1.0.2.0 - Production on Fri Mar 17 10:37:22 2006
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> @?/rdbms/admin/awrrpt
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
4174002554 RMSORA 1 rmsora
Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Would you like an HTML report, or a plain text report?
Enter 'html' for an HTML report, or 'text' for plain text
Defaults to 'html'
Enter value for report_type: text
Type Specified: text
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
* 4174002554 1 RMSORA rmsora RMSORA1
Using 4174002554 for database Id
Using 1 for instance number
Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Entering the number of days (n) will result in the most recent
(n) days of snapshots being listed. Pressing <return> without
specifying a number lists all completed snapshots.
Listing the last 3 days of Completed Snapshots
Snap
Instance DB Name Snap Id Snap Started Level
rmsora RMSORA 16186 16 Mar 2006 17:33 1
16187 16 Mar 2006 18:00 1
16206 17 Mar 2006 03:30 1
16207 17 Mar 2006 04:00 1
16208 17 Mar 2006 04:30 1
16209 17 Mar 2006 05:00 1
16210 17 Mar 2006 05:31 1
16211 17 Mar 2006 06:00 1
16212 17 Mar 2006 06:30 1
16213 17 Mar 2006 07:00 1
16214 17 Mar 2006 07:30 1
16215 17 Mar 2006 08:01 1
16216 17 Mar 2006 08:30 1
16217 17 Mar 2006 09:00 1
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 16216
Begin Snapshot Id specified: 16216
Enter value for end_snap: 16217
End Snapshot Id specified: 16217
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_16216_16217.txt. To use this name,
press <return> to continue, otherwise enter an alternative.
Benefit:- Now DBA have more free time to play games.....................:-)
Advance version of statspack
more DB and OS information with self managing capabilty
New Automatic alert and database advisor with the help of AWR.
6.Active Session History:-
==========================
V$active_session_history is view that contain the recent session history.
the memory for ASH is comes from SGA and it can't more then 5% of Shared pool.
So we can get latest and active session report from v$active_session_history view and also get histortical data of
of session from DBA_HIST_ACTIVE_SESS_HISTORY.
v$active_session_history include some imp column like:-
~SQL identifier of SQL statement
~Object number, file number, and block number
~Wait event identifier and parameters
~Session identifier and session serial number
~Module and action name
~Client identifier of the session
7.Misc:-
========
Rename Tablespace:-
=================
in 10g,we can even rename a tablespace by
alter tablespace <tb_name> rename to <tb_name_new>;
This command will update the controlfile,data dictionary and datafile header,but dbf filename will be same.
**we can't rename system and sysaux tablespace.
Bigfile tablespace:-
====================
Bigfile tablespace contain only one datafile.
A bigfile tablespace with 8K blocks can contain a 32 terabyte datafile.
Bigfile tablespaces are supported only for locally managed tablespaces with automatic segment-space management.
we can take the advantage of bigfile tablespace when we are using ASM or other logical volume with RAID.
without ASM or RAID ,it gives poor response.
syntax:-
CREATE BIGFILE TABLESPACE bigtbs
Flushing Buffer Cache:-
======================
This option is same as flushing the shared pool,but only available with 10g.
but i don't know, whats the use of this command in prod database......
anyway we can check and try it on test server for tuning n testing some query etc....
SQL> alter system flush buffer_cache;
System altered.
++++++++++++++++++
8.Oracle Internal
++++++++++++++++++
Here is some stuff that is not related with 10g but have some intresting things.
a)undocumented parameter "_log_blocks_during_backup"
++++++++++++++++++++++++
as we know that oracle has generate more redo logs during hotbackup mode because
oracle has to maintain the a complete copy of block into redolog due to split block.
we can also change this behaviour by setting this parameter to False.
If Oracle block size equals the operating system block size.thus reducing the amount of redo generated
during a hot backup.
WITHOUT ORACLE SUPPORT DON'T SET IT ON PROD DATABASE.THIS DOCUMENT IS JUST FOR INFORMATIONAL PURPOSE.
b)some X$ views (X$messages)
++++++++++++++++
if you are intresting in oracle internal architecture then x$ view is right place for getting some intresting things.
X$messages :-it show all the actions that a background process do.
select * from x$messages;
like:-
lock memory at startup MMAN
Memory Management MMAN
Handle sga_target resize MMAN
Reset advisory pool when advisory turned ON MMAN
Complete deferred initialization of components MMAN
lock memory timeout action MMAN
tune undo retention MMNL
MMNL Periodic MQL Selector MMNL
ASH Sampler (KEWA) MMNL
MMON SWRF Raw Metrics Capture MMNL
reload failed KSPD callbacks MMON
SGA memory tuning MMON
background recovery area alert action MMON
Flashback Marker MMON
tablespace alert monitor MMON
Open/close flashback thread RVWR
RVWR IO's RVWR
kfcl instance recovery SMON
c)Internal Structure of Controlfile
++++++++++++++++++++++++++++++++++++
The contents of the current controlfile can be dumped in text form.
Dump Level Dump Contains
1 only the file header
2 just the file header, the database info record, and checkpoint progress records
3 all record types, but just the earliest and latest records for circular reuse record types
4 as above, but includes the 4 most recent records for circular reuse record types
5+ as above, but the number of circular reuse records included doubles with each level
the session must be connected AS SYSDBA
alter session set events 'immediate trace name controlf level 5';
This dump show lots of intresting information.
it also show rman recordes if we used this controlfile in rman backup.
Thanks
Kuljeet Pal SinghYou can find each doc in html and pdf format on the Documentation Library<br>
You can too download all the documentation in html format to have all on your own computer here (445.8MB)<br>
<br>
Nicolas. -
How to avoid of application running on Oracle 10g to be copied?
I am a newbie to the security issues, so I need your help, please, where to start / what to read:
I have an application running across many customers on Oracle 10g. I have faced lately that our users
can use their daily backups to establish a totaly new database on a same / different server
and point our application to use it as well.
Is there any way to avoid it? F.e. I thought to use SELECT * FROM v$instance; to get the server instance details, and
in result with some other function to obtain, let say, local server's (WIN2003) details,
such as HD Serial Number, MAC number or so and then to check these values each time user runs the application.
Is it the correct way? What are the basics here at all?
Many thanks in advance to all!A lot of enterprises, however, actively avoid systems which are locked down to a particular server for very legitimate reasons. If my data center dies in the middle of the night, I sure don't want to have to call your mobile phone so that you can get to a computer, log in to the office network, and get me a new key so that I can finish my emergency failover. If I've got dozens of applications, I absolutely don't want to do that with dozens of different vendors.
It sounds like your problem, though, isn't that users are installing your software on multiple computers it's that they are accessing functionality they haven't licensed. That is generally a much easier problem to solve and doesn't require you to lock anything down to a particular machine. You can create a table LICENSED_CONTENT, for example,
CREATE TABLE licensed_content (
client_id NUMBER,
content_type VARCHAR2(30),
key RAW(128)
)In this case, KEY is, say, a hash (using the DBMS_CRYPTO or DBMS_OBFUSCATION_TOOLKIT packages if you'd like) of the client_id, content_type, and a bit of salt (i.e. a fixed string that only you know). When you sell a license to manage diamond content, you provide a script that inserts the appropriate row in the LICENSED_CONTENT table. When your application starts up, it reads the LICENSED_CONTENT table and verifies the hash before allowing users to access that type of content. This allows legitimate customers to move the software from one system to another but prevents them from accessing new functionality without a new license.
Justin -
Client unable to connect to Oracle 10g on linux
I have installed Oracle 10g on an Intel box running RedHat AS 3.0. The database installation was succesful but I am unable to connect to it from the client on my laptop running Oracle 10g client and Winfdows XP Pro. The server ip is 192.168.1.10 and I can ping it from the client:
C:\>ping attila.n3kje.net
Pinging attila.n3kje.net [192.168.1.10] with 32 bytes of data:
Reply from 192.168.1.10: bytes=32 time<1ms TTL=64
Reply from 192.168.1.10: bytes=32 time<1ms TTL=64
Reply from 192.168.1.10: bytes=32 time<1ms TTL=64
Reply from 192.168.1.10: bytes=32 time<1ms TTL=64
Ping statistics for 192.168.1.10:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Here is some info about the 2 environments:
[oracle@attila bin]$ uname -a
Linux attila.n3kje.net 2.4.21-9.0.1.ELsmp #1 SMP Mon Feb 9 22:26:51 EST 2004 i686 i686 i386 GNU/Linux
Server hosts file
======================================================
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 attila.n3kje.net attila localhost.localdomain localhost
hostname output
======================================================
[root@attila root]# hostname
attila.n3kje.net
ifconfig output
=======================================================
[root@attila root]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:C0:9F:1D:0C:C8
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13772171 errors:0 dropped:0 overruns:0 frame:0
TX packets:13748842 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1269613311 (1210.7 Mb) TX bytes:4065314800 (3876.9 Mb)
Interrupt:16 Base address:0xecc0 Memory:fe100000-fe120000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:5513840 errors:0 dropped:0 overruns:0 frame:0
TX packets:5513840 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:865454291 (825.3 Mb) TX bytes:865454291 (825.3 Mb)
Client TNSNAMES.ORA
======================================================
# tnsnames.ora Network Configuration File: C:\Oracle\product\10.1.0\Client_1\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.
ORACLE10G =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DEV10G)
PRDSRR =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = dev10g)
Client SQLNET.ORA
======================================================
# sqlnet.ora Network Configuration File: C:\Oracle\product\10.1.0\Client_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (EZCONNECT, TNSNAMES)
Server TNSNAMES.ORA
======================================================
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.1.0/db_1/n
etwork/admin/tnsnames.ora
# Generated by Oracle configuration tools.
DEV10G =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = attila.n3kje.net)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DEV10G)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
Server LISTENER.ORA
======================================================
# listener.ora Network Configuration File: /u01/app/oracle/product/10.1.0/db_1/n
etwork/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.1.0/db_1)
(PROGRAM = extproc)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = attila.n3kje.net)(PORT = 1521))
Results from the TNSPING command issued at the client
=================================================================
C:\>tnsping prdsrr
TNS Ping Utility for 32-bit Windows: Version 10.1.0.2.0 - Production on 02-APR-2
004 09:26:11
Copyright (c) 1997, 2003, Oracle. All rights reserved.
Used parameter files:
C:\Oracle\product\10.1.0\Client_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = 192.168.1.10)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = dev10g)))
TNS-12541: TNS:no listener
C:\>tnsping oracle10g
TNS Ping Utility for 32-bit Windows: Version 10.1.0.2.0 - Production on 02-APR-2
004 09:26:38
Copyright (c) 1997, 2003, Oracle. All rights reserved.
Used parameter files:
C:\Oracle\product\10.1.0\Client_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = 192.168.1.10)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVI
CE_NAME = DEV10G)))
TNS-12541: TNS:no listener
C:\>
Trying to connect to the database from the server
==================================================
[oracle@attila bin]$ echo $ORACLE_SID
DEV10G
[oracle@attila bin]$ ./sqlplus system
SQL*Plus: Release 10.1.0.2.0 - Production on Fri Apr 2 12:22:29 2004
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pr
oduction
With the Partitioning, OLAP and Data Mining options
[oracle@attila bin]$ ./sqlplus system@dev10g
SQL*Plus: Release 10.1.0.2.0 - Production on Fri Apr 2 12:23:09 2004
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
tnsping issued at the server
======================================================
[oracle@attila bin]$ tnsping dev10g
TNS Ping Utility for Linux: Version 10.1.0.2.0 - Production on 02-APR-2004 12:3
:44
Copyright (c) 1997, 2003, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/10.1.0/db_1/network/admin/sqlnet.ora
TNS-03505: Failed to resolve name
What am I doing wrong?
Thanks
RenatoOk, I was able to succesfully connect to the database from the client. I made the following changes to the sqlnet.ora, tnsnames and listener. Here are the changes I made:
sqlnet.ora
==============================
# SQLNET.ORA Network Configuration File: /u01/app/oracle/product/9.2.0.1.0/netwo
rk/admin/sqlnet.ora
# Generated by Oracle configuration tools.
# NAMES.DIRECTORY_PATH= (EZCONNECT)
NAMES.DIRECTORY_PATH= (EXCONNECT, TNSNAMES, ONAMES, HOSTNAME)
listener.ora
==============================
# listener.ora Network Configuration File: /u01/app/oracle/product/10.1.0/db_1/n
etwork/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.1.0/db_1)
(PROGRAM = extproc)
(SID_DESC =
(GLOBAL_DBNAME = DEV10G)
(ORACLE_HOME = /u01/app/oracle/product/10.1.0/db_1)
(SID_NAME = DEV10G)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))
tnsnames.ora
===========================================
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.1.0/db_1/n
etwork/admin/tnsnames.ora
# Generated by Oracle configuration tools.
DEV10G =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = DEV10G)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
Here is the new problem!
I start the dbconsole using the folowing command:
[oracle@attila bin]$ ./emctl start dbconsole
TZ set to US/Eastern
Oracle Enterprise Manager 10g Database Control Release 10.1.0.2.0
Copyright (c) 1996, 2004 Oracle Corporation. All rights reserved.
http://attila.n3kje.net:5500/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ........................
... started.
Logs are generated in directory /u01/app/oracle/product/10.1.0/db_1/attila.n3kje
.net_DEV10G/sysman/log
When I try and access it from the client I get the following error message:
"The database status is currently unavailable. It is possible that the database is in mount or nomount state. Click 'Startup' to obtain the current status and open the database. If the database cannot be opened, click 'Perform Recovery' to perform an appropriate recovery operation."
What am I doing wrong this time?
Your help would be greatly appreciated
Thanks
Renato
Maybe you are looking for
-
Remove one segment of line connecting points in a trendline chart?
I have a linear trendline plotted where the data points for the first 19 values lie on either side of the trendline. These are joined by a dashed line. I want to keep that line intact. The last 9 points lie along the trendline and are indistinguishab
-
How do I launch this program??
-
Need to create a report with drop down option
Hi, I have created a report with a simple query. Its a real time report. select host_name, target_name, instance_name from MGMT$DB_DBNINSTANCEINFO where target_type = 'oracle_database'; It gives me a tabular report. It works fine. But it is a huge re
-
Create RFx Response: An error occurred in the PD Layer transaction terminated
Hello Experts, Currently we are in SRM 7.02 implemenation: we are facing below problem while creating RFx response with popup screen. "An error occurred in the PD Layer transaction terminated" For this we have checked below 1
-
Dimension table in database [H1]
Hi Expert, Can Yours share some info with me about dimension table in database. Example for my dimension Entity I have 3 parent in this dimension , then in database I will have table : mbrEntity dim_Entity dim_EntityH1 dim_EntityH2 dim_EntityH3 The m