Wednesday, October 27, 2010

Steps Reover Current Redolog file in case corrupted :

ORACLE 8i -- Oracle hidden parameters
======================================

Note: Oracle hidden parameters are undocumented and unsupported by Oracle.
Make sure that you thoroughly test all hidden parameters before placing them in your production environment.

Parameter Name Description
----------------------------------------- --------------------------------------------------------
_allow_error_simulation Allow error simulation for testing
_allow_read_only_corruption allow read-only open even if database is corrupt
_allow_resetlogs_corruption allow resetlogs even if it will cause corruption
_allow_terminal_recovery_corruption Finish terminal recovery even if it may cause corruption
_corrupted_rollback_segments corrupted undo segment list



D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\ARCHIVELOG\2010_09_21\O1_MF_1_10_69JBT2QG_.ARC


SQL> select GROUP#,THREAD#, SEQUENCE#,members,status from v$log;

GROUP# THREAD# SEQUENCE# MEMBERS STATUS
---------- ---------- ---------- ---------- ----------------
1 1 11 1 CURRENT
2 1 9 1 INACTIVE
3 1 9 1 INACTIVE


SQL> ALTER DATABASE DROP LOGFILE GROUP 3;

Database altered.

SQL> select GROUP#,THREAD#, SEQUENCE#,members,status from v$log;

GROUP# THREAD# SEQUENCE# MEMBERS STATUS
---------- ---------- ---------- ---------- ----------------
1 1 11 1 CURRENT
2 1 9 1 INACTIVE

SQL> ALTER DATABASE DROP LOGFILE GROUP 1;
ALTER DATABASE DROP LOGFILE GROUP 1
*
ERROR at line 1:
ORA-01623: log 1 is current log for instance test (thread 1) - cannot drop
ORA-00312: online log 1 thread 1: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO01.LOG'


SQL> select GROUP#,THREAD#, SEQUENCE#,members,status from v$log;

GROUP# THREAD# SEQUENCE# MEMBERS STATUS
---------- ---------- ---------- ---------- ----------------
1 1 11 1 CURRENT
2 1 9 1 INACTIVE

SQL> shut immediate
ORA-03113: end-of-file on communication channel


SQL> shut immediate
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn't exist

SQL> select name,open_mode from v$database;
ERROR:
ORA-03114: not connected to ORACLE


SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Pr
oduction
With the Partitioning, OLAP and Data Mining options

D:\Documents and Settings\vzc00m>sqlplus '/ as sysdba'

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Sep 21 10:47:40 2010

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

Enter password:
Connected to an idle instance.

SQL> exit
Disconnected

D:\Documents and Settings\vzc00m>sqlplus '/ as sysdba'

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Sep 21 11:00:55 2010

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

Enter password:
Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area 591396864 bytes
Fixed Size 1250308 bytes
Variable Size 222301180 bytes
Database Buffers 360710144 bytes
Redo Buffers 7135232 bytes
Database mounted.

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery


SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-00316: log 1 of thread 1, type 0 in header is not log file
ORA-00312: online log 1 thread 1:
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO01.LOG'


SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Pr
oduction
With the Partitioning, OLAP and Data Mining options

D:\Documents and Settings\vzc00m>sqlplus '/ as sysdba'

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Sep 21 11:07:32 2010

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

Enter password:

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> startup pfile='D:\oracle\product\10.2.0\admin\test\pfile\init.ora.8152010234343' mount;
ORA-01081: cannot start already-running ORACLE - shut it down first

SQL> shut abort
ORACLE instance shut down.

SQL> startup pfile='D:\oracle\product\10.2.0\admin\test\pfile\init.ora.8152010234343' mount;
ORACLE instance started.

Total System Global Area 591396864 bytes
Fixed Size 1250308 bytes
Variable Size 163580924 bytes
Database Buffers 419430400 bytes
Redo Buffers 7135232 bytes
Database mounted.

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery


SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-00316: log 1 of thread 1, type 0 in header is not log file
ORA-00312: online log 1 thread 1:
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO01.LOG'


SQL> shut abort
ORACLE instance shut down.
SQL> startup pfile='D:\oracle\product\10.2.0\admin\test\pfile\init.ora.8152010234343';
ORACLE instance started.

