Re: Taking Backup from standby database

  • From: Mladen Gogala <gogala.mladen@xxxxxxxxx>
  • To: Vadim Keylis <vkeylis2009@xxxxxxxxx>
  • Date: Fri, 2 Dec 2016 21:05:49 -0500

So, let's see:

oracle@oracle11 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Dec 2 20:27:40 2016

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select status from v$instance;

STATUS

------------

MOUNTED

SQL> select database_role from v$database;

DATABASE_ROLE

----------------

PHYSICAL STANDBY

SQL>

[oracle@oracle11 admin]$ rman target / catalog rman/rman@rcat

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Dec 2 20:40:59 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: ORCL (DBID=1451996157, not open)

connected to recovery catalog database

RMAN>

RMAN> run {

2> allocate channel c0 device type SBT parms="SBT_LIBRARY=/opt/commvault/Base/libobk.so,BLKSIZE=1048576";

3> backup archivelog all delete input;

4> }

allocated channel: c0

channel c0: SID=21 device type=SBT_TAPE

channel c0: CommVault Systems for Oracle: Version 11.0.0(BUILD80)

Starting backup at 02-DEC-16

RMAN-06820: WARNING: failed to archive current log at primary database

ORACLE error from target database:

ORA-17629: Cannot connect to the remote database server

ORA-17627: ORA-00942: table or view does not exist

channel c0: starting archived log backup set

channel c0: specifying archived log(s) in backup set

input archived log thread=1 sequence=177 RECID=664 STAMP=929565437

channel c0: starting piece 1 at 02-DEC-16

channel c0: finished piece 1 at 02-DEC-16

piece handle=43rmg2sn_1_1 tag=TAG20161202T203951 comment=API Version 2.0,MMS Version 11.0.0.80

channel c0: backup set complete, elapsed time: 00:00:25

channel c0: deleting archived log(s)

RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process

archived log file name=/oradata/ORCL/fra/STANDBY/archivelog/2016_12_02/o1_mf_1_177_d448gfmh_.arc thread=1 sequence=177

Finished backup at 02-DEC-16

Starting Control File and SPFILE Autobackup at 02-DEC-16

piece handle=c-1451996157-20161202-01 comment=API Version 2.0,MMS Version 11.0.0.80

Finished Control File and SPFILE Autobackup at 02-DEC-16

released channel: c0



This is only a warning. Backup completes normally. My guess why it doesn't complete in your case is that there is a configuration problem. However, the whole story is a bug:

Bug 17580082 ACTIVE STANDBY RMAN06820: WARNING: FAILED TO ARCHIVE CURRENT LOG AT PRIMARY

WORKAROUND:
Do not use operating system authentication to login with RMAN. Use a username and password.

(For more details see Doc ID: 1616074.1)

[oracle@oracle11 admin]$ rman target sys@stby catalog rman/rman@rcat

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Dec 2 20:44:48 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

target database Password:

connected to target database: ORCL (DBID=1451996157, not open)

connected to recovery catalog database

RMAN> run {

2> allocate channel c0 device type SBT parms="SBT_LIBRARY=/opt/commvault/Base/libobk.so,BLKSIZE=1048576";

3> backup archivelog all delete input;

4> }

allocated channel: c0

channel c0: SID=9 device type=SBT_TAPE

channel c0: CommVault Systems for Oracle: Version 11.0.0(BUILD80)

Starting backup at 02-DEC-16

current log archived at primary database

channel c0: starting archived log backup set

channel c0: specifying archived log(s) in backup set

input archived log thread=1 sequence=177 RECID=664 STAMP=929565437

input archived log thread=1 sequence=178 RECID=665 STAMP=929565737

input archived log thread=1 sequence=179 RECID=666 STAMP=929565841

input archived log thread=1 sequence=180 RECID=667 STAMP=929565845

input archived log thread=1 sequence=181 RECID=668 STAMP=929565848

input archived log thread=1 sequence=182 RECID=669 STAMP=929565908

channel c0: starting piece 1 at 02-DEC-16

channel c0: finished piece 1 at 02-DEC-16

piece handle=45rmg36m_1_1 tag=TAG20161202T204510 comment=API Version 2.0,MMS Version 11.0.0.80

channel c0: backup set complete, elapsed time: 00:00:25

channel c0: deleting archived log(s)

archived log file name=/oradata/ORCL/fra/STANDBY/archivelog/2016_12_02/o1_mf_1_177_d448gfmh_.arc RECID=664 STAMP=929565437

archived log file name=/oradata/ORCL/fra/STANDBY/archivelog/2016_12_02/o1_mf_1_178_d448qs5c_.arc RECID=665 STAMP=929565737

archived log file name=/oradata/ORCL/fra/STANDBY/archivelog/2016_12_02/o1_mf_1_179_d448v1oh_.arc RECID=666 STAMP=929565841

