Thursday 26 November 2015

Create Dummy database using rman 0 level backup


Server details

Node 1:
[oracle@target backup]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)

Node 2:
[oracle@source backup]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)


1) Take 0 level backup of source database

[oracle@source]$ mkdir /u01/app/backup/

[oracle@source]$ cd /u01/app/backup/

[oracle@source backup]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Fri Nov 27 02:50:21 2015

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

connected to target database: DB11G (DBID=366062519)

RMAN>


RMAN> RUN
2> {
3> configure controlfile autobackup on;
4> set command id to 'ORCLOnlineBackupFull';
5> ALLOCATE CHANNEL c1 DEVICE TYPE disk;
6> ALLOCATE CHANNEL c2 DEVICE TYPE disk;
7> backup AS COMPRESSED BACKUPSET full database tag ORCL_FULL format '/u01/app/backup/%d_%T_%s_%p_FULL' ;
8> sql 'alter system archive log current';
9> backup tag ORCL_ARCHIVE format '/u01/app/backup/%d_%T_%s_%p_ARCHIVE' archivelog all delete all input ;
10> backup tag ORCL_CONTROL current controlfile format '/u01/app/backup/%d_%T_%s_%p_CONTROL';
11> backup tag spfile_pfile spfile format '/u01/app/backup/%d_%T_%s_%p_spfile';
12> release channel c1;
13> release channel c2;
14> }

using target database control file instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

executing command: SET COMMAND ID

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

allocated channel: c2
channel c2: SID=41 device type=DISK

Starting backup at 27-NOV-15
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/DB11G/system01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/DB11G/example01.db
channel c1: starting piece 1 at 27-NOV-15
channel c2: starting compressed full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00002 name=/u01/app/oracle/oradata/DB11G/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/DB11G/undotbs01.db
input datafile file number=00004 name=/u01/app/oracle/oradata/DB11G/users01.dbf
channel c2: starting piece 1 at 27-NOV-15
channel c2: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_37_1_FULL tag=ORCL_FULL comment=NONE
channel c2: backup set complete, elapsed time: 00:00:46
channel c1: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_36_1_FULL tag=ORCL_FULL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:56
Finished backup at 27-NOV-15

Starting Control File and SPFILE Autobackup at 27-NOV-15
piece handle=/u01/app/oracle/product/11.2.0/db_1/dbs/c-366062519-20151127-00 comment=NONE
Finished Control File and SPFILE Autobackup at 27-NOV-15

sql statement: alter system archive log current

Starting backup at 27-NOV-15
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=11 RECID=9 STAMP=896841558
channel c1: starting piece 1 at 27-NOV-15
channel c2: starting archived log backup set
channel c2: specifying archived log(s) in backup set
input archived log thread=1 sequence=12 RECID=10 STAMP=896842340
input archived log thread=1 sequence=13 RECID=11 STAMP=896842340
channel c2: starting piece 1 at 27-NOV-15
channel c1: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_39_1_ARCHIVE tag=ORCL_ARCHIVE comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
channel c1: deleting archived log(s)
archived log file name=/u01/archive/1_11_896392954.dbf RECID=9 STAMP=896841558
channel c2: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_40_1_ARCHIVE tag=ORCL_ARCHIVE comment=NONE
channel c2: backup set complete, elapsed time: 00:00:01
channel c2: deleting archived log(s)
archived log file name=/u01/archive/1_12_896392954.dbf RECID=10 STAMP=896842340
archived log file name=/u01/archive/1_13_896392954.dbf RECID=11 STAMP=896842340
Finished backup at 27-NOV-15

Starting backup at 27-NOV-15
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 27-NOV-15
channel c1: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_41_1_CONTROL tag=ORCL_CONTROL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-NOV-15

Starting backup at 27-NOV-15
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel c1: starting piece 1 at 27-NOV-15
channel c1: finished piece 1 at 27-NOV-15
piece handle=/u01/app/backup/DB11G_20151127_42_1_spfile tag=SPFILE_PFILE comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-NOV-15

