IDBA`s
iDBAs Login Contact
 
  HOME  
Welcome to IDBA`s Blog    

How to copy raw files to file system 
Here is the another simple trick , I learned in my recent project. This command helps to build a copy script a database with raw-to- raw or raw to regular file system.
If possible, we can even use this step for ASM database too. but make sure we create the ASM Disk groups. We still need to explore this method in ASM.

select 'dd if='||FILE_NAME||' bs=256k|gzip --fast |ssh urban "gunzip|dd '||' of='||replace(FILE_NAME,('SOURCE_SID'),('TARGET_SID'))||' bs=256k' ||' " ' from dba_data_files order by file_name;



@idbas.com we take every optimize approach to accomplish.We always give 100% database availability using Framework Approach.
Disclaimer : We are not responsible for commands.Information for reference only,not for execution. Before executing strongly recomend to test it
[ 60 comments ] ( 4607 views ) permalink ( 3.1 / 182 )
How to check for when did the last gather schema stats run. 
From my last experience , I have learned that these simple statements are life savors.. I would like to share these tiny statements to make other dba's life easy..

Gather stats information ready sql scripts for DBA : @ iDBA's we thought these are the useful quick statements to find out the status of gather status :


Script to find-out last gather apps stats ran in Oracle applications : It should work fine between R11 -R12 . Assuming that gather schema stats job is scheduled every wk.

For Apps schema :

select count(1)
from apps.fnd_concurrent_programs_vl p , apps.fnd_concurrent_requests r
where r.concurrent_program_id = p.concurrent_program_id
and r.program_application_id = p.application_id
and p.user_concurrent_program_name in (
'OnDemand Gather Schema Statistics',
'Gather Schema Statistics',
'Gather Schema Statistics (IT_ANALYZE)'
)
and (r.phase_code = 'C' and r.status_code= 'C' and r.actual_start_date >= sysdate-7)
/

For Non-Apps schemas :

set pages 0 echo off head off termout off verify off feed off lines 1000
select count(1)
from apps.fnd_concurrent_programs_vl p , apps.fnd_concurrent_requests r
where r.concurrent_program_id = p.concurrent_program_id
and r.program_application_id = p.application_id
and p.user_concurrent_program_name in (
'Gather Statistics for Non-Apps Schema'
)
and (r.phase_code = 'C' and r.status_code= 'C' and r.actual_start_date >= sysdate-7)



Tofind-out list of tables analyzed since last wk.

select count(1) from dba_tables where last_analyzed < sysdate -7

On the same note : Step to find-out for owner sys. Fur standad or small application based databases, some times it is recomend to gather on sys too.

select count(1) from dba_Tables where owner='SYS' and last_analyzed is not null
/


[ 55 comments ] ( 329 views ) permalink ( 3.1 / 300 )
Re-create the listener.ora and tnsnames.ora files : Using netca ~ 
Non- RAC
./netca /silent \
/responseFile $ORACLE_HOME/network/install/netca_typ.rsp \
/inscomp server \
/nodeinfo <DB Server Name>


RAC :
./netca /silent \
/responseFile $ORACLE_HOME/network/install/netca_typ.rsp \
/inscomp server \
/nodeinfo node1,node2
[ 49 comments ] ( 500 views ) permalink ( 2.9 / 274 )
Runaway and inactive processes ~ 
Found these querys are very useful for dba's.
Sql Used for run away.

#######################################################
1 select a.spid,b.inst_id,b.sid,b.process,b.module,b.status,machine,round(b.last_call_et/60,0) "Minutes Running" from gv$process a, gv$session b where
2 b.last_call_et >= 3600 *10 and a.addr=b.paddr and b.process='1234'
3 and type !='BACKGROUND'
4* order by 8 desc

Top 20 Active processes running more than 10 hours :
#######################################################

1 select a.spid,b.inst_id,b.sid,b.process,b.module,b.status,machine,round(b.last_call_et/60,0) "Minutes Running" from gv$process a, gv$session b where
2 b.last_call_et >= 3600 *10 and a.addr=b.paddr
3 and type !='BACKGROUND' and status='ACTIVE'
4* order by 8 desc

[ 35 comments ] ( 985 views ) permalink ( 3 / 281 )
How to configure retention policy : ~ 
Here are the steps to configure retention policy : ~

RMAN> show RETENTION POLICY;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 8 DAYS;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 8 DAYS; new RMAN configuration parameters are successfully stored
RMAN> show RETENTION POLICY;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 8 DAYS;
[ 52 comments ] ( 3723 views ) permalink ( 3 / 289 )
Using kfed in ASM 
srvctl stop asm -n ora-node-rac-1
srvctl stop asm -n ora-node-rac-2

cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk ikfed
As ROOT on BOTH NODES
setasm
vi /etc/sysconfig/oracleasm file, make sure to have these values set:

ORACLEASM_ENABLED=false
ORACLEASM_SCANBOOT=false

/etc/init.d/oracleasm stop
/etc/init.d/oracleasm disable

As ROOT ON FIRST NODE ONLY
kfed read /dev/sdg1 > read.out
vi read.out -- find value kfdhdb.grpname change tag from DATA to CLNE and save file
kfed merge /dev/sdh1 text=merge.out

As ROOT on BOTH NODES
vi /etc/sysconfig/oracleasm update values of two tags
ORACLEASM_ENABLED=true
ORACLEASM_SCANBOOT=false
/etc/init.d/oracleasm enable

As ROOT ON FIRST NODE ONLY
/etc/init.d/oracleasm force-renamedisk /dev/sdh1 CLNE