archived log file name=/oradata/ORCL/fra/STANDBY/archivelog/2016_12_02/o1_mf_1_180_d448v5nh_.arc RECID=667 STAMP=929565845

archived log file name=/oradata/ORCL/fra/STANDBY/archivelog/2016_12_02/o1_mf_1_181_d448v8om_.arc RECID=668 STAMP=929565848

RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process

archived log file name=/oradata/ORCL/fra/STANDBY/archivelog/2016_12_02/o1_mf_1_182_d448x4bn_.arc thread=1 sequence=182

Finished backup at 02-DEC-16

Starting Control File and SPFILE Autobackup at 02-DEC-16

piece handle=c-1451996157-20161202-02 comment=API Version 2.0,MMS Version 11.0.0.80

Finished Control File and SPFILE Autobackup at 02-DEC-16

released channel: c0


So, your problem was with a bug, not with the script. And now, the final point:

[oracle@oracle11 admin]$ rman target sys@ora11 catalog rman/rman@rcat

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Dec 2 20:57:36 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

target database Password:

connected to target database: ORCL (DBID=1451996157)

connected to recovery catalog database

RMAN> list backup of archivelog sequence between 177 and 182 device type sbt;

List of Backup Sets

===================

BS Key  Size       Device Type Elapsed Time Completion Time

------- ---------- ----------- ------------ ---------------

19073   10.00M     SBT_TAPE    00:00:00     02-DEC-16

BP Key: 19089 Status: AVAILABLE Compressed: NO Tag: TAG20161202T203729

        Handle: 41rmg2qi_1_1   Media: V_101303_156507

  List of Archived Logs in backup set 19073

  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time

  ---- ------- ---------- --------- ---------- ---------

  1    177     2118198    02-DEC-16 2118575    02-DEC-16

BS Key  Size       Device Type Elapsed Time Completion Time

------- ---------- ----------- ------------ ---------------

19758   2.00M      SBT_TAPE    00:00:18     02-DEC-16

BP Key: 19762 Status: AVAILABLE Compressed: NO Tag: TAG20161202T203951

        Handle: 43rmg2sn_1_1   Media: V_101303_156509

  List of Archived Logs in backup set 19758

  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time

  ---- ------- ---------- --------- ---------- ---------

  1    177     2118198    02-DEC-16 2118575    02-DEC-16

BS Key  Size       Device Type Elapsed Time Completion Time

------- ---------- ----------- ------------ ---------------

19799   2.00M      SBT_TAPE    00:00:18     02-DEC-16

BP Key: 19803 Status: AVAILABLE Compressed: NO Tag: TAG20161202T204510

        Handle: 45rmg36m_1_1   Media: V_101303_156511

  List of Archived Logs in backup set 19799

  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time

  ---- ------- ---------- --------- ---------- ---------

  1    177     2118198    02-DEC-16 2118575    02-DEC-16

  1    178     2118575    02-DEC-16 2119258    02-DEC-16

  1    179     2119258    02-DEC-16 2119375    02-DEC-16

  1    180     2119375    02-DEC-16 2119383    02-DEC-16

  1    181     2119383    02-DEC-16 2119389    02-DEC-16

  1    182     2119389    02-DEC-16 2119456    02-DEC-16

RMAN>




I am connected to the primary database, which is visible from the RMAN, which doesn't say "not open" for the target connection. Nevertheless, the catalog sees the backup of the archive logs, as if the backup was taken on the original. I am working with Oracle backups on the daily basis and I have run into this about a year ago.
Regards


On 12/02/2016 07:31 PM, Vadim Keylis wrote:

I did. Here is there error I am getting when taking backup on standby database:

Starting backup at 02-DEC-16
RMAN-06820: WARNING: failed to archive current log at primary database
ORACLE error from target database:
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-00942: table or view does not exist


On Fri, Dec 2, 2016 at 4:13 PM, Mladen Gogala <gogala.mladen@xxxxxxxxx <mailto:gogala.mladen@xxxxxxxxx>> wrote:

    On 12/02/2016 07:08 PM, Vadim Keylis wrote:

        How do you include archive logs when backup is taken from
        standby? Executing this command on standby database "BACKUP
        INCREMENTAL LEVEL 0 TAG LEVEL_0_20161202_1550 DATABASE plus
        archivelog ;" fails

        Thanks so much in advance,
        Vadim


    Have you tried with "BACKUP ARCHIVELOG ALL DELETE INPUT"? That
    usually works for me. I am usually not particularly worried about
    tags.



-- Mladen Gogala
    Oracle DBA
    Tel: (347) 321-1217 <tel:%28347%29%20321-1217>




--
Mladen Gogala
Oracle DBA
Tel: (347) 321-1217

Other related posts: