Home » RDBMS Server » Backup & Recovery » incremental rman backups (merged) (11.2, windows 2003)
incremental rman backups (merged) [message #569206] Mon, 22 October 2012 13:36 Go to next message
dmarcus48
Messages: 44
Registered: May 2008
Location: Central NJ
Member
I've got a question. Can you take an incremental backup level 1 or level 0 WITHOUT archivelogs?

syntax would be

backup as compressed backupset cummulative level 1 database.

The reason I ask is because when I run


backup as compressed backupset cummulative level 1 database plus archivelogs # it runs fine, but when I run


backup as compressed backupset cummulative level 1 database it just hangs.

So I ask the question

TIA

Dave
Re: incremental rman backups [message #569216 is a reply to message #569206] Tue, 23 October 2012 01:03 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Yes, you can but your database must be closed (that is in mount state).

Regards
Michel
Re: incremental rman backups [message #569239 is a reply to message #569216] Tue, 23 October 2012 07:18 Go to previous messageGo to next message
dmarcus48
Messages: 44
Registered: May 2008
Location: Central NJ
Member
OK, Thanks, that might be it, this is my entire script, you can see that I'm NOT in mount state. I'll modify and let you know, thanks again.

connect target /@orcl
connect catalog rman/pw@catdb
RUN
{
sql 'alter session set nls_date_format="DD-MON-YYYY HH24:MI:SS"';
crosscheck backup;
delete noprompt obsolete;
delete noprompt expired backup;
sql 'alter system archive log current';
allocate channel c1 device type disk format 'F:\oracle\admin\orcl\backup\%U';
backup AS COMPRESSED BACKUPSET incremental level 1 cumulative database;
backup current controlfile;
restore validate database;
}

list backup summary;
list backupset;
list backup of controlfile;

exit;
Rman incremental without including archive logs?? Possible? [message #569318 is a reply to message #569206] Wed, 24 October 2012 13:00 Go to previous messageGo to next message
dmarcus48
Messages: 44
Registered: May 2008
Location: Central NJ
Member
Number 1, I'm not sure this can be done. I'm being asked to create backups in this manner:
Level 0
Level 1
ARCHIVELOGS

I've go just the archive logs to work fine, but am having problems with the level 0 and level 1, here's the ctl file:

connect target /@ORCL
RUN
{
sql 'alter session set nls_date_format="DD-MON-YYYY HH24:MI:SS"';
crosscheck backup;
delete noprompt obsolete;
delete noprompt expired backup;
sql 'alter system archive log current';
shutdown immediate;
startup mount;
allocate channel c1 device type disk format 'UNCPATH\ORCL\FULL\%U';
backup AS COMPRESSED BACKUPSET incremental level 0 cumulative database;
backup current controlfile;
sql 'alter database open';
restore validate database;
}

list backup summary;
list backupset;
list backup of controlfile;

exit;


Like I said I'm not sure this can be done, in the past we've always done it like this:

backup AS COMPRESSED BACKUPSET incremental level 0 cumulative database plus archivelog delete input;

But now I'm being asked to separate the archivelogs out (WHY? I don't know).

Is it possible to take an incremental backup without including the archivelogs????

This is the output from the logfile:

RMAN> connect target *
2>
3> RUN
4> {
5> sql 'alter session set nls_date_format="DD-MON-YYYY HH24:MI:SS"';
6> crosscheck backup;
7> delete noprompt obsolete;
8> delete noprompt expired backup;
9> sql 'alter system archive log current';
10> shutdown immediate;
11> startup mount;
12> allocate channel c1 device type disk format '\\UNCPATH\data\ORCL\INCR\%U';
13> backup AS COMPRESSED BACKUPSET incremental level 1 cumulative database;
14> backup current controlfile;
15> restore validate database;
16> }
17>
18> list backup summary;
19> list backupset;
20> list backup of controlfile;
21>
22> exit;


sql statement: alter system archive log current

database closed
database dismounted
Oracle instance shut down

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area 1071333376 bytes

Fixed Size 1348508 bytes
Variable Size 704646244 bytes
Database Buffers 360710144 bytes
Redo Buffers 4628480 bytes

allocated channel: c1
channel c1: SID=211 device type=DISK

Starting backup at 24-OCT-2012 13:43:53

That's it, it comes back to dos at this point.

TIA

Dave

[Updated on: Wed, 24 October 2012 13:06]

Report message to a moderator

Re: incremental rman backups [message #569319 is a reply to message #569239] Wed, 24 October 2012 13:03 Go to previous messageGo to next message
dmarcus48
Messages: 44
Registered: May 2008
Location: Central NJ
Member
I created a new thread, asking whether it's possible to do an incremental backup without including the archive logs.
Re: incremental rman backups [message #569324 is a reply to message #569319] Wed, 24 October 2012 14:28 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Why did you create a new topic for the same question?
I merge both.

Regards
Michel

[Updated on: Wed, 24 October 2012 14:29]

Report message to a moderator

Re: incremental rman backups [message #569326 is a reply to message #569324] Wed, 24 October 2012 14:33 Go to previous messageGo to next message
dmarcus48
Messages: 44
Registered: May 2008
Location: Central NJ
Member
Thanks for the merge. I don't know, I thought it was a new topic, but it really wasn't.

What I've got is a batch file that will allow for input as to the type of rman backup.

It works if I format the backup like this:

backup AS COMPRESSED BACKUPSET level 1 cumulative database plus archivelog;

Doesn't work if I put this:

backup AS COMPRESSED BACKUPSET level 1 cumulative database;

This is with a shutdown immediate and a startup mount on both. Plus archivelog works, without it, doesn't work.

Thanks again,

Dave

Re: incremental rman backups [message #569344 is a reply to message #569326] Thu, 25 October 2012 01:34 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
It works for me (truncating the end of long lines):
RMAN> RUN {
2>  sql 'alter system archive log current';
3>  shutdown immediate;
4>  startup mount;
5>  backup AS COMPRESSED BACKUPSET incremental level 1 cumulative database;
6>  backup current controlfile;
7>  restore validate database;
8> }

sql statement: alter system archive log current

database closed
database dismounted
Oracle instance shut down

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area     314572800 bytes

Fixed Size                     1303020 bytes
Variable Size                 96472596 bytes
Database Buffers             209715200 bytes
Redo Buffers                   7081984 bytes

Starting backup at 25/10/2012 08:29:16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=541 devtype=DISK
channel ORA_DISK_1: starting compressed incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=C:\ORACLE\BASES\MIKA\SYSTEM01.DBF
input datafile fno=00002 name=C:\ORACLE\BASES\MIKA\UNDOTBS01.DBF
input datafile fno=00003 name=C:\ORACLE\BASES\MIKA\SYSAUX01.DBF
input datafile fno=00006 name=C:\ORACLE\BASES\MIKA\ORAFAQ01.DBF
input datafile fno=00004 name=C:\ORACLE\BASES\MIKA\TS_D0101.DBF
input datafile fno=00005 name=C:\ORACLE\BASES\MIKA\TS_I0101.DBF
channel ORA_DISK_1: starting piece 1 at 25/10/2012 08:29:19
channel ORA_DISK_1: finished piece 1 at 25/10/2012 08:31:14
piece handle=C:\ORACLE\FLASH\MIKA\MIKA\BACKUPSET\2012_10_25\O1_MF_NNND1_TAG20121025T082918_88K...
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:55
channel ORA_DISK_1: starting compressed incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 25/10/2012 08:31:16
channel ORA_DISK_1: finished piece 1 at 25/10/2012 08:31:17
piece handle=C:\ORACLE\FLASH\MIKA\MIKA\BACKUPSET\2012_10_25\O1_MF_NCNN1_TAG20121025T082918_88K...
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 25/10/2012 08:31:17

Starting backup at 25/10/2012 08:31:18
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 25/10/2012 08:31:21
channel ORA_DISK_1: finished piece 1 at 25/10/2012 08:31:24
piece handle=C:\ORACLE\FLASH\MIKA\MIKA\BACKUPSET\2012_10_25\O1_MF_NCNNF_TAG20121025T083119_88K...
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:05
Finished backup at 25/10/2012 08:31:24

Starting restore at 25/10/2012 08:31:24
using channel ORA_DISK_1

channel ORA_DISK_1: starting validation of datafile backupset
channel ORA_DISK_1: reading from backup piece C:\ORACLE\FLASH\MIKA\MIKA\BACKUPSET\2012_10_25\O...
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\ORACLE\FLASH\MIKA\MIKA\BACKUPSET\2012_10_25\O1_MF_NNND0_TAG20121025T082647_88K47
channel ORA_DISK_1: validation complete, elapsed time: 00:00:37
Finished restore at 25/10/2012 08:32:02

Regards
Michel
Re: incremental rman backups [message #569352 is a reply to message #569326] Thu, 25 October 2012 03:49 Go to previous messageGo to next message
John Watson
Messages: 8960
Registered: January 2010
Location: Global Village
Senior Member
Dave, I don't understand what is going on. You say this,Quote:
It works if I format the backup like this:

backup AS COMPRESSED BACKUPSET level 1 cumulative database plus archivelog;

Doesn't work if I put this:

backup AS COMPRESSED BACKUPSET level 1 cumulative database;
but those are both syntactically wrong:
RMAN> backup AS COMPRESSED BACKUPSET level 1 cumulative database;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "level": expecting one of: "archivelog, as, auxiliary, backu
y, cumulative, current, database, datafilecopy, datafile, db_file_name_convert, db_recovery_
, format, for, from, full, incremental, keep, maxsetsize, nochecksum, noexclude, nokeep, not
ip, spfile, tablespace, tag, to, validate, ("
RMAN-01007: at line 1 column 32 file: standard input

RMAN> backup AS COMPRESSED BACKUPSET level 1 cumulative database plus archivelog;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "level": expecting one of: "archivelog, as, auxiliary, backu
y, cumulative, current, database, datafilecopy, datafile, db_file_name_convert, db_recovery_
, format, for, from, full, incremental, keep, maxsetsize, nochecksum, noexclude, nokeep, not
ip, spfile, tablespace, tag, to, validate, ("
RMAN-01007: at line 1 column 32 file: standard input

RMAN>
what are you actually trying to achieve? You can do an incremental level 1 backup of a database that is in archivelog mode, whether it is open or mounted. You would want the archivelogs too, but you can back them up whenever you want. A noarchivelog mode database can be incrementally backed up only if it is mounted.
Re: incremental rman backups [message #569359 is a reply to message #569352] Thu, 25 October 2012 04:22 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
To specify: I recommended him to put the database in mount mode during the backup if he want to have a consistent and recoverable backup after the incremental without archived logs.

Regards
Michel
Re: incremental rman backups [message #569379 is a reply to message #569352] Thu, 25 October 2012 07:31 Go to previous messageGo to next message
dmarcus48
Messages: 44
Registered: May 2008
Location: Central NJ
Member
First of all, thanks for the replies, I do appreciate them. I do know rman and have always used backup as compressed backupset database plus archivelog delete input. The company I'm working for has asked us to change the way we do our backups to comply with the way that they do backups. They want us to take the archivelog backups separately, and to do incremental backups (level 1 and level 0 (on Sunday)), additionally the backups are going across the network to a UNC address. The UNC address hasn't given me any problems.

Below John said that my syntax is off, "backup AS COMPRESSED BACKUPSET level 1 cumulative database plus archivelog;", all I can say is that it works for me. The other example "backup AS COMPRESSED BACKUPSET level 1 cumulative database", does not work, but does not give a syntax error, it just says in the log that the backup has started and never comes back (goes off into the night).

Also my manager has asked that I write a script for the backups that will use input variables, one script for all backups. I've written that, the archivelogs work fine, as do the backups when I include the archivelogs, but not when I don't.

My main question is "can you do a incremental backup without including the archivelogs??" It doesn't seem so, I've tried it including the shutdown immediate and startup mount, and I get the same results.

TIA

Dave
Re: incremental rman backups [message #569380 is a reply to message #569379] Thu, 25 October 2012 07:39 Go to previous messageGo to next message
John Watson
Messages: 8960
Registered: January 2010
Location: Global Village
Senior Member
Man, your code does not work. Again:
c:\users\john\home>rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Thu Oct 25 13:36:02 2012

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

connected to target database: ORCL (DBID=1324534707)

RMAN> backup AS COMPRESSED BACKUPSET level 1 cumulative database plus archivelog;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "level": expecting one of: "archivelog, as, auxiliary, backu
y, cumulative, current, database, datafilecopy, datafile, db_file_name_convert, db_recovery_
, format, for, from, full, incremental, keep, maxsetsize, nochecksum, noexclude, nokeep, not
ip, spfile, tablespace, tag, to, validate, ("
RMAN-01007: at line 1 column 32 file: standard input

RMAN> 

What I think you are trying to do is this,
RMAN> backup AS COMPRESSED BACKUPSET incremental level 1 cumulative database;

Starting backup at 25-OCT-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=9 device type=DISK
channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=C:\APP\JOHN\ORADATA\ORCL\DATAFILE\O1_MF_SYSTE
input datafile file number=00002 name=C:\APP\JOHN\ORADATA\ORCL\DATAFILE\O1_MF_SYSAU
input datafile file number=00003 name=C:\APP\JOHN\ORADATA\ORCL\DATAFILE\O1_MF_UNDOT
input datafile file number=00004 name=C:\APP\JOHN\ORADATA\ORCL\DATAFILE\O1_MF_USERS
channel ORA_DISK_1: starting piece 1 at 25-OCT-12
channel ORA_DISK_1: finished piece 1 at 25-OCT-12
piece handle=C:\APP\JOHN\FAST_RECOVERY_AREA\ORCL\BACKUPSET\2012_10_25\O1_MF_NNND1_T

channel ORA_DISK_1: backup set complete, elapsed time: 00:01:56
channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 25-OCT-12
channel ORA_DISK_1: finished piece 1 at 25-OCT-12
piece handle=C:\APP\JOHN\FAST_RECOVERY_AREA\ORCL\BACKUPSET\2012_10_25\O1_MF_NCSN1_T

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 25-OCT-12
which does work. Without the archive logs.


Re: incremental rman backups [message #569381 is a reply to message #569380] Thu, 25 October 2012 08:00 Go to previous messageGo to next message
dmarcus48
Messages: 44
Registered: May 2008
Location: Central NJ
Member
John, it works for me:

RMAN> connect target *
2>
3> RUN
4> {
5> sql 'alter session set nls_date_format="DD-MON-YYYY HH24:MI:SS"';
6> crosscheck backup;
7> delete noprompt obsolete;
8> delete noprompt expired backup;
9> delete noprompt expired archivelog all;
10> sql 'alter system archive log current';
11> shutdown immediate;
12> startup mount;
13> allocate channel c1 device type disk format '\\UNCPATH\ORCL\INCR\%U';
14> backup AS COMPRESSED BACKUPSET incremental level 1 cumulative database plus archivelog;
15> backup current controlfile;
16> restore validate database;
17> }
18>
19> list backup summary;
20> list backupset;
21> list backup of controlfile;
22> sql 'alter database open';
23>
24> exit;
connected to target database: ORCL (DBID=2284424868)

using target database control file instead of recovery catalog
sql statement: alter session set nls_date_format="DD-MON-YYYY HH24:MI:SS"

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=194 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=193 device type=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=F:\ORACLE\ADMIN\ORCL\BACKUP\B9NO2H27_1_1 RECID=439 STAMP=797000775
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=F:\ORACLE\ADMIN\ORCL\BACKUP\BMNO2M3L_1_1 RECID=452 STAMP=797005941
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=F:\ORACLE\ADMIN\ORCL\BACKUP\BNNO2M3N_1_1 RECID=453 STAMP=797005943
crosschecked backup piece: found to be 'AVAILABLE'

Further on it does the crosscheck then the startup mount then:

tarting backup at 24-OCT-2012 15:41:28
channel c1: starting compressed incremental level 1 datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00002 name=E:\ORADATA\ORCL\SYSAUX.DBF
input datafile file number=00001 name=E:\ORADATA\ORCL\SYSTEM.DBF
input datafile file number=00003 name=E:\ORADATA\ORCL\UNDOTBS1.DBF
input datafile file number=00005 name=E:\ORADATA\ORCL\ECTD_DATA.DBF
input datafile file number=00006 name=E:\ORADATA\ORCL\ECTD_INDEX.DBF
input datafile file number=00004 name=E:\ORADATA\ORCL\USERS.DBF
channel c1: starting piece 1 at 24-OCT-2012 15:41:28
channel c1: finished piece 1 at 24-OCT-2012 15:41:43
piece handle=\\UNCPATH\DATA\ORCL\INCR\D2NOIKD8_1_1 tag=TAG20121024T154128 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:15
Finished backup at 24-OCT-2012 15:41:43

Dave
Re: incremental rman backups [message #569382 is a reply to message #569381] Thu, 25 October 2012 08:01 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Please read How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags.
Use the "Preview Message" button to verify.

Regards
Michel
Re: incremental rman backups [message #569383 is a reply to message #569381] Thu, 25 October 2012 08:02 Go to previous messageGo to next message
John Watson
Messages: 8960
Registered: January 2010
Location: Global Village
Senior Member
Dave, that works because line 14 of your script includes the keyword INCREMENTAL which was not in your earlier posts.
So are you now happy with the fact that you can do incremental backups without including the archivelogs? As I demonstrated?
Re: incremental rman backups [message #569385 is a reply to message #569383] Thu, 25 October 2012 08:06 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
As I demonstrated?


As we demonstrated. Wink

Regards
Michel
Re: incremental rman backups [message #569386 is a reply to message #569383] Thu, 25 October 2012 08:08 Go to previous messageGo to next message
dmarcus48
Messages: 44
Registered: May 2008
Location: Central NJ
Member
The earlier post do have the incremental key work, there's a couple of posts from weds that I typed rather then copy and pasted that don't have it. My mistake, forgive me.

Dave
Re: incremental rman backups [message #569391 is a reply to message #569386] Thu, 25 October 2012 09:17 Go to previous messageGo to next message
dmarcus48
Messages: 44
Registered: May 2008
Location: Central NJ
Member
I thought I had it, I tried:

backup incremental level 0 cumulative as compressed backupset database;

It works when I run it from an rman session (logging into rman target /), but it doesn't work when I run it in a script.
Re: incremental rman backups [message #569394 is a reply to message #569391] Thu, 25 October 2012 10:27 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Post (copy and paste) what you do and get as we did it (that is formatted), this is the only way to know.

Regards
Michel
Re: incremental rman backups [message #569401 is a reply to message #569394] Thu, 25 October 2012 11:44 Go to previous messageGo to next message
dmarcus48
Messages: 44
Registered: May 2008
Location: Central NJ
Member
OK It works!!!!!!!!!!!

This is from the log:

RMAN> connect target *
2> #connect to catalog
3> RUN
4> {
5> sql 'alter session set nls_date_format="DD-MON-YYYY HH24:MI:SS"';
6> crosscheck backup;
7> delete noprompt obsolete;
8> delete noprompt expired backup;
9> delete noprompt expired archivelog all;
10> sql 'alter system archive log current';
11> allocate channel c1 device type disk format 'E:\Oracle\admin\ORCL\backup\%U'; 
12> backup incremental level 0 cumulative as compressed backupset database;
13> backup current controlfile;
14> restore validate database;
15> }
16> 
17> list backup summary;
18> list backupset;
19> list backup of controlfile;
20> 
21> exit;



I ran this and it worked!!

Thanks for all your help!!!

Dave

[Updated on: Thu, 25 October 2012 12:22] by Moderator

Report message to a moderator

Re: incremental rman backups [message #569403 is a reply to message #569401] Thu, 25 October 2012 12:21 Go to previous message
John Watson
Messages: 8960
Registered: January 2010
Location: Global Village
Senior Member
Whoopee!
I'll even add [code] tags to your last post, so that you can see how things should be formatted.

btw, I see that you are in NJ. I've had to make a few trips there in the last year or two, usually Jersey City but a couple of times to other places. I remember having dreadful trouble trying to buy a bottle of beer.

Glad we could help.
Previous Topic: We got a trouble with catalog
Next Topic: Need options for standby DB
Goto Forum:
  


Current Time: Tue Nov 26 22:14:17 CST 2024