Wednesday 31 July 2019

Catalog Database - Using RMAN Stored Scripts

We can create two type script one for local database and another for global database which is used for multiple database .
Below script example is for local script database.

[oracle@srv1 admin]$ rman target / catalog rcowner@smr2

Recovery Manager: Release 12.1.0.2.0 - Production on Wed Jul 31 17:38:18 2019

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

connected to target database: RAC (DBID=2599942250)
recovery catalog database Password:
connected to recovery catalog database

RMAN> CREATE SCRIPT FULL_DB_SCRIPT
{
BACKUP DATABASE PLUS ARCHIVELOG TAG 'FULL_DB';
}2> 3> 4>

created script FULL_DB_SCRIPT

RMAN> PRINT SCRIPT FULL_DB_SCRIPT;

printing stored script: FULL_DB_SCRIPT
{
BACKUP DATABASE PLUS ARCHIVELOG TAG 'FULL_DB';
}

RMAN> run { execute script FULL_DB_SCRIPT;}

executing script: FULL_DB_SCRIPT


Starting backup at 31-JUL-19
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=61 instance=rac1 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=364 RECID=637 STAMP=1014903677
input archived log thread=2 sequence=281 RECID=639 STAMP=1014903722
input archived log thread=1 sequence=365 RECID=638 STAMP=1014903697
input archived log thread=1 sequence=366 RECID=640 STAMP=1014903723
input archived log thread=1 sequence=367 RECID=641 STAMP=1014903754
input archived log thread=2 sequence=282 RECID=644 STAMP=1014903873
input archived log thread=1 sequence=368 RECID=642 STAMP=1014903844
input archived log thread=1 sequence=369 RECID=643 STAMP=1014903871
input archived log thread=1 sequence=370 RECID=645 STAMP=1014903890
input archived log thread=2 sequence=283 RECID=648 STAMP=1014903948
input archived log thread=1 sequence=371 RECID=646 STAMP=1014903919
input archived log thread=1 sequence=372 RECID=647 STAMP=1014903939
input archived log thread=1 sequence=373 RECID=649 STAMP=1014903961
input archived log thread=2 sequence=284 RECID=652 STAMP=1014904043
input archived log thread=1 sequence=374 RECID=650 STAMP=1014903985
input archived log thread=1 sequence=375 RECID=651 STAMP=1014904041
input archived log thread=1 sequence=376 RECID=653 STAMP=1014904141
input archived log thread=2 sequence=285 RECID=656 STAMP=1014904224
input archived log thread=1 sequence=377 RECID=654 STAMP=1014904182
input archived log thread=1 sequence=378 RECID=655 STAMP=1014904223
input archived log thread=1 sequence=379 RECID=657 STAMP=1014904253
input archived log thread=2 sequence=286 RECID=660 STAMP=1014904350
input archived log thread=1 sequence=380 RECID=658 STAMP=1014904304
input archived log thread=1 sequence=381 RECID=659 STAMP=1014904345
input archived log thread=1 sequence=382 RECID=661 STAMP=1014904424
input archived log thread=2 sequence=287 RECID=664 STAMP=1014905565
input archived log thread=1 sequence=383 RECID=662 STAMP=1014905456
input archived log thread=1 sequence=384 RECID=663 STAMP=1014905565
input archived log thread=1 sequence=385 RECID=665 STAMP=1014906442
input archived log thread=2 sequence=288 RECID=668 STAMP=1014906956
input archived log thread=1 sequence=386 RECID=666 STAMP=1014906537
input archived log thread=1 sequence=387 RECID=667 STAMP=1014906954
input archived log thread=1 sequence=388 RECID=669 STAMP=1014907047
input archived log thread=2 sequence=289 RECID=670 STAMP=1014909100
input archived log thread=1 sequence=389 RECID=672 STAMP=1014909233
input archived log thread=2 sequence=290 RECID=671 STAMP=1014909104
input archived log thread=1 sequence=390 RECID=673 STAMP=1014910300
input archived log thread=1 sequence=391 RECID=674 STAMP=1014910305
input archived log thread=2 sequence=291 RECID=677 STAMP=1014916816
input archived log thread=1 sequence=392 RECID=675 STAMP=1014910319
input archived log thread=1 sequence=393 RECID=676 STAMP=1014916806
input archived log thread=2 sequence=292 RECID=678 STAMP=1014916819
input archived log thread=1 sequence=394 RECID=681 STAMP=1014933890
input archived log thread=2 sequence=293 RECID=679 STAMP=1014933730
input archived log thread=2 sequence=294 RECID=680 STAMP=1014933888
input archived log thread=2 sequence=295 RECID=682 STAMP=1014934263
input archived log thread=1 sequence=395 RECID=685 STAMP=1014934508
input archived log thread=2 sequence=296 RECID=683 STAMP=1014934384
channel ORA_DISK_1: starting piece 1 at 31-JUL-19
channel ORA_DISK_1: finished piece 1 at 31-JUL-19
piece handle=/u01/Backup/ora_df1015094778_s185_s1 tag=FULL_DB comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:06
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=338 RECID=599 STAMP=1014901090
input archived log thread=1 sequence=339 RECID=600 STAMP=1014901094
input archived log thread=2 sequence=269 RECID=602 STAMP=1014901108
input archived log thread=1 sequence=340 RECID=601 STAMP=1014901107
input archived log thread=1 sequence=341 RECID=603 STAMP=1014901109
input archived log thread=2 sequence=270 RECID=605 STAMP=1014902881
input archived log thread=1 sequence=342 RECID=604 STAMP=1014901924
input archived log thread=1 sequence=343 RECID=606 STAMP=1014902911
input archived log thread=2 sequence=271 RECID=607 STAMP=1014902946
input archived log thread=1 sequence=344 RECID=610 STAMP=1014903008
input archived log thread=2 sequence=272 RECID=608 STAMP=1014902979
input archived log thread=2 sequence=273 RECID=609 STAMP=1014903001
input archived log thread=2 sequence=274 RECID=611 STAMP=1014903030
input archived log thread=1 sequence=345 RECID=612 STAMP=1014903103
input archived log thread=2 sequence=275 RECID=616 STAMP=1014903324
input archived log thread=1 sequence=346 RECID=613 STAMP=1014903192
input archived log thread=1 sequence=347 RECID=614 STAMP=1014903254
input archived log thread=1 sequence=348 RECID=615 STAMP=1014903321
input archived log thread=1 sequence=349 RECID=617 STAMP=1014903344
input archived log thread=2 sequence=276 RECID=620 STAMP=1014903413
input archived log thread=1 sequence=350 RECID=618 STAMP=1014903376
input archived log thread=1 sequence=351 RECID=619 STAMP=1014903407
input archived log thread=1 sequence=352 RECID=621 STAMP=1014903425
input archived log thread=2 sequence=277 RECID=624 STAMP=1014903465
input archived log thread=1 sequence=353 RECID=622 STAMP=1014903439
input archived log thread=1 sequence=354 RECID=623 STAMP=1014903463
input archived log thread=1 sequence=355 RECID=625 STAMP=1014903491
input archived log thread=2 sequence=278 RECID=628 STAMP=1014903538
input archived log thread=1 sequence=356 RECID=626 STAMP=1014903516
input archived log thread=1 sequence=357 RECID=627 STAMP=1014903536
input archived log thread=1 sequence=358 RECID=629 STAMP=1014903555
input archived log thread=2 sequence=279 RECID=632 STAMP=1014903597
input archived log thread=1 sequence=359 RECID=630 STAMP=1014903575
input archived log thread=1 sequence=360 RECID=631 STAMP=1014903597
input archived log thread=1 sequence=361 RECID=633 STAMP=1014903616
input archived log thread=2 sequence=280 RECID=636 STAMP=1014903658
input archived log thread=1 sequence=362 RECID=634 STAMP=1014903634
input archived log thread=1 sequence=363 RECID=635 STAMP=1014903656
channel ORA_DISK_1: starting piece 1 at 31-JUL-19
channel ORA_DISK_1: finished piece 1 at 31-JUL-19
piece handle=/u01/Backup/ora_df1015094906_s186_s1 tag=FULL_DB comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:55
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=2 sequence=297 RECID=684 STAMP=1014934508
input archived log thread=2 sequence=298 RECID=686 STAMP=1014934542
input archived log thread=1 sequence=396 RECID=687 STAMP=1014961778
input archived log thread=2 sequence=299 RECID=689 STAMP=1014964614
input archived log thread=1 sequence=397 RECID=688 STAMP=1014961803
input archived log thread=1 sequence=398 RECID=690 STAMP=1014981565
input archived log thread=2 sequence=300 RECID=692 STAMP=1014992440
input archived log thread=1 sequence=399 RECID=691 STAMP=1014992440
input archived log thread=1 sequence=400 RECID=693 STAMP=1014992441
input archived log thread=2 sequence=301 RECID=695 STAMP=1015020068
input archived log thread=1 sequence=401 RECID=694 STAMP=1015014608
input archived log thread=1 sequence=402 RECID=698 STAMP=1015029032
input archived log thread=2 sequence=302 RECID=696 STAMP=1015020181
input archived log thread=2 sequence=303 RECID=697 STAMP=1015029030
input archived log thread=2 sequence=304 RECID=701 STAMP=1015060459
input archived log thread=1 sequence=403 RECID=699 STAMP=1015047883
input archived log thread=1 sequence=404 RECID=700 STAMP=1015060457
input archived log thread=1 sequence=405 RECID=702 STAMP=1015070508
input archived log thread=2 sequence=305 RECID=703 STAMP=1015070515
input archived log thread=2 sequence=306 RECID=704 STAMP=1015070519
input archived log thread=1 sequence=406 RECID=705 STAMP=1015071464
input archived log thread=2 sequence=307 RECID=707 STAMP=1015083977
input archived log thread=1 sequence=407 RECID=706 STAMP=1015071465
input archived log thread=2 sequence=308 RECID=708 STAMP=1015084005
input archived log thread=2 sequence=309 RECID=709 STAMP=1015084033
input archived log thread=2 sequence=310 RECID=710 STAMP=1015084060
input archived log thread=2 sequence=311 RECID=711 STAMP=1015084083
input archived log thread=2 sequence=312 RECID=712 STAMP=1015084117
input archived log thread=2 sequence=313 RECID=713 STAMP=1015084141
input archived log thread=2 sequence=314 RECID=714 STAMP=1015084165
input archived log thread=2 sequence=315 RECID=715 STAMP=1015084187
input archived log thread=2 sequence=316 RECID=716 STAMP=1015084208
input archived log thread=2 sequence=317 RECID=717 STAMP=1015084230
input archived log thread=2 sequence=318 RECID=718 STAMP=1015084243
input archived log thread=2 sequence=319 RECID=719 STAMP=1015084330
input archived log thread=2 sequence=320 RECID=721 STAMP=1015089192
input archived log thread=1 sequence=408 RECID=720 STAMP=1015089186
input archived log thread=1 sequence=409 RECID=723 STAMP=1015090785
input archived log thread=2 sequence=321 RECID=722 STAMP=1015090782
input archived log thread=2 sequence=322 RECID=724 STAMP=1015094276
input archived log thread=1 sequence=410 RECID=725 STAMP=1015094276
input archived log thread=2 sequence=323 RECID=727 STAMP=1015094769
input archived log thread=1 sequence=411 RECID=726 STAMP=1015094767
channel ORA_DISK_1: starting piece 1 at 31-JUL-19
channel ORA_DISK_1: finished piece 1 at 31-JUL-19
piece handle=/u01/Backup/ora_df1015095022_s187_s1 tag=FULL_DB comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:15
Finished backup at 31-JUL-19

