How to over come error on RMAN - oracle

I am getting following error in RMAN:-
Starting backup at 18-NOV-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/18/2015 14:19:36
ORA-17628: Oracle error 19505 returned by remote Oracle server
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/18/2015 14:19:37
ORA-17628: Oracle error 19505 returned by remote Oracle server
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/18/2015 14:19:38
ORA-17628: Oracle error 19505 returned by remote Oracle server
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 11/18/2015 14:19:40
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/18/2015 14:19:39
ORA-17628: Oracle error 19505 returned by remote Oracle

ORA-19505: failed to identify file <file> means there is some missing file.
First, do a crosscheck with RMAN. Then try again.

RMAN-03009 & ORA-17628
You will see this error when A previous duplicate had been done to this same location and some of the datafiles still remained in place.
Solution: Remove the named files from the "AUXILIARY server" and retry the duplicate
ORA-19505
You will see this error when db_file_name_convert not specified and controlfile location is wrong. Please specify the correct path.

Related

Oracle Change Backupset Command

I am trying to enable a backupset. This backupset physically exists on disk along with other backupsets. I am issuing following command which results in a error:
RMAN> change backupset 4882 available;
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of available command at 07/24/2020 14:37:16
RMAN-06160: no backup pieces found for backup set key: 4882
RMAN> list backupset 4882;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of list command at 07/24/2020 17:39:01
RMAN-06160: no backup pieces found for backup set key: 4882
RMAN>report obsolete;
Backup Set 4872 17-FEB-20
Backup Piece 4872 17-FEB-20 /oracle/app/oracle/fast_recovery_area/cc/cc/90223CE92F61074BE0536A4E110AC491/backupset/2020_02_17/o1_mf_nnnd1_DAILY_IUB_h4l_.bkp
Backup Set 4898 22-JUL-20
Backup Piece 4898 22-JUL-20
/oracle/app/oracle/fast_recovery_area/cc/cc/backupset/2020_07_22/o1_mf_nnndf_TAG20200722T233833_hkjjt55t_.bkp
Backup Set 4899 22-JUL-20
Backup Piece 4899 22-JUL-20 /oracle/app/oracle/fast_recovery_area/cc/cc/backupset/2020_07_22/o1_mf_nnndf_TAG20200722T233833_hkjjtool_.bkp
RMAN> list backup summary
4881 B A A DISK 17-FEB-20 1 1 YES
ARC_DAILY_IUB
4883 B F A DISK 21-FEB-20 1 1 NO
RMAN> validate backupset 4882;
Starting validate at 24-JUL-20
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of validate command at 07/24/2020 17:50:56
RMAN-06160: no backup pieces found for backup set key: 4882
Also, RMAN is also not listing this backupset in LIST BACKUPSET SUMMARY command though it can list other backupsets which physically exists at the same disk location.
Please help me to resolve this problem.

During RMAN backup, shutdown immediate database and facing error ORA-12514: TNS:listener?

I was taking an RMAN backup.
RMAN> SHUTDOWN IMMEDIATE;
After Shutdown Immediate i am not able to startup database.
I have tried
conn sys#databasename as sysdba
RMAN target sys#database
lsnrctl stop start status
But i am getting this error.
C:\Users\Umair>rman target sys#ora_prep
Recovery Manager: Release 12.1.0.2.0 - Production on Mon Jul 13 00:18:00 2020
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
target database Password:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04005: error from target database:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Advice, please.Thank you.
Oracle 12.1.0
Windows 10
Static listener registration:
https://docs.oracle.com/en/database/oracle/oracle-database/18/spmss/adding-static-service-to-listener.html
https://support.oracle.com/knowledge/Oracle%20Database%20Products/2312510_1.html

oracle show error RMAN on replication

When I started run this RMAN script
run {
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate channel prmy3 type disk;
allocate channel prmy4 type disk;
allocate auxiliary channel stby type disk;
duplicate target database for standby from active database
spfile
parameter_value_convert 'ARPISDEV','ARPISDEVSTBY'
set db_unique_name='ARPISDEVSTBY'
set db_file_name_convert='/ARPISDEV/','/ARPISDEVSTBY/'
set log_file_name_convert='/ARPISDEV/','/ARPISDEVSTBY/'
set control_files='/opt/oradata/ARPISDEVSTBY/control01.ctl'
set log_archive_max_processes='5'
set fal_client='ARPISDEVSTBY'
set fal_server='ARPISDEV'
set standby_file_management='AUTO'
set log_archive_config='dg_config=(ARPISDEV,ARPISDEVSTBY)'
set log_archive_dest_2='service=orcl ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=ARPISDEV'
;
}
its returned me this errors
`Starting backup at 11-APR-18 channel prmy1: starting datafile copy
input datafile file number=00010
name=/opt/oradata/ARPISDEV/ar_data05.dbf channel prmy2: starting
datafile copy input datafile file number=00011
name=/opt/oradata/ARPISDEV/ar_data04.dbf channel prmy3: starting
datafile copy input datafile file number=00012
name=/opt/oradata/ARPISDEV/ar_data03.dbf channel prmy4: starting
datafile copy
input datafile file number=00013
name=/opt/oradata/ARPISDEV/ar_data02.dbf RMAN-03009: failure of backup
command on prmy1 channel at 04/11/2018 02:36:23 ORA-17628: Oracle
error 19505 returned by remote Oracle server continuing other job
steps, job failed will not be re-run channel prmy1: starting datafile
copy
input datafile file number=00014
name=/opt/oradata/ARPISDEV/ar_data01.dbf RMAN-03009: failure of backup
command on prmy2 channel at 04/11/2018 02:36:23 ORA-17628: Oracle
error 19505 returned by remote Oracle server continuing other job
steps, job failed will not be re-run channel prmy2: starting datafile
copy
input datafile file number=00015
name=/opt/oradata/ARPISDEV/ar_prod03.dbf RMAN-03009: failure of backup
command on prmy3 channel at 04/11/2018 02:36:23 ORA-17628: Oracle
error 19505 returned by remote Oracle server continuing other job
steps, job failed will not be re-run channel prmy3: starting datafile
copy
input datafile file number=00016
name=/opt/oradata/ARPISDEV/ar_prod02.dbf RMAN-03009: failure of backup
command on prmy4 channel at 04/11/2018 02:36:23 ORA-17628: Oracle
error 19505 returned by remote Oracle server continuing other job
steps, job failed will not be re-run channel prmy4: starting datafile
copy
input datafile file number=00017
name=/opt/oradata/ARPISDEV/ar_prod01.dbf RMAN-03009: failure of backup
command on prmy1 channel at 04/11/2018 02:36:23 ORA-17628: Oracle
error 19505 returned by remote Oracle server continuing other job
steps, job failed will not be re-run channel prmy1: starting datafile
copy
input datafile file number=00019
name=/opt/oradata/ARPISDEV/ar_indx01.dbf RMAN-03009: failure of backup
command on prmy2 channel at 04/11/2018 02:36:23 ORA-17628: Oracle
error 19505 returned by remote Oracle server continuing other job
steps, job failed will not be re-run channel prmy2: starting datafile
copy
input datafile file number=00018
name=/opt/oradata/ARPISDEV/ar_work01.dbf RMAN-03009: failure of backup
command on prmy3 channel at 04/11/2018 02:36:23 ORA-17628: Oracle
error 19505 returned by remote Oracle server continuing other job
steps, job failed will not be re-run channel prmy3: starting datafile
copy
input datafile file number=00001
name=/opt/oradata/ARPISDEV/system01.dbf RMAN-03009: failure of backup
command on prmy1 channel at 04/11/2018 02:36:23 ORA-17628: Oracle
error 19505 returned by remote Oracle server continuing other job
steps, job failed will not be re-run channel prmy1: starting datafile
copy
input datafile file number=00002
name=/opt/oradata/ARPISDEV/sysaux01.dbf RMAN-03009: failure of backup
command on prmy2 channel at 04/11/2018 02:36:24 ORA-17628: Oracle
error 19505 returned by remote Oracle server continuing other job
steps, job failed will not be re-run channel prmy2: starting datafile
copy
input datafile file number=00005 name=/redo/logs/redo05.log
RMAN-03009: failure of backup command on prmy4 channel at 04/11/2018
02:36:24 ORA-17628: Oracle error 19505 returned by remote Oracle
server continuing other job steps, job failed will not be re-run
channel prmy4: starting datafile copy
input datafile file number=00006 name=/redo/logs/redo04.log
RMAN-03009: failure of backup command on prmy1 channel at 04/11/2018
02:36:24 ORA-17628: Oracle error 19505 returned by remote Oracle
server continuing other job steps, job failed will not be re-run
channel prmy1: starting datafile copy
input datafile file number=00007 name=/redo/logs/redo03.log
RMAN-03009: failure of backup command on prmy3 channel at 04/11/2018
02:36:24 ORA-17628: Oracle error 19505 returned by remote Oracle
server continuing other job steps, job failed will not be re-run
channel prmy3: starting datafile copy
input datafile file number=00008 name=/redo/logs/redo02.log output
file name=/redo/logs/redo05.log tag=TAG20180411T023622 channel prmy2:
datafile copy complete, elapsed time: 00:00:03 channel prmy2: starting
datafile copy
input datafile file number=00009 name=/redo/logs/redo01.log output
file name=/redo/logs/redo03.log tag=TAG20180411T023622 channel prmy1:
datafile copy complete, elapsed time: 00:00:04 channel prmy1: starting
datafile copy
input datafile file number=00003
name=/opt/oradata/ARPISDEV/undotbs01.dbf output file
name=/redo/logs/redo02.log tag=TAG20180411T023622 channel prmy3:
datafile copy complete, elapsed time: 00:00:04 channel prmy3: starting
datafile copy
input datafile file number=00004
name=/opt/oradata/ARPISDEV/users01.dbf output file
name=/redo/logs/redo04.log tag=TAG20180411T023622 channel prmy4:
datafile copy complete, elapsed time: 00:00:04
RMAN-03009: failure of backup command on prmy1 channel at 04/11/2018
02:36:28 ORA-17628: Oracle error 19505 returned by remote Oracle
server continuing other job steps, job failed will not be re-run
RMAN-03009: failure of backup command on prmy3 channel at 04/11/2018
02:36:29 ORA-17628: Oracle error 19505 returned by remote Oracle
server continuing other job steps, job failed will not be re-run
output file name=/redo/logs/redo01.log tag=TAG20180411T023622 channel
prmy2: datafile copy complete, elapsed time: 00:00:03 released
channel: prmy1 released channel: prmy2 released channel: prmy3
released channel: prmy4 released channel: stby RMAN-00571:
=========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
=============== RMAN-00571: =========================================================== RMAN-03002: failure of Duplicate Db command at 04/11/2018 02:36:30
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on prmy1 channel at 04/11/2018
02:36:23 ORA-17628: Oracle error 19505 returned by remote Oracle
server
RMAN-03009: failure of backup command on prmy2 channel at 04/11/2018
02:36:24 ORA-17628: Oracle error 19505 returned by remote Oracle
server
RMAN-03009: failure of backup command on prmy4 channel at 04/11/2018
02:36:24 ORA-17628: Oracle error 19505 returned by remote Oracle
server
RMAN-03009: failure of backup command on prmy3 channel at 04/11/2018
02:36:23 ORA-17628: Oracle error 19505 returned by remote Oracle
server
RMAN-03009: failure of backup command on prmy2 channel at 04/11/2018
02:36:23 ORA-17628: Oracle error 19505 returned by remote Oracle
server
RMAN-03009: failure of backup command on prmy1 channel at 04/11/2018
02:36:23 ORA-17628: Oracle error 19505 returned by remote Oracle
server
RMAN-03009: failure of backup command on prmy4 channel at 04/11/2018
02:36:23 ORA-17628: Oracle error 19505 returned by remote Oracle
server
RMAN-03009: failure of backup command on prmy3 channel at 04/11/2018
02:36:23 ORA-17628: Oracle error 19505 returned by remote Oracle
server
RMAN-03009: failure of backup command on prmy2 channel at 04/11/2018
02:36:23 ORA-17628: Oracle error 19505 returned by remote Oracle
server
RMAN-03009: failure of backup command on prmy1 channel at 04/11/2018
02:36:23 ORA-17628: Oracle error 19505 returned by remote Oracle
server
RMAN-03009: failure of backup command on prmy3 channel at 04/11/2018
02:36:29 ORA-17628: Oracle error 19505 returned by remote Oracle
server
RMAN-03009: failure of backup command on prmy1 channel at 04/11/2018
02:36:28 ORA-17628: Oracle error 19505 returned by remote Oracle
server
RMAN-03009: failure of backup command on prmy1 channel at 04/11/2018
02:36:24 ORA-17628: Oracle error 19505 returned by remote Oracle
server
RMAN-03009: failure of backup command on prmy3 channel at 04/11/2018
02:36:24 ORA-17628: Oracle error 19505 returned by remote Oracle
server`
RMAN> end-of-file
please help to solve this problem
There was former copy of the database files under the same location where the duplicate is restoring. Files with the same name as well.
The datafiles under /opt/oradata/ARPISDEV on the standby already exist from previous database in this case.
Delete the old datafiles from previous database under the location
/opt/oradata/ARPISDEV where you trying to restore the database.

