Search This Blog

Total Pageviews

Friday 18 March 2011

Oracle dbv database verify Utility

15:57:07 SQL> set linesize 100
15:57:13 SQL> show parameter block
NAME_COL_PLUS_SHOW_PARAM TYPE VALUE_C
-------------------------------------------------------------------------------- ----------- -------
db_block_buffers integer 0
db_block_checking string FALSE
db_block_checksum string TRUE
db_block_size integer 8192
db_file_multiblock_read_count integer 16




15:58:09 SQL> !dbv file=/opt/oracle/oradata/orcl/dmdocbase01.dbf blocksize=8192 feedback=3200

DBVERIFY: Release 10.2.0.4.0 - Production on Fri Mar 18 15:58:12 2011

Copyright (c) 1982, 2007, Oracle. All rights reserved.

DBVERIFY - Verification starting : FILE = /opt/oracle/oradata/orcl/dmdocbase01.dbf
................................................................................
........................

DBVERIFY - Verification complete

Total Pages Examined : 331776
Total Pages Processed (Data) : 184373
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 121327
Total Pages Failing (Index): 0
Total Pages Processed (Other): 8360
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 17716
Total Pages Marked Corrupt : 0
Total Pages Influx : 0
Highest block SCN : 2909064 (0.2909064)

Oracle Goldengate download 32bit etc

go to this site
http://www.oracle.com/technetwork/middleware/goldengate/downloads/index.html
if you don't find the product



Oracle GoldenGate v10.4.0.x for Oracle 10g 32bit on Redhat 4.0
Oracle GoldenGate v10.4.0.x for Oracle 10g 32bit on Redhat 5.0

Oracle GoldenGate on Oracle Media Pack v3 for Linux x86

then

go to https://edelivery.oracle.com/

then fill all the field

then select

select a product Pack: Oracle Fusion Middleware
platform Linux x86

then select this

Oracle GoldenGate on Oracle Media Pack for Linux x86 n/a B56872-03 JUL-19-2010 6 /

Then download for 32 bit

Oracle 10g redhat5.0 v18428-01 26m
Oracle 11g redhat5.0 v18429-01 26m

Thursday 17 March 2011

Redo and Number of Checkpoints per hour

set feed off;
set pagesize 10000;
set wrap off;
set linesize 200;
set heading on;
set tab on;
set scan on;
set verify off;
--
spool show_logswitches.lst

ttitle left 'Redolog File Status from V$LOG' skip 2

select group#, sequence#,
Members, archived, status, first_time
from v$log;

ttitle left 'Number of Logswitches per Hour' skip 2

select to_char(first_time,'YYYY.MM.DD') day,
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'00',1,0)),'99') "00",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'01',1,0)),'99') "01",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'02',1,0)),'99') "02",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'03',1,0)),'99') "03",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'04',1,0)),'99') "04",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'05',1,0)),'99') "05",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'06',1,0)),'99') "06",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'07',1,0)),'99') "07",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'08',1,0)),'99') "08",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'09',1,0)),'99') "09",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'10',1,0)),'99') "10",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'11',1,0)),'99') "11",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'12',1,0)),'99') "12",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'13',1,0)),'99') "13",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'14',1,0)),'99') "14",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'15',1,0)),'99') "15",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'16',1,0)),'99') "16",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'17',1,0)),'99') "17",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'18',1,0)),'99') "18",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'19',1,0)),'99') "19",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'20',1,0)),'99') "20",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'21',1,0)),'99') "21",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'22',1,0)),'99') "22",
to_char(sum(decode(substr(to_char(first_time,'DDMMYYYY:HH24:MI'),10,2),'23',1,0)),'99') "23"
from v$log_history
group by to_char(first_time,'YYYY.MM.DD')
/
spool off;

Monday 14 March 2011

OEM troubleshooting commands