Starting backup at 31-JUL-19
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA/RAC/DATAFILE/idata.269.1014653909
input datafile file number=00003 name=+DATA/RAC/DATAFILE/sysaux.257.1011959959
input datafile file number=00009 name=+DATA/RAC/DATAFILE/soetbs.273.1015005687
input datafile file number=00001 name=+DATA/RAC/DATAFILE/system.258.1011960053
input datafile file number=00004 name=+DATA/RAC/DATAFILE/undotbs1.260.1011960171
input datafile file number=00005 name=+DATA/RAC/DATAFILE/undotbs2.265.1011960859
input datafile file number=00007 name=+DATA/RAC/DATAFILE/indx.270.1014656575
input datafile file number=00008 name=+DATA/RAC/DATAFILE/ilog.271.1014656841
input datafile file number=00006 name=+DATA/RAC/DATAFILE/users.259.1011960169
channel ORA_DISK_1: starting piece 1 at 31-JUL-19

channel ORA_DISK_1: finished piece 1 at 31-JUL-19
piece handle=/u01/Backup/ora_df1015095163_s188_s1 tag=TAG20190731T185241 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:10:55
channel ORA_DISK_1: starting full 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 31-JUL-19
channel ORA_DISK_1: finished piece 1 at 31-JUL-19
piece handle=/u01/Backup/ora_df1015095819_s189_s1 tag=TAG20190731T185241 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 31-JUL-19

Starting backup at 31-JUL-19
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=412 RECID=729 STAMP=1015095829
input archived log thread=2 sequence=324 RECID=728 STAMP=1015095829
channel ORA_DISK_1: starting piece 1 at 31-JUL-19
channel ORA_DISK_1: finished piece 1 at 31-JUL-19
piece handle=/u01/Backup/ora_df1015095835_s190_s1 tag=FULL_DB comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 31-JUL-19

RMAN>


No comments:

Post a Comment