Total System Global Area 591396864 bytes
Fixed Size 1250308 bytes
Variable Size 163580924 bytes
Database Buffers 419430400 bytes
Redo Buffers 7135232 bytes
Database mounted.
ORA-00316: log 1 of thread 1, type 0 in header is not log file
ORA-00312: online log 1 thread 1:
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO01.LOG'


SQL> startup pfile='D:\oracle\product\10.2.0\admin\test\pfile\init.ora.8152010234343' mount;
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL>

SQL>
SQL> shut abort
ORACLE instance shut down.

SQL> startup pfile='D:\oracle\product\10.2.0\admin\test\pfile\init.ora.8152010234343' mount;
ORACLE instance started.

Total System Global Area 591396864 bytes
Fixed Size 1250308 bytes
Variable Size 163580924 bytes
Database Buffers 419430400 bytes
Redo Buffers 7135232 bytes
Database mounted.

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery


SQL> recover database until cancel;
ORA-00279: change 815808 generated at 09/21/2010 09:19:17 needed for thread 1
ORA-00289: suggestion :
D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\ARCHIVELOG\2010_09_21\O1_MF_1_11_%U_.ARC
ORA-00280: change 815808 for thread 1 is in sequence #11


Specify log: {=suggested | filename | AUTO | CANCEL}
CANCEL
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSTEM01.DBF'


ORA-01112: media recovery not started


SQL> recover database until cancel USING BACKUP CONTROL FILE;
ORA-00905: missing keyword


SQL> recover database until cancel;
ORA-00279: change 815808 generated at 09/21/2010 09:19:17 needed for thread 1
ORA-00289: suggestion :
D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\ARCHIVELOG\2010_09_21\O1_MF_1_11_%U_.ARC
ORA-00280: change 815808 for thread 1 is in sequence #11


Specify log: {=suggested | filename | AUTO | CANCEL}
D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\ARCHIVELOG\2010_09_21\O1_MF_1_10_69JBT2QG_.ARC
ORA-00310: archived log contains sequence 10; sequence 11 required
ORA-00334: archived log:
'D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\TEST\ARCHIVELOG\2010_09_21\O1_MF_1_10_69JBT2QG_.ARC'


ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSTEM01.DBF'


SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced


SQL> select name,open_mode from v$database;
ERROR:
ORA-03114: not connected to ORACLE


SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Pr
oduction
With the Partitioning, OLAP and Data Mining options

D:\Documents and Settings\vzc00m>sqlplus '/ as sysdba'

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Sep 21 11:34:52 2010

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

Enter password:
Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 591396864 bytes
Fixed Size 1250308 bytes
Variable Size 222301180 bytes
Database Buffers 360710144 bytes
Redo Buffers 7135232 bytes
Database mounted.
Database opened.
SQL>




2nd time also faced the same issue, I did the same, and followed the above commands/ all cmds


SQL> startup
ORACLE instance started.

Total System Global Area 591396864 bytes
Fixed Size 1250308 bytes
Variable Size 167775228 bytes
Database Buffers 415236096 bytes
Redo Buffers 7135232 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\SYSTEM01.DBF'


SQL> recover database;
Media recovery complete.


SQL> alter database open;

Database altered.

SQL> select group#,thread#,members,status from v$log;

GROUP# THREAD# MEMBERS STATUS
---------- ---------- ---------- ----------------
1 1 1 CURRENT
2 1 1 UNUSED
3 1 1 INACTIVE



SQL> shut abort
ORACLE instance shut down.



Removed the Hidden parameter which I was included the Init file -- _ALLOW_RESETLOGS_CORRUPTION=true

SQL> startup pfile='D:\oracle\product\10.2.0\admin\bus\pfile\init.ora.8212010154717';
ORACLE instance started.

Total System Global Area 591396864 bytes
Fixed Size 1250308 bytes
Variable Size 163580924 bytes
Database Buffers 419430400 bytes
Redo Buffers 7135232 bytes
Database mounted.
Database opened.

SQL> create spfile from pfile;

File created.

SQL> shut abort
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 591396864 bytes
Fixed Size 1250308 bytes
Variable Size 171969532 bytes
Database Buffers 411041792 bytes
Redo Buffers 7135232 bytes
Database mounted.
Database opened.