Starting Control File and SPFILE Autobackup at 27-NOV-15
piece handle=/u01/app/oracle/product/11.2.0/db_1/dbs/c-366062519-20151127-01 comment=NONE
Finished Control File and SPFILE Autobackup at 27-NOV-15

released channel: c1

released channel: c2

2) Create same backup location on target database server and transfer all backup file to same location.


[oracle@target ~]$ mkdir /u01/app/backup/

[oracle@source backup]$ ls -ltr
total 303000
-rw-r----- 1 oracle oinstall  76931072 Nov 27 02:52 DB11G_20151127_37_1_FULL
-rw-r----- 1 oracle oinstall 212533248 Nov 27 02:52 DB11G_20151127_36_1_FULL
-rw-r----- 1 oracle oinstall   2514432 Nov 27 02:52 DB11G_20151127_40_1_ARCHIVE
-rw-r----- 1 oracle oinstall   8061440 Nov 27 02:52 DB11G_20151127_39_1_ARCHIVE
-rw-r----- 1 oracle oinstall   9797632 Nov 27 02:52 DB11G_20151127_41_1_CONTROL
-rw-r----- 1 oracle oinstall     98304 Nov 27 02:52 DB11G_20151127_42_1_spfile


[oracle@source backup]$ scp * oracle@target:/u01/app/backup/
The authenticity of host 'target (192.168.223.130)' can't be established.
RSA key fingerprint is 87:f6:a9:cc:0d:63:8c:40:6d:ee:17:2f:05:dd:ac:ad.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'target,192.168.223.130' (RSA) to the list of known hosts.
oracle@target's password:
DB11G_20151127_36_1_FULL                                                                                     100%  203MB  50.7MB/s   00:04
DB11G_20151127_37_1_FULL                                                                                     100%   73MB  36.7MB/s   00:02
DB11G_20151127_39_1_ARCHIVE                                                                                  100% 7873KB   7.7MB/s   00:01
DB11G_20151127_40_1_ARCHIVE                                                                                  100% 2456KB   2.4MB/s   00:00
DB11G_20151127_41_1_CONTROL                                                                                  100% 9568KB   9.3MB/s   00:00
DB11G_20151127_42_1_spfile                                                                                   100%   96KB  96.0KB/s   00:00

[oracle@target ~]$ cd /u01/app/backup/
[oracle@target backup]$ ls -ltr
total 303000
-rw-r----- 1 oracle oinstall 212533248 Nov 26 16:41 DB11G_20151127_36_1_FULL
-rw-r----- 1 oracle oinstall  76931072 Nov 26 16:41 DB11G_20151127_37_1_FULL
-rw-r----- 1 oracle oinstall   9797632 Nov 26 16:41 DB11G_20151127_41_1_CONTROL
-rw-r----- 1 oracle oinstall   2514432 Nov 26 16:41 DB11G_20151127_40_1_ARCHIVE
-rw-r----- 1 oracle oinstall   8061440 Nov 26 16:41 DB11G_20151127_39_1_ARCHIVE
-rw-r----- 1 oracle oinstall     98304 Nov 26 16:41 DB11G_20151127_42_1_spfile
[oracle@target backup]$

3) Create structure on target database same as source database.

[oracle@target oracle]$ mkdir -p /u01/app/oracle/oradata/DB11G
[oracle@source DB11G]$ mkdir -p /u01/app/oracle/admin/DB11G/dpdump
[oracle@source DB11G]$ mkdir -p /u01/app/oracle/admin/DB11G/pfile
[oracle@source DB11G]$ mkdir -p /u01/app/oracle/admin/DB11G/adump
[oracle@source DB11G]$

4) Restore spfile,contofile,database using rman (on target database).

[oracle@target dbs]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Thu Nov 26 17:25:00 2015

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

connected to target database (not started)

RMAN> startup nomount

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/db_1/dbs/initDB11G.ora'

starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started

Total System Global Area     158662656 bytes

Fixed Size                     2226456 bytes
Variable Size                 92276456 bytes
Database Buffers              58720256 bytes
Redo Buffers                   5439488 bytes

RMAN> restore spfile from '/u01/app/backup/DB11G_20151127_42_1_spfile';

Starting restore at 26-NOV-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK

channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/app/backup/DB11G_20151127_42_1_spfile
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 26-NOV-15

RMAN> shutdown immediate;

Oracle instance shut down

RMAN>exit

[oracle@target dbs]$ sqlplus

SQL*Plus: Release 11.2.0.3.0 Production on Thu Nov 26 17:51:36 2015

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

Enter user-name: /as sysdba

SQL> create pfile from spfile;

File created.

SQL> startup nomount pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initDB11G.ora';
ORACLE instance started.

Total System Global Area  839282688 bytes
Fixed Size                  2233000 bytes
Variable Size             520097112 bytes
Database Buffers          314572800 bytes
Redo Buffers                2379776 bytes
SQL> exit

[oracle@target admin]$ echo $ORACLE_SID
DB11G
[oracle@target admin]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Thu Nov 26 17:52:32 2015

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

connected to target database: DB11G (not mounted)

RMAN> restore controlfile from '/u01/app/backup/DB11G_20151127_41_1_CONTROL';

Starting restore at 26-NOV-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/DB11G/control01.ctl
output file name=/u01/app/oracle/oradata/DB11G/control02.ctl
Finished restore at 26-NOV-15

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN> restore database;

Starting restore at 26-NOV-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/DB11G/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/DB11G/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/DB11G/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/backup/DB11G_20151127_37_1_FULL
channel ORA_DISK_1: piece handle=/u01/app/backup/DB11G_20151127_37_1_FULL tag=ORCL_FULL
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/DB11G/system01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/DB11G/example01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/backup/DB11G_20151127_36_1_FULL
channel ORA_DISK_1: piece handle=/u01/app/backup/DB11G_20151127_36_1_FULL tag=ORCL_FULL
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:47
Finished restore at 26-NOV-15

RMAN> recover database;

Starting recover at 26-NOV-15
using channel ORA_DISK_1

starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=12
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=13
channel ORA_DISK_1: reading from backup piece /u01/app/backup/DB11G_20151127_40_1_ARCHIVE
channel ORA_DISK_1: piece handle=/u01/app/backup/DB11G_20151127_40_1_ARCHIVE tag=ORCL_ARCHIVE
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/archive/1_12_896392954.dbf thread=1 sequence=12
archived log file name=/u01/archive/1_13_896392954.dbf thread=1 sequence=13
unable to find archived log
archived log thread=1 sequence=14
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 11/26/2015 17:56:57
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 14 and starting SCN of 1075281

RMAN> alter database open RESETLOGS;

database opened

RMAN> shutdown immediate;

database closed
database dismounted
Oracle instance shut down

RMAN> exit

[oracle@target dbs]$ sqlplus

SQL*Plus: Release 11.2.0.3.0 Production on Thu Nov 26 17:59:24 2015

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

Enter user-name: /as sysdba
Connected to an idle instance.

SQL> startup pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initDB11G.ora';
ORACLE instance started.

Total System Global Area  839282688 bytes
Fixed Size                  2233000 bytes
Variable Size             520097112 bytes
Database Buffers          314572800 bytes
Redo Buffers                2379776 bytes
Database mounted.
Database opened.
SQL> create spfile from pfile;

File created.

SQL> startup force;
ORACLE instance started.

Total System Global Area  839282688 bytes
Fixed Size                  2233000 bytes
Variable Size             520097112 bytes
Database Buffers          314572800 bytes
Redo Buffers                2379776 bytes
Database mounted.
Database opened.
SQL> select name from v$database;

NAME
---------
DB11G

SQL>


                                                             *****END*****


Saturday 7 November 2015

