This content has been marked as final. Show 11 replies
In first commad, you are connecting to Recovery catalog with user RMAN which suppose to be the catalog owner. After this you will need to provide one more statement to connect to Target database.
rman catalog rman/rman@orcl rman target scott/tiger catalog rman/rman@orcl
In second command, you are connecting to Recovery catalog as well as Target database in one single statement.
I dont think there is any other difference...
user12050217 wrote:To test backup and recovery, you need a connection with target database, evidently. So the second command will be more useful. Although you can issue the first command, and then use on more command within RMAN: connect target scott/tiger
I wish to test backup and recovery, so which of the above command should be used.
C:\Windows\>rman target rman/rman@orcl Recovery Manager: Release 188.8.131.52.0 - Production on Sat Apr 28 15:03:53 2012 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: ORCL (DBID=1349204074) RMAN>
After this you will need to provide one more statement to connect to Target database.What do you mean please elaborate it, what statement need to be connected, when I am getting connected to target database:....
rman target rman/rman@orcl --->No entry in v$session
rman catalog rman/rman@orcl -->Entry in v$session. There is RMAN username in v$session.
When I said :
rman target scott/tiger catalog rman/rman@orcl
There is RMAN username in v$session.
What does it mean ? Its bit confusing that which user is going to take backup or recovery i.e. scott or rman ? What exactly mean by catalog and target, these are confusing to me. Please elaborate it.
The "target" is your database which you want to backup.
The "catalog" is the additional database which is served as recovery catalog, i.e. it contains the data about backups of target database.
When you issue the command
rman target rman/rman@orcl
you're connected to the recovery catalog database as target, therefore you have no records in v$session of your realy target database (which is indicated by ORACLE_SID)
As far command is concerned , first try to understand what is rman catalog and why and when it is required ?
RMAN maintains metadata about the target database and its backup and recovery operations in the RMAN repository. Among other things, RMAN stores information about its own configuration settings, the target database schema, archived redo logs, and all backup files on disk or tape. RMAN's LIST, REPORT, and SHOW commands display RMAN repository information.
The primary store for RMAN repository data is always the control file of the target database. The CONTROL_FILE_RECORD_KEEP_TIME initialization parameter controls how long backup records are kept in the control file before those records are re-used to hold information about more recent backups.
Another copy of the RMAN repository data can also be saved in the recovery catalog.
Using a recovery catalog preserves RMAN repository information if the control file is lost, making it much easier to restore and recover following the loss of the control file. (A backup control file may not contain complete information about recent available backups.) The recovery catalog can also store a much more extensive history of your backups than the control file, due to limits on the number of control file records.
In addition to RMAN repository records, the recovery catalog can also hold RMAN stored scripts, sequences of RMAN commands for common backup tasks. Centralized storage of scripts in recovery catalog can be more convenient than working with command files.
Except for stored scripts, all of RMAN's features work equally well with or without a recovery catalog.
so when you are using the command i.e;
RMAN>rman target scott/tiger catalog rman/rman@orcl
ywhile connected with the target database and whatever the action you perform on rman, this get populated in both i.e, catalog and rman repository(control file) of traget .
and in second case
rman catalog rman/rman@orcl
you can only connect with catalog and list the details backups and more about the database backup information . You cannot perform backup connecting with catalog .
Hope this may help you
can --> cannot
Edited by: Vishen on Apr 28, 2012 5:01 PM
You can perform can backup only connecting with catalog .I think this is wrong. We can backup only when rman session is connected to the target database.
1. rman catalog rman/rman@orcl -->No backup possible-->Because you are connected to recovery catalog database.
2. rman target scott/tiger catalog rman/rman@orcl -->Backup possbile-->Because are connected to target database: <SID NAME> (DBID=9999999999)
3. rman target rman/rman@orcl -->Backup possbile-->Backup possbile-->Because are connected to target database: <SID NAME> (DBID=9999999999)
So, conclusion is backup only possible if there is "target" word in your connect command along with other privileges.
No problem Neeraj. One more difference I found... Tested on 184.108.40.206 on Windows machine (Db is configured with catalog and in archive log):
1.rman catalog rman/rman@orcl-->RMAN user in v$session-->No backup possible
2.rman target scott/tiger catalog rman/rman@orcl -->RMAN user in v$session-->Backup possible
3.rman target rman/rman@orcl-->No user in v$session-->Backup possible
So, for entry in v$session, connect command should have "catalog" word.
3.rman target rman/rman@orcl-->No user in v$session-->Backup possibleyou should check the connecion as
SQL>select DISTINCT program,username,osuser from v$session ;
you find there is session of rman.exe
this means that each session information is there in v$session views . Though it is showing the username as "SYS" not as you have connected say "rman" .
So, for entry in v$session, connect command should have "catalog" word.I didn't get this line . But i guess no catalog word is required .
Please correct me
Your comments are most welcome ....
rman target scott/tiger catalog rman/rman@orcl
Here scott user is having DBA role too. Recovery catalog owner is rman. I wish to test backup and recovery,You cannot backup the database wih a user with DBA role, you need to have SYSDBA privlage to backup the database and RMAN by default connect with the target database as a SYSDBA only.
so which of the above command should be used.It depends on where is your catalog database and your target database.
If you want to invoke the RMAN on target database
just use "rman target / CATALOG rman/rman@orcl
If target and catalog database are remote then "rman TARGET SYS/oracle@trgt CATALOG rman/cat@catdb"
user12050217 wrote:This is going to connect you the recovery catalog database but not to the target database. So you would need to issue another statement while being connected to RMAN to make the connection to the target database. Here the user RMAN is the Catalog owner's name .
Please tell me what are difference between these two commands :
rman catalog rman/rman@orcl
rman target scott/tiger catalog rman/rman@orclYou are trying to connect to the Target database as Scott user and Catalog db as RMAN user.
Here scott user is having DBA role too. Recovery catalog owner is rman. I wish to test backup and recovery, so which of the above command should be used.The backup would be done using the Sysdba role, not with the DBA role. So you would need to issue anyways the command to connect to the target db.In the 2nd command you are making that connection and in the 1st , you would need to take one more step for it.
Kindly elaborate it.Its elaborated already in the Backup and Recovery reference guide. Please read it,