Wednesday 12 September 2012

Solution for cron/oracle: Permission denied

Error :


[oracle@plcdbprod ~]$ crontab -l

cron/oracle: Permission denied



Solution :


Log in as a root , and find the permission as given by,

[root@plcdbprod ~]# ls -l /usr/bin/crontab

-rwxr-xr-x 1 root root 315432 Jul 15  2008 /usr/bin/crontab




[root@plcdbprod ~]# chmod 4755 /usr/bin/crontab

[root@plcdbprod ~]# ls -l /usr/bin/crontab

-rwsr-xr-x 1 root root 315432 Jul 15  2008 /usr/bin/crontab



Finally check your crontab -e login by oracle .

Tuesday 4 September 2012

Solution for ORA-01152: file 1 was not restored from a sufficiently old backup

ORA-01152: file 1 was not restored from a sufficiently old backup 

Cause :

Redo logs are not applied properly during the recover stage.

Solution :


C:\Documents and Settings\Administrator>rman target sys

Recovery Manager: Release 10.2.0.2.0 - Production on Tue Sep 4 15:26:14 2012

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

target database Password:
connected to target database: RBOSDB (DBID=2699038894, not mount)



RMAN> restore controlfile from 'E:\Rman_bkp_old\Level0\CF_RBOSDB_20120904_844.CT
L';

Starting restore at 04-SEP-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=157 devtype=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\RBOSDB\CONTROL01.CTL
output filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\RBOSDB\CONTROL02.CTL
output filename=D:\ORACLE\PRODUCT\10.2.0\ORADATA\RBOSDB\CONTROL03.CTL
Finished restore at 04-SEP-12




 RMAN> sql 'alter database mount';

sql statement: alter database mount
released channel: ORA_DISK_1

RMAN> catalog start with 'E:\Rman_bkp_old\Level0';

Starting implicit crosscheck backup at 04-SEP-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: sid=154 devtype=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: sid=153 devtype=DISK
Crosschecked 12 objects
Crosschecked 179 objects
Finished implicit crosscheck backup at 04-SEP-12

Starting implicit crosscheck copy at 04-SEP-12
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
Crosschecked 1 objects
Finished implicit crosscheck copy at 04-SEP-12

searching for all files in the recovery area
cataloging files...
no files cataloged

searching for all files that match the pattern E:\Rman_bkp_old\Level0

List of Files Unknown to the Database
=====================================
File Name: E:\RMAN_BKP_OLD\Level0\ARC_RBOSDB_20120904_840
File Name: E:\RMAN_BKP_OLD\Level0\ARC_RBOSDB_20120904_841
File Name: E:\RMAN_BKP_OLD\Level0\ARC_RBOSDB_20120904_843
File Name: E:\RMAN_BKP_OLD\Level0\CF_RBOSDB_20120904_844.CTL
File Name: E:\RMAN_BKP_OLD\Level0\DF_RBOSDB_20120904_835
File Name: E:\RMAN_BKP_OLD\Level0\DF_RBOSDB_20120904_836
File Name: E:\RMAN_BKP_OLD\Level0\DF_RBOSDB_20120904_837
File Name: E:\RMAN_BKP_OLD\Level0\DF_RBOSDB_20120904_838
File Name: E:\RMAN_BKP_OLD\Level0\DF_RBOSDB_20120904_839

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: E:\RMAN_BKP_OLD\Level0\ARC_RBOSDB_20120904_840
File Name: E:\RMAN_BKP_OLD\Level0\ARC_RBOSDB_20120904_841
File Name: E:\RMAN_BKP_OLD\Level0\ARC_RBOSDB_20120904_843
File Name: E:\RMAN_BKP_OLD\Level0\CF_RBOSDB_20120904_844.CTL
File Name: E:\RMAN_BKP_OLD\Level0\DF_RBOSDB_20120904_835
File Name: E:\RMAN_BKP_OLD\Level0\DF_RBOSDB_20120904_836
File Name: E:\RMAN_BKP_OLD\Level0\DF_RBOSDB_20120904_837
File Name: E:\RMAN_BKP_OLD\Level0\DF_RBOSDB_20120904_838
File Name: E:\RMAN_BKP_OLD\Level0\DF_RBOSDB_20120904_839

RMAN> restore database;

Starting restore at 04-SEP-12
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3

channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\RBOSDB\SYSTEM01.DBF