Container and Pluggable database backup command in oracle database 12c.

1) Backup container database plus pluggable database.

-> connect rman with sys user.

[oracle@cdb1 dbs]$ rman target=/
Recovery Manager: Release 12.1.0.2.0 - Production on Sun Oct 18 05:20:11 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1413747592)

RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
Starting backup at 18-OCT-15
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=52 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=10 RECID=1 STAMP=893395257
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_annnn_TAG20151018T052058_c25qq26k_.bkp tag=TAG20151018T052058 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-OCT-15
Starting backup at 18-OCT-15
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=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T052059_c25qq3j0_.bkp tag=TAG20151018T052059 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T052059_c25qr711_.bkp tag=TAG20151018T052059 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:16
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=/u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/orcl/pdbseed/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA927A157F92B65E05348304B740CF8/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T052059_c25qrp62_.bkp tag=TAG20151018T052059 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting backup at 18-OCT-15
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=11 RECID=2 STAMP=893395325
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_annnn_TAG20151018T052205_c25qs5pm_.bkp tag=TAG20151018T052205 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893395326_c25qs7b9_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

2) Backup only container database.

RMAN> BACKUP DATABASE ROOT plus archivelog;
Starting backup at 18-OCT-15
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=10 RECID=1 STAMP=893395257
input archived log thread=1 sequence=11 RECID=2 STAMP=893395325
input archived log thread=1 sequence=12 RECID=3 STAMP=893395548
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_annnn_TAG20151018T052548_c25r04nz_.bkp tag=TAG20151018T052548 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-OCT-15
Starting backup at 18-OCT-15
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=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T052549_c25r05xs_.bkp tag=TAG20151018T052549 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
Finished backup at 18-OCT-15
Starting backup at 18-OCT-15
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=13 RECID=4 STAMP=893395585
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_annnn_TAG20151018T052625_c25r19gf_.bkp tag=TAG20151018T052625 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893395586_c25r1btk_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

3) Backup only pluggable database.

I have only one pluggable database pdb1.

SQL> select con_id,name from v$containers;
CON_ID NAME
---------- ------------------------------
1 CDB$ROOT
2 PDB$SEED
3 PDB1
RMAN> BACKUP PLUGGABLE DATABASE pdb1;
Starting backup at 18-OCT-15
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=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T053410_c25rhv5z_.bkp tag=TAG20151018T053410 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893396066_c25rjbgf_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

---> backup pluggable database using pluggable database.

[oracle@cdb1 dbs]$ rman target=sys/*****@pdb1

Recovery Manager: Release 12.1.0.2.0 - Production on Sun Oct 18 05:36:30 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1413747592, not open)

RMAN> backup database;

Starting backup at 18-OCT-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset
/2015_10_18/o1_mf_nnndf_TAG20151018T053658_c25ro2c4_.bkp tag=TAG20151018T053658 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893396233_c25roksn_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

4) Backup pluggable database tablespace.

RMAN> backup tablespace sysaux,system;

Starting backup at 18-OCT-15
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=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T053829_c25rqxkt_.bkp tag=TAG20151018T053829 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893396324_c25rrdt4_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

5) Backup pluggable database datafiles;

SQL> select CON_ID,FILE# from v$datafile;
CON_ID FILE#
---------- ----------
1 1
1 3
1 4
2 5
1 6
2 7
3 8
3 9
8 rows selected.

SQL> select con_id,name from v$containers;
CON_ID NAME
---------- ------------------------------
1 CDB$ROOT
2 PDB$SEED
3 PDB1

-> pdb1 database contain only two files 8 and 9;

RMAN> backup datafile 8,9;

Starting backup at 18-OCT-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T055231_c25sl7wh_.bkp tag=TAG20151018T055231 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893397166_c25slq4j_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

                                                      *******END********

work on autovacuum postgreSQL parameter

 In This blog, we are discussing the auto vacuum parameter on a small scale. we will understand the below parameters and will see how to mod...