As ROOT on BOTH NODES
/etc/init.d/oracleasm listdisks
chown oracle:oinstall /dev/sdg1 /dev/sdh1
As USER ORACLE ON BOTH NODES
sqlplus "/ as sysdba"
alter system set asm_diskgroups ='DATA', 'CLNE';
alter system set asm_diskstring = '/dev/sdg1','/dev/sdh1'
alter diskgroup data mount;
alter diskgroup clne mount;
exit


asmcmd
ls -l
ASMCMD> ls -l
State Type Rebal Unbal Name
MOUNTED EXTERN N N CLNE/
MOUNTED EXTERN N N DATA/

[ 37 comments ] ( 7068 views ) permalink ( 3.1 / 271 )
Application Performance Impacted by Garbage Collection Pauses 
Issues most of the users encoutner with Garbage collection :
-----------------------------------------------------------------
An application running on OC4J appears unresponsive, with simple requests experiencing noticeable delays. The cause is that the JVM has crossed the low memory threshold and is running a full garbage collection to free up memory.
Solution can be varry from setup to setup:
-----------------------------------------------------------------
Consider using the incremental low pause collector, which avoids long major garbage collection pauses by doing portions of the major collection work at each minor collection. This collector (also known as the train collector) collects portions of the tenured generation - a memory pool holding objects that are typically collected in a major collection - at each minor collection. The result is shorter pauses spread over many minor collections.
The incremental collector is even slower than the default tenured generation collector when considering overall throughput.
To use the incremental collector, the -Xincgc option must be passed in on the Java command line at application startup. Set the initial and maximum size of the young generation (object pool) to the same value using the XX:NewSize and -XX:MaxNewSize options. Set the initial and the maximum Java heap sizes to the same value using the -Xms and-Xmx options.
For example, to use this collector with a server with 1 GB of physical memory:
java -server -Xincgc -XX:NewSize=64m -XX:MaxNewSize=64m -Xms512m -Xmx512m

[ 47 comments ] ( 916 views ) permalink ( 3 / 275 )
Steps to Upgrade to sun-jdk-6u20-linux-x64 
1. Download the 64 bit Sun JDK Media

Download the sun-jdk-6u20-linux-x64 media from Sun Website.

$HOME/sun-jdk-6u20-linux-x64/jdk-6u20-linux-x64.bin

2. Copy the media into the following temporary location

Download required jdk from site : sun-jdk-6u20-linux-x64
cp -p jdk-6u20-linux-x64.bin $HOME

cd $HOME
./jdk-6u20-linux-x64.bin
Follow thru and accept the agreement, and the jdk install will complete and create the following dir under $HOME/jdk1.6.0_20


3. Perform the following steps for any Oracle Homes upgrading from 32 bit sun jdk to 64 bit sun jdk ( in our case it is SOA and WSM Oracle homes)


Steps shown for SOA oracle home:
----------------------------------

.setenv
opmnctl stopall

cd $ORACLE_HOME
mv jdk jdk.32bit.orig
cp -rp $HOME/jdk1.6.0_20 .
mv jdk1.6.0_20 jdk

cd $ORACLE_HOME/opmn/conf
Edit opmn.xml file and remove any OC4J instance java options referencing jdk1.5.0_17.
Remove the following line in opmn.xml file for all OC4J_SOA instances.
<data id="java-bin" value="/oracle/products/jdk1.5.0_17/bin/java"/>

Start the servers
opmnctl startall
---------------------------------
4. Similarly follow the above steps for WSM oracle homes.
5. Valide that the 64 bit Sun JDK is being used
java -version (to check the version is JDK 6 u 20 x_64)

ps -ef | grep java ( to ensure <oracle_home>/jdk/bin/java is being used)



[ 133 comments ] ( 1848 views ) permalink ( 2.7 / 49 )
Configuring Notification Service in BPEL 
Edit the /oracle/products/10.1.3.1/SOA/bpel/system/services/config/ns_emails.xml file for the following as shown in blue color



<EmailAccounts xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"
EmailMimeCharset=""
NotificationMode="EMAIL">
<EmailAccount>
<Name>Default</Name>
<GeneralSettings>
<FromName>Customer Service</FromName>
<FromAddress>email@xxx.com</FromAddress>
</GeneralSettings>
<OutgoingServerSettings>
<SMTPHost>smtp.company.com</SMTPHost>
<SMTPPort>25</SMTPPort>
</OutgoingServerSettings>
<IncomingServerSettings>
<Server>smtp.company.com</Server>
<Port>110</Port>
<Protocol>pop3</Protocol>
<UserName>accountId</UserName>
<Password ns0:encrypted="false" xmlns:ns0="http://xmlns.oracle.com/ias/pcbpel/NotificationService">password</Password>
<UseSSL>false</UseSSL>
<Folder>Inbox</Folder>
<PollingFrequency>1</PollingFrequency>
<PostReadOperation>
<MarkAsRead/>
</PostReadOperation>
</IncomingServerSettings>
</EmailAccount>

</EmailAccounts>
[ 39 comments ] ( 377 views ) permalink ( 3.1 / 265 )
EM agent clonning steps to add new databases to repository 
Tar and copy from the source location to target location.
Use tar -cvzf to create tar file
use tar -xvzf to untar the zip file.
Or gunzip the tar file to rquired location :

cd <Agent Home >
gunzip < agent10g.tar.gz | tar xvf -

cd /oracle/products
rm -rf agent10g.tar.gz

cd <Agent Home >/oui/bin

./runInstaller -clone -forceClone ORACLE_HOME=<Complete Agent Path > ORACLE_HOME_NAME=agent10g -noconfig -silent

exit

Login in another session and run.. root.sh

cd <Agent Home >/bin

./agentca -f

./emctl secure agent

Pass the required autheticated passwd.

./emctl start agent

[ 69 comments ] ( 673 views ) permalink ( 3 / 252 )

1 23 next

 
© 2009 All Rights Reserved by iDBAs.com.