restoring datafile 00002 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\RBOSDB\UNDOTBS01.DB
F
restoring datafile 00005 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\RBOSDB\RBOTBS01.DBF

channel ORA_DISK_1: reading from backup piece E:\RMAN_BKP_OLD\LEVEL0\DF_RBOSDB_2
0120904_837
channel ORA_DISK_2: starting datafile backupset restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
restoring datafile 00003 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\RBOSDB\SYSAUX01.DBF

restoring datafile 00007 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\RBOSDB\RBO_DATA02.D
BF
restoring datafile 00008 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\RBOSDB\RBO20111201.
DBF
channel ORA_DISK_2: reading from backup piece E:\RMAN_BKP_OLD\LEVEL0\DF_RBOSDB_2
0120904_836
channel ORA_DISK_3: starting datafile backupset restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
restoring datafile 00004 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\RBOSDB\USERS01.DBF
restoring datafile 00006 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\RBOSDB\RBO_DATA01.D
BF
restoring datafile 00009 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\RBOSDB\RBO_DATA03.D
BF
channel ORA_DISK_3: reading from backup piece E:\RMAN_BKP_OLD\LEVEL0\DF_RBOSDB_2
0120904_835
channel ORA_DISK_1: restored backup piece 1
piece handle=E:\RMAN_BKP_OLD\LEVEL0\DF_RBOSDB_20120904_837 tag=TAG20120904T01000
3
channel ORA_DISK_1: restore complete, elapsed time: 00:00:55
channel ORA_DISK_2: restored backup piece 1
piece handle=E:\RMAN_BKP_OLD\LEVEL0\DF_RBOSDB_20120904_836 tag=TAG20120904T01000
3
channel ORA_DISK_2: restore complete, elapsed time: 00:01:30
channel ORA_DISK_3: restored backup piece 1
piece handle=E:\RMAN_BKP_OLD\LEVEL0\DF_RBOSDB_20120904_835 tag=TAG20120904T01000
3
channel ORA_DISK_3: restore complete, elapsed time: 00:05:55
Finished restore at 04-SEP-12

RMAN> recover database;

Starting recover at 04-SEP-12
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3

starting media recovery

archive log thread 1 sequence 2520 is already on disk as file E:\ARCHIVES\ARC025
20_0763128369.001
archive log thread 1 sequence 2521 is already on disk as file E:\ARCHIVES\ARC025
21_0763128369.001
archive log thread 1 sequence 2522 is already on disk as file E:\ARCHIVES\ARC025
22_0763128369.001
archive log thread 1 sequence 2523 is already on disk as file E:\ARCHIVES\ARC025
23_0763128369.001
archive log thread 1 sequence 2524 is already on disk as file E:\ARCHIVES\ARC025
24_0763128369.001
archive log thread 1 sequence 2525 is already on disk as file E:\ARCHIVES\ARC025
25_0763128369.001
archive log thread 1 sequence 2526 is already on disk as file E:\ARCHIVES\ARC025
26_0763128369.001
archive log thread 1 sequence 2527 is already on disk as file E:\ARCHIVES\ARC025
27_0763128369.001
archive log thread 1 sequence 2528 is already on disk as file E:\ARCHIVES\ARC025
28_0763128369.001
archive log thread 1 sequence 2529 is already on disk as file E:\ARCHIVES\ARC025
29_0763128369.001
archive log thread 1 sequence 2530 is already on disk as file E:\ARCHIVES\ARC025
30_0763128369.001
archive log thread 1 sequence 2531 is already on disk as file E:\ARCHIVES\ARC025
31_0763128369.001
archive log thread 1 sequence 2532 is already on disk as file E:\ARCHIVES\ARC025
32_0763128369.001
archive log thread 1 sequence 2533 is already on disk as file E:\ARCHIVES\ARC025
33_0763128369.001
archive log thread 1 sequence 2534 is already on disk as file E:\ARCHIVES\ARC025
34_0763128369.001
archive log thread 1 sequence 2535 is already on disk as file E:\ARCHIVES\ARC025
35_0763128369.001
archive log thread 1 sequence 2536 is already on disk as file E:\ARCHIVES\ARC025
36_0763128369.001
archive log thread 1 sequence 2537 is already on disk as file E:\ARCHIVES\ARC025
37_0763128369.001
archive log thread 1 sequence 2538 is already on disk as file E:\ARCHIVES\ARC025
38_0763128369.001
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\RBOSDB\SYSTEM01.DBF'

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/04/2012 15:18:20
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 2512 lowscn 7303582034654 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2511 lowscn 7303582034614 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2510 lowscn 7303582034360 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2509 lowscn 7303582008284 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2508 lowscn 7303582007366 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2507 lowscn 7303581998937 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2506 lowscn 7303581998009 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2505 lowscn 7303581450560 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2504 lowscn 7303581450521 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2503 lowscn 7303581450516 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2502 lowscn 7303581428877 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2501 lowscn 7303581428844 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2500 lowscn 7303581428839 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2499 lowscn 7303581410650 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2498 lowscn 7303581410630 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2497 lowscn 7303581410625 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2496 lowscn 7303581407456 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2495 lowscn 7303581407423 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2494 lowscn 7303581407411 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2493 lowscn 7303581392443 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2492 lowscn 7303581391442 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2491 lowscn 7303581385309 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2490 lowscn 7303581384320 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2489 lowscn 7303581376919 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2488 lowscn 7303581375941 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2487 lowscn 7303581373755 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2486 lowscn 7303581372758 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2485 lowscn 7303581365903 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2484 lowscn 7303581365747 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2483 lowscn 7303581365592 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2482 lowscn 7303581355243 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2481 lowscn 7303581354494 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2480 lowscn 7303581351976 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2479 lowscn 7303581351183 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2478 lowscn 7303581339205 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2477 lowscn 7303581338348 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2476 lowscn 7303581310573 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2475 lowscn 7303581309621 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2474 lowscn 7302903016349 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2473 lowscn 7302903016314 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2472 lowscn 7302903016302 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2471 lowscn 7302903013255 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2470 lowscn 7302903012356 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2469 lowscn 7302903009144 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2468 lowscn 7302903008151 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2467 lowscn 7302902986409 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2466 lowscn 7302902983109 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2465 lowscn 7302902982936 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2464 lowscn 7302902964585 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2463 lowscn 7302902964563 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2462 lowscn 7302902964558 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2461 lowscn 7302902961305 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2460 lowscn 7302902961274 found to res
tore
RMAN-06025: no backup of log thread 1 seq 2459 lowscn 7302902961269 found to res
tore
 MAN-06025: no backup of log thread 1 seq 2458 lowscn 730290292