https://apt-lnx-tst-01.site:1158/em/console/aboutApplication
Logs are generated in directory /opt/oracle/product/10.2/apt-lnx-tst-01.site_orcl/sysman/log
INFO: >>>>>>>>>>> The Database Control URL is https://apt-lnx-tst-01.site:1158/em <<<<<<<<<<<
http://apt-lnx-tst-01.site:5560/isqlplus
http://apt-lnx-tst-01.site:5560/isqlplus/dba
oracle@apt-lnxtst-01:/opt/oracle/product/10.2/cfgtoollogs/emca> vi /opt/oracle/product/10.2/apt-lnx-tst-01.site_orcl/sysman/config/emd.properties
oracle@apt-lnxtst-01:/opt/oracle/product/10.2/cfgtoollogs/emca> vi /opt/oracle/product/10.2/apt-lnx-tst-01.site_orcl/sysman/config/emd.properties
oracle@apt-lnxtst-01:/opt/oracle/product/10.2/cfgtoollogs/emca> emctl stop dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
http://apt-lnxtst-01.aptus.co.uk:5500/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
... Stopped.
oracle@apt-lnxtst-01:/opt/oracle/product/10.2/cfgtoollogs/emca> emctl start dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
http://apt-lnxtst-01.aptus.co.uk:5500/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ...................... started.
------------------------------------------------------------------
Logs are generated in directory /opt/oracle/product/10.2/apt-lnxtst-01.tus.co.uk_orcl/sysman/log
oracle@apt-lnxtst-01:/opt/oracle/product/10.2/cfgtoollogs/emca> emca -config dbcontrol db -repose recreate

STARTED EMCA at 14-Oct-2010 16:35:45
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database SID: orcl
Database Control is already configured for the database orcl
You have chosen to configure Database Control for managing the database orcl
This will remove the existing configuration and the default settings and perform a fresh configuration
Do you wish to continue? [yes(Y)/no(N)]: y
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /opt/oracle/product/10.2

Database hostname ................ apt-lnxtst-01.tus.co.uk
Listener port number ................ 1521
Database SID ................ orcl
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
14-Oct-2010 16:36:11 oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /opt/oracle/product/10.2/cfgtoollogs/emca/orcl/emca_2010-10-14_04-35-45-PM.log.
14-Oct-2010 16:36:12 oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
14-Oct-2010 16:36:21 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
14-Oct-2010 16:37:09 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
14-Oct-2010 16:37:09 oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
14-Oct-2010 16:38:46 oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
14-Oct-2010 16:38:46 oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://apt-lnxtst-01.tus.co.uk:5500/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at 14-Oct-2010 16:38:46
oracle@apt-lnxtst-01:/opt/oracle/product/10.2/cfgtoollogs/emca> vi /opt/oracle/product/10.2/apt-lnx-tst-01.site_orcl/sysman/config/emd.properties
oracle@apt-lnxtst-01:/opt/oracle/product/10.2/cfgtoollogs/emca> emca -config dbcontrol db -repos recreate

STARTED EMCA at 14-Oct-2010 16:42:11
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database SID: orcl
Database Control is already configured for the database orcl
You have chosen to configure Database Control for managing the database orcl
This will remove the existing configuration and the default settings and perform a fresh configuration
Do you wish to continue? [yes(Y)/no(N)]: Y
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /opt/oracle/product/10.2

Database hostname ................ apt-lnxtst-01.tus.co.uk
Listener port number ................ 1521
Database SID ................ orcl
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
14-Oct-2010 16:42:34 oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /opt/oracle/product/10.2/cfgtoollogs/emca/orcl/emca_2010-10-14_04-42-11-PM.log.
14-Oct-2010 16:42:35 oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
14-Oct-2010 16:42:43 oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
14-Oct-2010 16:44:19 oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
14-Oct-2010 16:44:19 oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
14-Oct-2010 16:47:33 oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
14-Oct-2010 16:47:38 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
14-Oct-2010 16:48:33 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
14-Oct-2010 16:48:33 oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
14-Oct-2010 16:50:12 oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
14-Oct-2010 16:50:12 oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://apt-lnxtst-01.aptus.co.uk:5500/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at 14-Oct-2010 16:50:12







