Posts

Showing posts from May, 2015

DBMS SCHEDULER MAINTENANCE

Create a job BEGIN   DBMS_SCHEDULER.CREATE_JOB (      job_name           => 'TEST_JOB',      job_type           => 'EXECUTABLE',      job_action         => '/u01/app/abc.sql',      repeat_interval    => 'FREQ=MINUTELY',      enabled            => TRUE   ); END; / Unlike DBMS_JOB you do not need to commit the job creation for it to be taken into account. As a corollary, if you want to cancel it, you have to remove or disable it.            ******   Remove a job EXEC DBMS_SCHEDULER.DROP_JOB('TEST_JOB');            ******   Run a job now To force immediate job execution: EXEC dbms_scheduler.run_job('myjob');            ******   Change job attributes Examples: EXEC DBMS_SCHEDULER.S...

FIND ARCHIVE GAP BETWEEN PRIMARY AND STANDBY

Finding Archive gap between PRIMARY and STANDBY      A Physical Standby database syncs with Primary by continuous apply of archive logs from a Primary Database. When the logs are missing on standby is less than 10-15 numbers, We can simple ship the logs which are missing in the standby database from primary database by using SCP/FTP and then register the log files in standby to resolve the gap. Use below query on standby Db to see if there is any gap. This will be help full if u have logs shipped and not applied. But in situations when the listener is down or network disturbances. etc the logs wont be shipped so this query might not work. Run on Primary DB : Primary: SQL > select thread#, max(sequence#) "Last Primary Seq Generated" from v$archived_log val, v$database vdb where val.resetlogs_change# = vdb.resetlogs_change# group by thread# order by 1; The primary thread max seq should match standby. Run on Standby DB: ******************************************...

QUERY TO FIND ARCHIVE GAP BETWEEN PRIMARY AND STANDBY

Finding Archive gap between PRIMARY and STANDBY      A Physical Standby database syncs with Primary by continuous apply of archive logs from a Primary Database. When the logs are missing on standby is less than 10-15 numbers, We can simple ship the logs which are missing in the standby database from primary database by using SCP/FTP and then register the log files in standby to resolve the gap. Use below query on standby Db to see if there is any gap. This will be help full if u have logs shipped and not applied. But in situations when the listener is down or network disturbances. etc the logs wont be shipped so this query might not work. Run on Primary DB : Primary: SQL > select thread#, max(sequence#) "Last Primary Seq Generated" from v$archived_log val, v$database vdb where val.resetlogs_change# = vdb.resetlogs_change# group by thread# order by 1; The primary thread max seq should match standby. Run on Standby DB: ******************************************...

Flashback Database setup in Oracle

Enable Flash back on : Starting from Oracle 11g R2 we don't have to bounce the Database for these effects to get affected. If you are using pre 11G R2, you have to re bounce your system for these settings to get affected. [oracle@Linux1 ~]$ sqlplus /"As sysdba" SQL*Plus: Release 11.2.0.1.0 Production on Mon May 4 10:25:05 2015 Copyright (c) 1982, 2009, Oracle.  All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select * from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production PL/SQL Release 11.2.0.1.0 - Production CORE    11.2.0.1.0      Production TNS for Linux: Version 11.2.0.1.0 - Production NLSRTL Version 11.2.0.1.0 - Production Lets check if Flash back is enabled or not : SQL...