SQL> show parameter spfile;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SPFILEBUS.ORA

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Pr
oduction
With the Partitioning, OLAP and Data Mining options

D:\Documents and Settings\vzc00m>



Regards,
Ravi P

Database Refersh Used HOT backup with in the same Node.

DB Refersh using Contolfile.txt

PROD DB:
--------
SQL> alter database backup controlfile to trace;

Database altered.


SQL> alter database begin backup;

Database altered.

SQL> set line 200
SQL> select * from v$backup;

FILE# STATUS CHANGE# TIME
---------- ------------------ ---------- ---------
1 ACTIVE 1078187 22-SEP-10
2 ACTIVE 1078187 22-SEP-10
3 ACTIVE 1078187 22-SEP-10
4 ACTIVE 1078187 22-SEP-10
5 ACTIVE 1078187 22-SEP-10

SQL> select * from v$backup;

FILE# STATUS CHANGE# TIME
---------- ------------------ ---------- ---------
1 ACTIVE 1078187 22-SEP-10
2 ACTIVE 1078187 22-SEP-10
3 ACTIVE 1078187 22-SEP-10
4 ACTIVE 1078187 22-SEP-10
5 ACTIVE 1078187 22-SEP-10

SQL> alter database end backup;

Database altered.

SQL> alter system switch logfile;

System altered.


GO to TEST DB ->

1. Shutdwon immediate

2. Remove all Datafiels

3. Prepare the control file scripts :

PROD DB control file info/-

STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "TEST" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 (
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO01.LOG',
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO011.LOG'
) SIZE 50M,
GROUP 2 (
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO02.LOG',
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO02_2A.LOG'
) SIZE 50M,
GROUP 3 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\REDO03.LOG' SIZE 50M
-- STANDBY LOGFILE
DATAFILE
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSTEM01.DBF',
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\UNDOTBS01.DBF',
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\SYSAUX01.DBF',
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\USERS01.DBF',
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\RAVI1.DBF'
CHARACTER SET WE8MSWIN1252
;



After made changes on the TEST database control file:

STARTUP NOMOUNT

CREATE CONTROLFILE set DATABASE "BUS" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 (
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\REDO01.LOG',
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\REDO011.LOG'
) SIZE 50M,
GROUP 2 (
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\REDO02.LOG',
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\REDO02_2A.LOG'
) SIZE 50M,
GROUP 3 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\REDO03.LOG' SIZE 50M
-- STANDBY LOGFILE
DATAFILE
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\SYSTEM01.DBF',
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\UNDOTBS01.DBF',
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\SYSAUX01.DBF',
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\USERS01.DBF',
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\RAVI1.DBF'
CHARACTER SET WE8MSWIN1252
;



Connect to Sqlplus /-

SQL> startup nomount
ORACLE instance started.

Total System Global Area 591396864 bytes
Fixed Size 1250308 bytes
Variable Size 171969532 bytes
Database Buffers 411041792 bytes
Redo Buffers 7135232 bytes

SQL> CREATE CONTROLFILE set DATABASE "BUS" RESETLOGS ARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 (
9 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\REDO01.LOG',
10 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\REDO011.LOG'
11 ) SIZE 50M,
12 GROUP 2 (
13 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\REDO02.LOG',
14 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\REDO02_2A.LOG'
15 ) SIZE 50M,
16 GROUP 3 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\REDO03.LOG' SIZE 50M
17 -- STANDBY LOGFILE
18 DATAFILE
19 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\SYSTEM01.DBF',
20 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\UNDOTBS01.DBF',
21 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\SYSAUX01.DBF',
22 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\USERS01.DBF',
23 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\BUS\RAVI1.DBF'
24 CHARACTER SET WE8MSWIN1252
25 ;

Control file created.


SQL> recover database using backup controlfile until cancel;
ORA-00279: change 1078187 generated at 09/22/2010 17:05:23 needed for thread 1
ORA-00289: suggestion :
D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\BUS\ARCHIVELOG\2010_09_22\O1_MF_1_25_%U_.ARC
ORA-00280: change 1078187 for thread 1 is in sequence #25


