Posts

Showing posts from June, 2013

Oracle 10g/11g:How to restore archive logs from RMAN Backup ?.

Image
Hi, It is possible when sometimes we removed archives from archive destination and it requires for synchronize standby database. For this need to restore from one of the available backup like RMAN,hot backup etc. We here use RMAN backup script to get the deleted or removed archive logs. --For All Archive logs from RMAN backup. RUN  {  ALLOCATE CHANNEL C1 DEVICE TYPE DISK;  RESTORE ARCHIVELOG ALL;  RELEASE CHANNEL C1; } --For only single archive by sequence number. RUN  {  ALLOCATE CHANNEL C1 DEVICE TYPE DISK;  RESTORE ARCHIVELOG LOGSEQ 12345 ;  RELEASE CHANNEL C1; } --For range of sequence number of archives. RUN  {  ALLOCATE CHANNEL C1 DEVICE TYPE DISK;  RESTORE ARCHIVELOG FROM LOGSEQ 1 UNTIL 12345 ; RELEASE CHANNEL C1; }

Oracle 10g:Get Unix/Linux Mount Point info /Alert logs in Mail By Java Source

Image
Execute Unix/Linux commands by Java Source This is very easy with few steps. 1.CREATE JAVA SOURCE into oracle 10g database. Install jvm.Connect to SQL with sysdba priviledges. @$ORACLE_HOME/javavm/install/initjvm.sql   CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Host" AS import java.io.*; public class Host {   public static void executeCommand(String command) {     try {       String[] finalCommand;       if (isWindows()) {         finalCommand = new String[4];         // Use the appropriate path for your windows version.         //finalCommand[0] = "C:\\winnt\\system32\\cmd.exe";    // Windows NT/2000         finalCommand[0] = "C:\\windows\\system32\\cmd.exe";    // Windows XP/2003         //finalCommand[0] = "C:\\windows\\syswow64\\cmd.exe";  // Windows 64-bit         finalCommand[1] = "/y";         finalCommand[2] = "/c";         finalCommand[3] = command;       }       else {         finalCom