RMAN> sql 'alter database open';

sql statement: alter database open
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 09/04/2012 15:18:40
RMAN-11003: failure during parse/execution of SQL statement: alter database open

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

RMAN> sql 'alter database open resetlogs';

sql statement: alter database open resetlogs
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 09/04/2012 15:18:45
RMAN-11003: failure during parse/execution of SQL statement: alter database open
 resetlogs
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\RBOSDB\SYSTEM01.DBF'

For the above restoration , we are doing the recovery using level0 backup with latest archivelogs sysdate -2)

But when we try to recover DB it will search the log file from first,please follow the steps below to recover the DB successfully.


C:\Documents and Settings\Administrator>sqlplus

SQL*Plus: Release 10.2.0.2.0 - Production on Tue Sep 4 16:13:18 2012

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Enter user-name: sys as sysdba
Enter password:

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

SQL> recover database until cancel using backup controlfile;


ORA-00279: change 7303582275561 generated at 09/04/2012 01:00:04 needed for
thread 1
ORA-00289: suggestion : E:\ARCHIVES\ARC02536_0763128369.001
ORA-00280: change 7303582275561 for thread 1 is in sequence #2536


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}


CANCEL
Media recovery cancelled.


SQL> alter database open resetlogs;

Database altered.


SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- ----------
RBOSDB    READ WRITE


Thanks & Regards,

Suresh R









ORA-00214: Controlfile Version Inconsistent 


Reason;

During the database shutdown one of the control file went inconsistent state .

Solution ,

1.Cut the inconsistent file and paste some other locations.

2.Now you have only two control file to mount your DB .

3. Edit the pfile and delete that inconsistent controlfile,and startup using pfile .

4.Now check the number of controlfiles using { select name from v$controlfile; }

If it is started , your DB is up and running no problem with your controlfile .

5.Shut down the database 

6.Manually create one cotrolfile from others using copy & paste and rename the file what you want other .

7.Edit the pfile and enter the added controlfile name .

8.Startup the DB and create spfile from pfile .using (create spfile from pfile='location';)

9.Finally again one shut and start the database successfully

10.Now check the number of controlfiles { select name from v$controlfile; }

Do best.

Regards,

Suresh R