Specify log: {=suggested | filename | AUTO | CANCEL}
D:\oracle\product\10.2.0\flash_recovery_area\TEST\ARCHIVELOG\2010_09_22\O1_MF_1_
25_69N3JF1Q_.ARC
ORA-00279: change 1082079 generated at 09/22/2010 19:39:16 needed for thread 1
ORA-00289: suggestion :

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\BUS\ARCHIVELOG\2010_09_22\O1_MF_1_26_%U_.ARC
ORA-00280: change 1082079 for thread 1 is in sequence #26
ORA-00278: log file
'D:\oracle\product\10.2.0\flash_recovery_area\TEST\ARCHIVELOG\2010_09_22\O1_MF_1_25_69N3JF1Q_.ARC'

no longer needed for this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
cancel =====================================================================>>>>>>>>>>>>>>>>>>>>>>>>>> After there is no arvhive log in PROD DB..
Media recovery cancelled.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

SQL> alter database open resetlogs;

Database altered.

SQL> select name,open_mode,log_mode from v$database;

NAME OPEN_MODE LOG_MODE
--------- ---------- ------------
BUS READ WRITE ARCHIVELOG

SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 1
Next log sequence to archive 1
Current log sequence 1
SQL>



Regards,
Ravi P

Friday, October 22, 2010

rman restore issue using TSM

Last week while doing restoration on target server, I faced the below error.

ORA-19870: error reading backup piece rman_TEST_cold_20903043_2200_285_1.bak
ORA-19507: failed to retrieve sequential file, handle="rman_TEST_cold_20903043_2200_285_1.bak", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
ANU2508E Wrong write state


I did the following on troubleshooting the error

"tdpoconf showenv" from the Oracle user on both target and source machine resulted the TDP on oracle level.
Then ran command "dsmc" , this will tell on the tsm client level installed on the machine.
At os lever aix command "lslpp -l tivoli.tsm*".
Below document found to be very useful to me.
http://www-01.ibm.com/support/docview.wss?uid=swg21260621

Yet the issue did not resolve to me

activated some tracing to understand why i get this error.
following is to active tracing at TDP and API levels =>

- Add the following parameters to the TDPO_OPTFILE file used for the restore :

tdpo_trace_flags orclevel0 orclevel1 orclevel2
tdpo_trace_file /tmp/tdpo.trc

- To enable tracing of the API Client, add the following parameters to the file pointed to by the DSMI_ORC_CONFIG ( this option is in the tdpo.opt ) :

traceflag service
tracefile /tmp/api.trc

However the error here is due to the configuration most likely not set correctly to provide access to the object that is stored on TSM. To verify how the object is saved on TSM, run the following select statement from a TSM Server administrative commandline (dsmsdmc):

Select * from backups where node_name='NodeNameInCaps'
Where 'NodeNameInCaps' is the nodename that was used on the production when performing the backups.
-------------------------------------------------------------------------------------
Perform a find for all the libobk.a files on the target server where you are restoring to. As the root user run the command:
find / -name libobk.a -exec ls -l {} \; and found the link for oracle 10.2 is broken

$ORACLE_HOME/db/lib/libobk.a -> /usr/tivoli/tsm/client/oracle/bin64/libobk64a

Verify if this file exist =>
/usr/tivoli/tsm/client/oracle/bin64/libobk64.a ( note it is libobk64.a not libobk64a )

If it exist ; correct the link =>
rm $ORACLE_HOME/db/lib/libobk.a
then =>
ln -s /usr/tivoli/tsm/client/oracle/bin64/libobk64.a $ORACLE_HOME/db/lib/libobk.a

Keep the same ownership and permission for this link =>
lrwxrwxrwx 1 oracle dba

Then retry the restore operation .

Wednesday, October 13, 2010

Rman Cloning from Node1 to Node 2

RMAN CLONING FROM SERVER A to SERVER B

STEP1: TAKE COLD BACKUP ON SERVER A
STEP2:TRANSFER The Backuppiece from Server A to ServerB
STEP3:Restore the Controlfile from backuppiece restore controlfile from 'D:/DATA/bsdewd'
$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Oct 12 06:50:26 2010