Restoring from Oracle RMAN backup fails about 60% of the time (noarchivelog mode)

I have a strange case where restoring a recently created Oracle RMAN backup sometimes works and at other times does not.
We use Oracle 12c. The database is running in noarchivelog mode.
Full story: We have a large CI setup, where a node can pick up a job, build itself from the repo and run tests. For some of the tests a database build is required. To speed the tests up we
First attempt to restore the database from the backup.
If that fails we then drop the database rebuild the shell and the data. Re-create the backup and then start the tests.
The idea of course is that most of the time restore will work, in reality restore works about 40% of the time, and at other times it fails and the database is rebuild. There does not seem to be any correlation between this happening and individual nodes, it works one time and then does not work.
We use the following script to backup
rman target=/ << EOF
RUN {
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
BACKUP DATABASE;
}
EXIT;
EOF
and the following to restore
rman target=/ << EOF
RUN {
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;
}
EXIT;
EOF
When things go badly it happens on the RECOVER step.
The errors are not always the same. Below are a few that I've seen
This one seems to be the most frequent recently
04:23:10 channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
04:23:10 Finished restore at 06-02-2017 04:23:10
04:23:10
04:23:10 Starting recover at 06-02-2017 04:23:10
04:23:10 using channel ORA_DISK_1
04:23:11
04:23:11 starting media recovery
04:23:11
04:23:11 archived log for thread 1 with sequence 52 is already on disk as file /oracle/oradata/DB1/redoDB11.log
04:23:11 archived log for thread 1 with sequence 53 is already on disk as file /oracle/oradata/DB1/redoDB12.log
04:23:11 archived log for thread 1 with sequence 54 is already on disk as file /oracle/oradata/DB1/redoDB13.log
04:23:11 RMAN-08187: WARNING: media recovery until SCN 1662458 complete
04:23:11 Finished recover at 06-02-2017 04:23:11
04:23:11
04:23:15 RMAN-00571: ===========================================================
04:23:15 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
04:23:15 RMAN-00571: ===========================================================
04:23:15 RMAN-03002: failure of sql statement command at 02/06/2017 04:23:14
04:23:15 ORA-01147: SYSTEM tablespace file 1 is offline
04:23:15 ORA-01110: data file 1: '/oracle/oradata/DB1/DB1_system.dbf'
04:23:15
04:23:15 RMAN>
04:23:15
04:23:15 Recovery Manager complete.
Another error
09:49:17 Finished restore at 27-01-2017 09:49:14
09:49:17
09:49:17 Starting recover at 27-01-2017 09:49:14
09:49:17 using channel ORA_DISK_1
09:49:17
09:49:17 starting media recovery
09:49:17
09:49:17 archived log for thread 1 with sequence 52 is already on disk as file /oracle/oradata/DB1/redoDB11.log
09:49:17 archived log for thread 1 with sequence 53 is already on disk as file /oracle/oradata/DB1/redoDB12.log
09:49:17 archived log for thread 1 with sequence 54 is already on disk as file /oracle/oradata/DB1/redoDB13.log
09:49:17 RMAN-08187: WARNING: media recovery until SCN 1755105 complete
09:49:17 Finished recover at 27-01-2017 09:49:15
09:49:17
09:49:17 RMAN-00571: ===========================================================
09:49:17 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
09:49:17 RMAN-00571: ===========================================================
09:49:17 RMAN-03002: failure of sql statement command at 01/27/2017 09:49:16
09:49:17 ORA-01147: SYSTEM tablespace file 1 is offline
09:49:17 ORA-01110: data file 1: '/oracle/oradata/DB1/DB1_system.dbf'
09:49:17
09:49:17 RMAN>
And one more
11:17:55 starting media recovery
11:17:55 media recovery failed
11:17:55 RMAN-00571: ===========================================================
11:17:55 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
11:17:55 RMAN-00571: ===========================================================
11:17:55 RMAN-03002: failure of recover command at 01/27/2017 11:17:55
11:17:55 ORA-00283: recovery session canceled due to errors
11:17:55 RMAN-11003: failure during parse/execution of SQL statement: alter database recover if needed
11:17:55 start until cancel
11:17:55 ORA-00283: recovery session canceled due to errors
11:17:55 ORA-16433: The database or pluggable database must be opened in read/write mode.
11:17:55
11:17:55 RMAN>
And another which is different from the above three, this one fails on RESTORE
09:14:11 Starting restore at 06-02-2017 09:14:11
09:14:11 allocated channel: ORA_DISK_1
09:14:11 channel ORA_DISK_1: SID=12 device type=DISK
09:14:12
09:14:12 creating datafile file number=1 name=/oracle/oradata/DB1/DB1_system.dbf
09:14:12 RMAN-00571: ===========================================================
09:14:12 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
09:14:12 RMAN-00571: ===========================================================
09:14:12 RMAN-03002: failure of restore command at 02/06/2017 09:14:12
09:14:12 ORA-01180: can not create datafile 1
09:14:12 ORA-01110: data file 1: '/oracle/oradata/DB1/DB1_system.dbf'
09:14:12
09:14:12 RMAN>
Any help would be much appreciated. Thank you!
In order to understand why you are getting errors, it is important to understand what each one of those pieces mean from your script:
RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;
RESTORE DATABASE; copies the datafiles from your backup set back out to your database location. If the database was shutdown and consistent (was shutdown cleanly) when the backup was taken, then your backup is consistent.
RECOVER DATABASE; first attempts to make your backup consistent by applying backup archived redo logs, archived redo logs, and/or redo logs. Then, it will attempt to roll your database forward from the backup point in time until the most recent redo log. Since you are running in NOARCHIVELOG mode, this step will only produce errors like the ones you are seeing.
ALTER DATABASE OPEN RESETLOGS; brings your database on-line. RESETLOGS clears the redo logs and it is needed after an incomplete recovery (if the database couldn't roll forward and apply all of the redo from the backup archived logs, archived logs, and redo logs).
With this in mind, your script should look like the following:
RUN {
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
RESTORE DATABASE;
ALTER DATABASE OPEN RESETLOGS;
}
As a side note, you should also configure an spfile+controlfile autobackup from RMAN. This backup is automatically taken whenever you backup your database.
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F';
As JSapkoka said, you should also restore the spfile and controlfile first as well, which, the full restore script would look something like:
RUN {
SHUTDOWN IMMEDIATE;
STARTUP NOMOUNT;
SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'autobackup_format';
RESTORE SPFILE FROM AUTOBACKUP;
SHUTDOWN IMMEDIATE;
STARTUP NOMOUNT;
RESTORE CONTROLFILE FROM AUTOBACKUP;
ALTER DATABASE MOUNT;
RESTORE DATABASE;
ALTER DATABASE OPEN RESETLOGS;
}

Error when running Hive

Can any one suggest me why the following error is occurring and how to resolve it??
Not only the below command, running any command related to Hive is returning the same..
hive> show databases;
FAILED: Error in metadata: MetaException(message:Got exception: org.apache.thrif
t.transport.TTransportException java.net.SocketException: Connection reset by pe
er: socket write error)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTa
sk
Check out your hive-site.xml. It is possible your javax.jdo.option.ConnectionURL, the URL for the Hive metastore, isn't right.

Resources