Tuesday, October 2, 2012

problem with du and df commands disagree (OCFS2 1.4.1 BUG)


Today our production database stopped working because of ocfs2 1.4.1 bug..du -sch and df -h was showing different size on location where archive logs are..so after searching on google, i realize we hit a bug with ocfs2 1.4.1. Here is the solution of fixing this problem;

 first of all u need to umount ocfs2 partition using below command line;


 
umount /oradata1 (location where partition as ocfs2 is mounted)

then u need to run ;

/sbin/fsck.ocfs2 -fy /dev/sda1
it could take a while to finish; u can break the operation while fixing..wont effect any datafiles or system files on this partition...in case of losing any datafiles, better taking a fresh backup before running fsck.ocfs2.

Friday, September 21, 2012

ASMCMD-08102: no connection to ASM

[oracle@localhost ~]$ export ORACLE_HOME=/u01/app/oracle/grid
[oracle@localhost ~]$ export PATH=/u01/app/oracle/grid/bin
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ asmcmd

Thursday, September 13, 2012

ORA-04021: timeout occurred while waiting to lock object

U have to kill all sessions using object which u wanna compile, u can use this below script to find out which sessions are using any object..

select 'kill -9 '||b.spid||' # username '||c.username||'' from gv$access a, gv$process b, gv$session c where a.object=upper('object_name') and a.sid=c.sid and b.addr=c.paddr


run the output on linux to kill all sessions then compile object

Monday, June 4, 2012

create a directory for datapump

CREATE OR REPLACE DIRECTORY DP AS '/u01/app/oracle/datapump/';
GRANT READ, WRITE ON DIRECTORY DP TO system;

Extract Tablespaces with dbms_metadata.get_ddl



select 'select dbms_metadata.get_ddl(''TABLESPACE'','''
  ||  tablespace_name || ''') from dual;' from dba_tablespaces

Friday, June 1, 2012

How to list of dates between 2 dates

How to list of dates between 2 dates

select to_date('23-04-2011', 'DD-MM-YYYY') + rownum -1 dt
    from dual
    connect by level <= to_date('05-05-2011', 'DD-MM-YYYY') - to_date('23-04-2011', 'DD-MM-YYYY') + 1;

Tuesday, March 6, 2012

OGG-00529 DDL Replication is enabled but table OGG.GGS_DDL_HIST is not found

OGG-00529  DDL Replication is enabled but table OGG.GGS_DDL_HIST is not found

u must be in the goldengate directory..
 
 
SQL> alter system set recyclebin=off;
System altered.

SQL> @marker_setup
Marker setup script
You will be prompted for the name of a schema for the GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.
Enter GoldenGate schema name:OGG
Marker setup table script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to OGG
MARKER TABLE
-------------------------------
OK

MARKER SEQUENCE
-------------------------------
OK

Script complete.

SQL> @ddl_setup


OGG-00512

ERROR   OGG-00512  RECYCLEBIN must be turned off. For 10gr2 and up, set RECYCLEBIN in parameter file to OFF. For 10gr1, set _RECYCLEBIN in parameter file to FALSE. Then restart database and extract.

connect with sysdba ;

alter system set recyclebin=off scope=spfile;
  
then restart database
 
SQL> startup force
 
SQL> show parameter recyclebin 

recyclebin                           string      OFF