connected to target database: XYZ (not mounted)

RMAN> restore controlfile from 'D:/DATA/bsdewd';

Starting restore at 12-OCT-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1091 devtype=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
output filename=d:\oracle\ctl1.ora
output filename=d:\oracle\ctl2.ora
output filename=d:\oracle\ctl3.ora
output filename=d:\oracle\ctl4.ora
Finished restore at 12-OCT-10

STEP4: Mount the database.

STEP5: CATALOG Bacup Piece

RMAN> catalog backuppiece '/emcd03/oracle/ORACLE/SF0T/DATA/Full_SF2T_352_1_732061884';

cataloged backuppiece
backup piece handle=/emcd03/oracle/ORACLE/SF0T/DATA/Full_SF2T_352_1_732061884 recid=355 stamp=732178556

RMAN>catalog backuppiece '/emcd03/oracle/ORACLE/SF0T/DATA/Full_SF2T_353_1_732062341';

cataloged backuppiece
backup piece handle=/emcd03/oracle/ORACLE/SF0T/DATA/Full_SF2T_353_1_732062341 recid=356 stamp=732178559

STEP6: Restore all datafiles from backup piece

rman target /

run {
allocate channel c1 device type disk;
allocate channel c2 device type disk;
set newname for datafile 1 to 'd:\oracle\system_02.dbf';
set newname for datafile 2 to 'd:\oracle\system.dbf';
set newname for datafile 3 to 'd:\oracle\rollback.dbf';
set newname for datafile 4 to 'd:\oracle\system_03.dbf';
set newname for datafile 15 to 'd:\oracle\1_data8_01.dbf';
set newname for datafile 16 to 'd:\oracle\1_indx11_01.dbf';
set newname for datafile 17 to 'd:\oracle\1_indx14_06.dbf';
set newname for datafile 18 to 'd:\oracle\1_indx16_01.dbf';
set newname for datafile 21 to 'd:\oracle\1_indx18_05.dbf';
set newname for datafile 5 to 'd:\oracle\tools.dbf';
set newname for datafile 6 to 'd:\oracle\users.dbf';
set newname for datafile 7 to 'd:\oracle\DRSYS1.dbf';
set newname for datafile 8 to 'd:\oracle\DRSYS2.dbf';
set newname for datafile 9 to 'd:\oracle\PERF1.dbf';
set newname for datafile 10 to 'd:\oracle\S_PRECISE_DATA_01.dbf';
set newname for datafile 11 to 'd:\oracle\S_PRECISE_INDX_01.dbf';
set newname for datafile 12 to 'd:\oracle\S_SF_DATA_RT1.dbf';
set newname for datafile 13 to 'd:\oracle\1_data1_01.dbf';
set newname for datafile 14 to 'd:\oracle\1_data1_02.dbf';
set newname for datafile 22 to 'd:\oracle\1_indx2_08.dbf';
set newname for datafile 23 to 'd:\oracle\1_indx20_01.dbf';
set newname for datafile 28 to 'd:\oracle\1_indx23_01.dbf';
set newname for datafile 29 to 'd:\oracle\1_indx21_01.dbf';
set newname for datafile 19 to 'd:\oracle\1_data10_01.dbf';
set newname for datafile 20 to 'd:\oracle\1_data10_02.dbf';
set newname for datafile 30 to 'd:\oracle\1_indx25_01.dbf';
set newname for datafile 31 to 'd:\oracle\1_indx27_01.dbf';
set newname for datafile 32 to 'd:\oracle\1_indx30_01.dbf';
set newname for datafile 24 to 'd:\oracle\VERITAS_I3_ORCL.dbf';
set newname for datafile 25 to 'd:\oracle\S_PRECISE_TEMP_01.dbf';
set newname for datafile 26 to 'd:\oracle\1_data12_01.dbf';
set newname for datafile 27 to 'd:\oracle\1_data12_02.dbf';
set newname for datafile 35 to 'd:\oracle\1_indx32_01.dbf';
set newname for datafile 36 to 'd:\oracle\1_indx34_01.dbf';
set newname for datafile 37 to 'd:\oracle\1_indx36_04.dbf';
set newname for datafile 40 to 'd:\oracle\1_indx37_01.dbf';
set newname for datafile 41 to 'd:\oracle\1_indx39_01.dbf';
set newname for datafile 33 to 'd:\oracle\1_data13_01.dbf';
set newname for datafile 34 to 'd:\oracle\1_data13_02.dbf';
set newname for datafile 44 to 'd:\oracle\1_indx4_01.dbf';
set newname for datafile 45 to 'd:\oracle\1_indx41_04.dbf';
set newname for datafile 46 to 'd:\oracle\1_indx5_01.dbf';
set newname for datafile 38 to 'd:\oracle\1_data15_01.dbf';
set newname for datafile 39 to 'd:\oracle\1_data15_02.dbf';
set newname for datafile 47 to 'd:\oracle\1_indx7_01.dbf';
set newname for datafile 50 to 'd:\oracle\1_indx7_10.dbf';
set newname for datafile 42 to 'd:\oracle\1_data17_01.dbf';
set newname for datafile 43 to 'd:\oracle\1_data17_02.dbf';
set newname for datafile 51 to 'd:\oracle\1_indx9_01.dbf';
set newname for datafile 52 to 'd:\oracle\1_data6_03.dbf';
set newname for datafile 53 to 'd:\oracle\1_data6_01.dbf';
set newname for datafile 60 to 'd:\oracle\1_data6_02.dbf';
set newname for datafile 48 to 'd:\oracle\1_data19_01.dbf';
set newname for datafile 49 to 'd:\oracle\1_data19_02.dbf';
set newname for datafile 67 to 'd:\oracle\1_data5_04.dbf';
set newname for datafile 54 to 'd:\oracle\1_data_01.dbf';
set newname for datafile 55 to 'd:\oracle\1_data2_02.dbf';
set newname for datafile 56 to 'd:\oracle\1_data2_03.dbf';
set newname for datafile 57 to 'd:\oracle\f_data22_03.dbf';
set newname for datafile 58 to 'd:\oracle\1_data22_01.dbf';
set newname for datafile 59 to 'd:\oracle\1_data22_02.dbf';
set newname for datafile 61 to 'd:\oracle\1_data24_01.dbf';
set newname for datafile 62 to 'd:\oracle\1_data24_02.dbf';
set newname for datafile 63 to 'd:\oracle\1_data24_03.dbf';
set newname for datafile 64 to 'd:\oracle\1_data24_04.dbf';
set newname for datafile 65 to 'd:\oracle\1_data26_01.dbf';
set newname for datafile 66 to 'd:\oracle\1_data26_02.dbf';
set newname for datafile 69 to 'd:\oracle\1_data28_01.dbf';
set newname for datafile 70 to 'd:\oracle\1_data28_02.dbf';
set newname for datafile 75 to 'd:\oracle\1_data29_01.dbf';
set newname for datafile 76 to 'd:\oracle\1_data29_02.dbf';
set newname for datafile 80 to 'd:\oracle\1_data3_01.dbf';
set newname for datafile 81 to 'd:\oracle\1_data3_02.dbf';
set newname for datafile 85 to 'd:\oracle\1_data31_01.dbf';
set newname for datafile 86 to 'd:\oracle\1_data31_02.dbf';
set newname for datafile 89 to 'd:\oracle\1_data33_01.dbf';
set newname for datafile 90 to 'd:\oracle\1_data33_02.dbf';
set newname for datafile 96 to 'd:\oracle\1_data35_01.dbf';
set newname for datafile 97 to 'd:\oracle\1_data35_02.dbf';
set newname for datafile 100 to 'd:\oracle\1_data38_01.dbf';
set newname for datafile 101 to 'd:\oracle\1_data38_02.dbf';
set newname for datafile 105 to 'd:\oracle\1_data40_01.dbf';
set newname for datafile 106 to 'd:\oracle\1_data40_02.dbf';
set newname for datafile 110 to 'd:\oracle\1_data42_01.dbf';
set newname for datafile 111 to 'd:\oracle\1_data42_02.dbf';
set newname for tempfile 1 to 'd:\oracle\temp01.dbf';
restore database;
recover database noredo;
switch datafile all;
switch tempfile all;
release channel c1;
release channel c2;
}
STEP7: alter database open resetlogs.