orapwd FILE=filename PASSWORD=password ENTRIES=max_users











oracle@apt-lnxtst-01:/opt/oracle/product/10.2/cfgtoollogs/emca> emca -config dbcontrol db -repos recreate

STARTED EMCA at 14-Oct-2010 16:42:11
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database SID: orcl
Database Control is already configured for the database orcl
You have chosen to configure Database Control for managing the database orcl
This will remove the existing configuration and the default settings and perform a fresh configuration
Do you wish to continue? [yes(Y)/no(N)]: Y
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /opt/oracle/product/10.2

Database hostname ................ apt-lnxtst-01.aptus.co.uk
Listener port number ................ 1521
Database SID ................ orcl
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
14-Oct-2010 16:42:34 oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /opt/oracle/product/10.2/cfgtoollogs/emca/orcl/emca_2010-10-14_04-42-11-PM.log.
14-Oct-2010 16:42:35 oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
14-Oct-2010 16:42:43 oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...

Friday 11 March 2011

Unix AT command

unix at command
unix at
to set Unix AT job

bash-3.00$ at -t 201103111805 <<< this a time and date

at> cd /apps/documentum/dba/log/0000717c/sysadmin/dm_clean
at> nohup time iapi ccprod1 -Udmadmin -Pwhocares -RDMCleanDoc.txt >DMCleanDocAnuj.out&
at> .
at>
commands will be executed using /usr/bin/bash
job 1299866700.a at Fri Mar 11 18:05:00 2011

ctrl D <<<<< for end of at command


this is a command "iapi cccprod1 -Udmadmin -Pwhocares -RDMCleanDoc.txt >DMCleanDocAnuj.out& "

to list Unix AT job in Unix

-bash-3.00$ at -l
1299866400.a Fri Mar 11 18:00:00 2011
1299866700.a Fri Mar 11 18:05:00 2011

to remove AT job

-bash-3.00$ at -r 1299866400.a

Friday 4 March 2011

How to review Oracle patch log file ...

To put line number on this file ...
awk '{print NR $0}' patch.10.2.0.4.log >patch10_number.log

grep -i "error" patch10_number.log >patch_err.log
awk '{print NR $0}' patch_err.log|grep -i "error" >test

Thursday 3 March 2011

Is session Tracing on for Oracle session ?

sql_trace—Shows- (TRUE/FALSE) if SQL tracing has been enabled in the session
sql_trace_waits- If session tracing is enabled, you can have the trace write wait information to the trace file;
sql_trace_binds- If the session uses bind variables, This column shows TRUE/FALSE.



SQL> select sid, serial#, sql_trace, sql_trace_waits, sql_trace_binds
from v$session where username = 'SCOTT' ;

SID SERIAL# SQL_TRAC SQL_T SQL_T
---------- ---------- -------- ----- -----
42 8482 DISABLED FALSE FALSE


From this query we notice that tracing is not enabled in the session with SID 42 and Serial# 8482

Now, enable tracing of wait events, but not of bind variables.

Oracle package dbms_monitor to enable tracing.

begin
dbms_monitor.session_trace_enable (
session_id => 42,
serial_num => 8482,
waits => true,
binds => false
);
end;
/


select sid, serial#, sql_trace, sql_trace_waits, sql_trace_binds from v$session
where username = 'SCOTT' ;


SID SERIAL# SQL_TRAC SQL_T SQL_T
---------- ---------- -------- ----- -----
42 8482 ENABLED TRUE FALSE


View V$SESSION is populated only if the procedure session_trace_enable
in the package dbms_monitor is used to enable tracing,
not by alter session set sql_trace = true or setting the event 10046

Oracle DBA

anuj blog Archive