This discussion is archived
11 Replies Latest reply: Apr 29, 2012 3:38 AM by Aman.... RSS

What is difference between these commands

user12050217 Explorer
Currently Being Moderated
Oracle 11.2.0.1
Windows 7

Please tell me what are difference between these two commands :

rman catalog rman/rman@orcl
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, so which of the above command should be used.

Kindly elaborate it.

Thanks.
  • 1. Re: What is difference between these commands
    Oceaner Explorer
    Currently Being Moderated
    rman catalog rman/rman@orcl
    rman target scott/tiger catalog rman/rman@orcl
    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.

    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...
  • 2. Re: What is difference between these commands
    viconstg Journeyer
    Currently Being Moderated
    user12050217 wrote:
    I wish to test backup and recovery, so which of the above command should be used.
    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
  • 3. Re: What is difference between these commands
    user12050217 Explorer
    Currently Being Moderated
    C:\Windows\>rman target rman/rman@orcl
    
    Recovery Manager: Release 11.2.0.1.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.

    Thanks.
  • 4. Re: What is difference between these commands
    viconstg Journeyer
    Currently Being Moderated
    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)
  • 5. Re: What is difference between these commands
    839439 Pro
    Currently Being Moderated
    Hi

    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


    --neeraj


    can --> cannot
    Edited by: Vishen on Apr 28, 2012 5:01 PM
  • 6. Re: What is difference between these commands
    Girish Sharma Guru
    Currently Being Moderated
    Neeraj,
    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.

    @OP :

    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.

    Regards
    Girish Sharma
  • 7. Re: What is difference between these commands
    839439 Pro
    Currently Being Moderated
    Hi Girish

    Thank you for catching my mistake .

    It's just the slips while writing it . Now i have updated it . I think you may got this .

    thanks again :)


    --neeraj                                                                                                                                                                                                                                                                                                                                                                       
  • 8. Re: What is difference between these commands
    Girish Sharma Guru
    Currently Being Moderated
    No problem Neeraj. One more difference I found... Tested on 11.2.0.1 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.

    Regards
    Girish Sharma
  • 9. Re: What is difference between these commands
    839439 Pro
    Currently Being Moderated
    Hi Girish
    3.rman target rman/rman@orcl-->No user in v$session-->Backup possible
    you 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 ....


    --neeraj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
  • 10. Re: What is difference between these commands
    mBk77 Journeyer
    Currently Being Moderated
    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"
  • 11. Re: What is difference between these commands
    Aman.... Oracle ACE
    Currently Being Moderated
    user12050217 wrote:
    Oracle 11.2.0.1
    Windows 7

    Please tell me what are difference between these two commands :

    rman catalog rman/rman@orcl
    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 .

    rman target scott/tiger catalog rman/rman@orcl
    You 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,
    http://docs.oracle.com/cd/E11882_01/backup.112/e10642/toc.htm

    Aman....

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points