Saturday, September 25, 2010

The Mayonnaise Jar

When things in your life seem, Almost too much to handle,
When 24 Hours in a day is not enough,
Remember the mayonnaise jar and 2 cups of coffee.

A professor stood before his philosophy class
And had some items in front of him.
When the class began, wordlessly,
He picked up a very large and empty mayonnaise jar
And proceeded to fill it with golf balls.

He then asked the students, If the jar was full.
They agreed that it was.

The professor then picked up a box of pebbles and poured
them into the jar. He shook the jar lightly.
The pebbles rolled into the open Areas between the golf balls.

He then asked The students again
If the jar was full. They agreed it was.

The professor next picked up a box of sand
And poured it into the jar. Of course, the sand filled up everything else.
He asked once more if the jar was full. The students responded
With unanimous 'yes.'

The professor then produced Two cups of coffee from under the table
And poured the entire contents Into the jar, effectively
Filling the Empty space between the sand.
The students laughed.

'Now,' said the professor, As the laughter subsided,
'I want you to recognize that “This jar represents your life”.
The golf balls are the important things - God, family,
children, health, Friends, and Favorite passions –
Things that if everything else was lost
And only they remained, Your life would still be full.

The pebbles are the other things that matter Like your job, house, and car.

The sand is everything else --
The small stuff.

'If you put the sand into the jar first,' He continued,
'there is no room for The pebbles or the golf balls.
The same goes for life.

If you spend all your time And energy on the small stuff,
You will never have room for The things that are
Important to you.

So...

Pay attention to the things That are critical to your happiness.
Play With your children.
Take time to get medical checkups.
Take your partner out to dinner.

There will always be time
To clean the house and fix the disposal.

'Take care of the golf balls first --
The things that really matter.
Set your priorities. The rest is just sand.'

One of the students raised her hand
And inquired what the coffee represented.

The professor smiled.
'I'm glad you asked'.
It just goes to show you that no matter how full your life may seem,
there's always room for A couple of cups of coffee with a friend.'

Some Basic VI Concepts

:%s/DBA//g -To replace the word "DBA" with blank space
:%s/^/DBA/g -To add a Text "DBA" in front of all words
:%s/$/DBA/ -To add a Text "DBA" at the last of all words
:%s/\s\+$// -To remove blank spaces.

Handling Oracle Block Corruptions in Oracle7/8/8i/9i/10g

Handling Oracle Block Corruptions in Oracle7/8/8i/9i/10g -> Meta link Doc ID:28814.1

ORA-27301: OS failure message: Not enough space

Last week I experienced below error on solaris server.

*** SERVICE NAME:(SYS$BACKGROUND) 2009-02-05 20:14:41.719
*** SESSION ID:(169.1) 2009-02-05 20:14:41.719
*** 2009-02-05 20:14:41.719
Process startup failed, error stack:
ORA-27300: OS system dependent operation:fork failed with status: 12
ORA-27301: OS failure message: Not enough space
ORA-27302: failure occurred at: skgpspawn3
*** 2009-02-05 20:15:07.770
Process startup failed, error stack:
ORA-27300: OS system dependent operation:fork failed with status: 11
ORA-27301: OS failure message: Resource temporarily unavailable
ORA-27302: failure occurred at: skgpspawn5
*** 2009-02-05 21:39:15.391
Process startup failed, error stack:
ORA-27300: OS system dependent operation:fork failed with status: 12
ORA-27301: OS failure message: Not enough space
ORA-27302: failure occurred at: skgpspawn3


On checking system logs (/var/adm), dmesg and others , Noticed system was nearly out of swap.
As part of immediate resolution bounce database to kill all defunct processes and started the database again.

Metalink note 579365.1 described exactly the same issue

ORA-00230: operation disallowed: snapshot control file enqueue unavailable

If one RMAN job is already backing up the control file while another needs to create a new snapshot control file, then we may see the following message:

ORA-00230: operation disallowed: snapshot control file enqueue unavailable

Below query will determine which job is causing the wait:

SELECT s.sid, username AS "User", program, module, action, logon_time "Logon", l.*
FROM v$session s, v$enqueue_lock l
WHERE l.sid = s.sid and l.type = 'CF' AND l.id1 = 0 and l.id2 = 2;

ORA-1693: max # extents 4096 reached in lobsegment

I faced the below error on one of the production system. while goggling i found a good metalink note: 1014040.102

ORA-1693: max # extents 4096 reached in lobsegment ETS.SYS_LOB0000145096C00007$$

Mysql Technical Document -Source Mr.Anandha

Anandkumar formally known as Anandha do assortment research on mysql database and he use to read lot of write ups over internet. The below technical document he got from internet


---------- Forwarded message ----------
From: Anand Kumar
Date: Wed, Sep 8, 2010 at 10:10 PM
Subject: Fwd: master-slave replication sync problems.


Hi Guys,

I found it to be a good writeup about the internal funtion of the replication, worth reading....Hope this will clear all your doubts about the mysql replicaiton.


There are two formats for replication (ROW and STATEMENT) but the general process remains the same. Here is a nutshell summary of the process.

** on the master **

m1) The MySQL master is instructed to change some data.

m2) The data is changed and the results are committed to disk. If you rollback the changes before you commit them, then there is nothing to replicate. Only the InnoDB engine supports this type of rollback.

m3) The change committed in step 2 is written to the binary log

(repeat from step m1 until the Master is shutdown)


** on the slave - the IO thread **
(assuming that the slave is already configured with compatible data, a starting position, and the proper credentials to act as a slave)

o1) The SLAVE IO thread requests information from the master's binary logs. This information is identified by a file name and a byte offset from the start of that file

o2) The SLAVE IO thread copies all available information from the master's binary logs into a local copy of those logs known as the relay logs.

(repeat from o1 until the SLAVE IO thread is stopped(by error or by command) or the slave is shutdown)

** on the slave - the SQL thread **

s1) Once an unapplied change has been completely buffered into the relay logs, the SLAVE SQL thread attempts to apply the change to the slave's data.

s2) If LOG SLAVE UPDATES is enabled, copy the applied change (using the correct format) into the slave's binary log.

(repeat from s1 until the SLAVE SQL thread is stopped (by error or by command) or the slave is shutdown)

**
As you can tell by this very simplified process description, there is no attempt to rectify one dataset to the other. Replication operates under the principle that if you perform identical changes to identical sets of data, you will end up with identical end results.

Various replication "filters" can omit certain changes from either being replicated to or processed by the slave instance. Use these WITH EXTREME CAUTION as they can very easily create situations where the master and slave datasets diverge to the point that a rebuild of the slave data is the only effective repair.

**
When you get a replication error, such as DUPLICATE KEY, it is the administrator's responsibility to figure out why and fix it. Maybe some user on the slave added an extra row to a table? Maybe an INSERT ... SELECT added more rows on the slave than it did on the master? Maybe a DELETE on the master removed less rows than it did on the slave?

Simply skipping those problems (and others) without investigation or correction may allow the two datasets (master and slave) to diverge even more. The human administrator is required to make a judgment call on which version of the conflicting row is the "correct" version. Is is the one on the table or the change coming in from the binary log? Maybe the data on the slave is "correct" but it has been offset by a few rows inserted a long time ago.

It's your responsibility to understand and appropriately respond to the errors not just repeat scripted actions until the problems disappear temporarily.
--
Shawn Green
MySQL Principal Technical Support Engineer
Oracle USA, Inc.
Office: Blountville, TN

Tuesday, September 14, 2010

Some Useful linux commands for DBA's

I found this linux commands to be very useful for the DBA's from the oracle site...
Hope you people definitely find it to be useful tooo...


http://www.oracle.com/technology/pub/articles/advanced-linux-commands/part1.html
http://www.oracle.com/technology/pub/articles/advanced-linux-commands/part2.html
http://www.oracle.com/technology/pub/articles/advanced-linux-commands/part3.html
http://www.oracle.com/technology/pub/articles/advanced-linux-commands/part4.html
http://www.oracle.com/technology/pub/articles/advanced-linux-commands/part5.html

Ravikumar @Oracle

This Blog is created for a technical group of people who have good experience on their primary domains and to get connected on their technical experience, fun….etc to share on one common storage database..