how to check rman catalog version


SQL> select object_type from user_objects where object_name = RCVER; SQL> desc rcver; Now you want to revoke privileges from vpc1. RMAN uses the recovery catalog as the single source of truth for the Data Guard environment. RMAN can use the recovery catalog to update a primary or standby control file in a reverse resynchronization. The database user who owns the base recovery catalog is rco. The catalog vpc1 retains all other granted catalog privileges. Start RMAN and connect to the recovery catalog database as the recovery catalog owner (. A stored script is either global or local. Restoring and recovering the recovery catalog database is much like restoring and recovering any other database with RMAN. Your script uses the automatic channels configured at the time you execute the script. By default, all of the users of an RMAN recovery catalog have full privileges to read, select, insert, update, and delete any metadata in the catalog. To determine the schema version of the recovery catalog: Start SQL*Plus and connect to the recovery catalog database as the catalog owner. Resynchronization of the recovery catalog ensures that the metadata that RMAN obtains from the control file stays current. Otherwise, control file records could be reused before they are propagated to the recovery catalog. In this case, the metadata flows from the catalog to the control file rather than the other way around. Disables VPD functionality by cleaning up the base recovery catalog schema, revoking grants, and removing database objects. Creating a virtual private catalog is a multi-step process in which you first create the database user who will own the virtual private catalog and then create the virtual private catalog. Check the compatibility matrix to determine which schema versions are compatible in your environment. If no local script is found, but there is a global script with the name specified, then RMAN executes the global script. To indicate whether the unregister was successful, RMAN prints messages before and after unregistering the merged databases. Automatically detects the RMAN base catalog schemas and upgrades. Oracle Database Reference for more information about the CONTROL_FILE_RECORD_KEEP_TIME parameter, Oracle Database Administrators Guide for more detailed information on other aspects of control file management, Preventing the Loss of Control File Records to learn how to monitor the overwriting of control file records. If the recovery catalog database uses the Standard Edition, then use one of the following techniques: Migrate the recovery catalog database from Standard Edition to Enterprise Edition. RMAN scans all paths for all files on disk that begin with the specified prefix. You must back up the recovery catalog frequently. The schema version of the recovery catalog is stored in the recovery catalog itself. The process of enrolling of a target database in a recovery catalog is called registration. Every quarter, execute the stored script, passing values for the substitution variables. You can create or change an RMAN configuration for a standby database even when not connected to this database as TARGET. Oracle Database Backup and Recovery Reference. - Start RMAN and connect to a target database and recovery catalog (if used). For example: Restore a control file from the old incarnation.

You can use this clause to remove metadata for a specific database. You can check the results by using SQL*Plus to query the recovery catalog to see which tables were created: Start RMAN and connect to a target database and recovery catalog. Create the recovery catalog, as described in "Executing the CREATE CATALOG Command". After choosing the recovery catalog database and creating the necessary space, you are ready to create the owner of the recovery catalog and grant this user necessary privileges. It is possible for global scripts, but not local scripts, to have name conflicts during import because the destination schema already contains the script name. Start RMAN and connect to a target database and recovery catalog. Connect to the recovery catalog as the owner of the catalog schema to be dropped. RMAN continues the COPY(n) OF pattern until the script is uniquely named. Privileged users such as SYS cannot be the owner of the recovery catalog. "About Using the VPD Model for Virtual Private Catalogs" for information about the dbmsrmanvpc.sql script and its options. Start RMAN and connect to the recovery catalog database as the virtual private catalog owner (. The following procedure explains how to reset the database incarnation when recovering through a RESETLOGS. The compatibility matrix in Oracle Database Backup and Recovery Reference explains which schema versions are compatible with which versions of RMAN. As explained in "About Recovery Catalog Maintenance", you can use CROSSCHECK to fix these records. Configure the control file autobackup feature to ON. To minimize the likelihood of this worst-case scenario, your backup strategy must at least include backing up the recovery catalog. "Protecting the Recovery Catalog" explains how to back up and recover the catalog, and increase its availability. A recovery catalog can store metadata history much longer than the control file. When RMAN is connected to a recovery catalog, RMAN obtains its metadata exclusively from the catalog. Your goal is to ensure that the metadata in the recovery catalog is current. RMAN only needs connectivity to the source and destination catalogs. Each virtual private catalog is owned by a database schema user which is different than the user who owns the recovery catalog. Use the EXECUTE SCRIPT command to run a stored script. The information is important in case you maintain multiple databases of different versions in your production system, and need to determine whether the catalog schema version is usable with a specific target database version. Follow these guidelines when developing an RMAN backup strategy for the recovery catalog database: Run the recovery catalog database in ARCHIVELOG mode so that you can do point-in-time recovery if needed. The following example grants the privilege to user vpc1: The following example connects to the base recovery catalog as rco: The following example gives user vpc1 access to the metadata for prod1 and prod2 (but not prod3): You can also use a DBID rather than a database name. If you are creating a new database to hold your recovery catalog, then in addition to the space for the recovery catalog schema itself, allow space for other files in the recovery catalog database: Most of the space used in the recovery catalog database is devoted to supporting tablespaces, for example, the SYSTEM, temporary, and undo tablespaces. To update stored scripts, use the REPLACE SCRIPT command. Use ALLOCATE CHANNEL commands in the script if you must override the configured channels. You want to move a recovery catalog from one database to another database. This snapshot control file ensures that RMAN has a consistent view of the control file. RMAN automatically resynchronizes the recovery catalog when RMAN is connected to a target database and recovery catalog and you have executed RMAN commands.

For example, RMAN outputs a line of the following form when it connects to a target database that is open: The following commands illustrate how to delete backups: RMAN lists the backups that it intends to delete and prompts for confirmation before deleting them. For example: Query the RCVER table to obtain the schema version, as in the following example (sample output included): If the table displays multiple rows, then the highest version in the RCVER table is the current catalog schema version. By default, RMAN imports metadata from all target databases registered in the source recovery catalog. Import the source catalog into the catalog created in the preceding step. The preceding command invokes a local script if one exists with the name specified. The table stores only the major version numbers and not the patch numbers. To create the recovery catalog schema in the recovery catalog database: Oracle Database Backup and Recovery Reference for a list of RMAN reserved words, Oracle Database Security Guide for information about creating secure passwords. You must allocate space to be used by the catalog schema. Do not use the target database to be backed up as the database for the recovery catalog. Records older than the CONTROLFILE_RECORD_KEEP_TIME setting in the target database control file are lost. How frequently you must resynchronize the recovery catalog depends on the rate at which the database archives redo logs. Otherwise, you can run the. After you set up a virtual private catalog user, the administrator for the recovery catalog grants each virtual private catalog the privilege to use that catalog for one or more databases that are currently registered in the recovery catalog. Example 13-1 Enabling VPD Model for VPC User Schemas. Run the UPDATE CATALOG command again to confirm: To bypass this step, add the NOPROMPT option after the UPGRADE CATALOG command in step 7. As explained in "Manually Resynchronizing the Recovery Catalog", you can resynchronize the standby database manually to update the control file of the standby database. Examples of this worst-case scenario include: A recovery catalog database that has never been backed up, A recovery catalog database that has been backed up, but cannot be recovered because the data file backups or archived logs are not available. The catalog includes the following types of metadata: Data file and archived redo log backup sets and backup pieces, Database structure (tablespaces and data files), Stored scripts, which are named user-created sequences of RMAN commands.

If you discover that this situation occurs frequently, then reducing the value of CONTROL_FILE_RECORD_KEEP_TIME and increase the frequency of resynchronizations. Zero Data Loss Recovery Appliance Protected Database Configuration Guide. All subsequent backups and log archiving done by the target database is associated with the new database incarnation.

For example, if the global script global_backup is in the recovery catalog, but no local stored script global_backup is defined for the target database, then the following command deletes the global script: To use commands related to stored scripts, even global scripts, you must be connected to both a recovery catalog and a target database instance. You must periodically resynchronize to propagate this information into the recovery catalog. To update the recovery catalog after DB_UNIQUE_NAME is changed: The following example changes the database unique name from standby database prodsf1 to prodsf2: You can use the UNREGISTER DATABASE command to unregister a database from the recovery catalog. After you create a virtual private catalog, you can revoke catalog access privileges as necessary. Some RMAN features function only when you use a recovery catalog. For example, you must run the RMAN maintenance commands, which are explained in "Maintaining RMAN Backups and RepositoryRecords", to update backup records and to delete backups that are no longer needed. If you are in a situation where you are using multiple recovery catalogs, then you can also use another recovery catalog to record metadata about backups of this recovery catalog database. This section describes various management and maintenance tasks. To delete a global stored script, use DELETE GLOBAL SCRIPT: Oracle Database Backup and Recovery Reference for DELETE SCRIPT command syntax. The PRINT SCRIPT command displays a stored script or writes it out to a file. If needed, catalog any older backups whose records are no longer stored in the target control file. When you use a recovery catalog, RMAN requires that you maintain a recovery catalog schema. The size of the target database control file grows depending on the number of: Archived redo logs that the database generates, Days that this information is stored in the control file. With this strategy, the control file autobackup feature ensures that the recovery catalog database can always be recovered, so long as the control file autobackup is available. For example: This section describes how to use the UPGRADE CATALOG command to upgrade a virtual private catalog. Oracle Database Backup and Recovery Reference for more information about the RESYNC command. The backup strategy for your recovery catalog database is part of an overall backup and recovery strategy. Create the virtual private catalog before you register a target database with it. You perform this task with the CONFIGURE DB_UNIQUE_NAME or CONFIGURE FOR DB_UNIQUE_NAME command. "Importing and Moving a Recovery Catalog" explains how to merge multiple recovery catalog schemas into one. After creating the catalog owner, create the catalog tables with the RMAN CREATE CATALOG command. The example specifies arc_backup as the name of the media family (set of tapes), bck1206 as part of the FORMAT string and FY06Q4 as the name of the restore point. For example, enter the following command to import the catalog owned by 102cat on database srcdb: A variation is to import metadata for a subset of the target databases registered in the source catalog. If needed, create virtual private catalogs for specific users and determine the metadata to which they are permitted access. If prod1 suffers a total media failure, and if the recovery catalog for prod1 is also stored in prod1, then if you lose the database you also lose the recovery catalog. How to see current utilization of processes/sessions and max utilization? However, you do not need to execute RESET DATABASE TO INCARNATION explicitly in the following scenarios because RMAN runs the command implicitly with Flashback. Creating or updating global scripts must be done while connected to the base recovery catalog. Optionally, you can specify the list of database IDs to be imported from the source catalog schema. For example, you could enter the following SQL statement (replacing, (Optional) Enable the VPD model for the recovery catalog by running the. RMAN uses the Virtual Private Database (VPD) functionality to implement virtual private catalogs. RMAN performs a full resynchronization after structural changes to database (adding or dropping database files, creating new incarnation, and so on) or after changes to the RMAN persistent configuration. You want to merge all existing schemas into one without losing backup metadata. For example, issue the following command to connect to the catalog database with the net service name catdb as user rco (who owns the catalog schema): RMAN creates rows in the catalog tables to contain information about the target database, then copies all pertinent data about the target database from the control file into the catalog, synchronizing the catalog with the control file. Stored scripts, which are not stored in the control file, are also lost. VERSION NOT NULL VARCHAR2(12), how to check if RMAN catalog is installed for a database, Not sure if this the answer you are looking for: http://oraclespin.wordpress.com/2011/07/17/how-to-check-if-rman-catalog-is-installed-for-a-database/. At this point the only option is to restore an autobackup of the control file for prod1 and use it to restore and recover the database without the benefit of any information stored in the recovery catalog. If you use a version of the recovery catalog schema that is older than that required by the RMAN client, then you must upgrade it. RMAN creates the snapshot control file in an operating system-specific location on the target database host. Thus, you must ensure that you resynchronize the recovery catalog with the control file records before these records are erased. For example, the standby1 control file does not know about all backups made on primary1. When you move protected databases to a data protection strategy that uses Recovery Appliance, you can choose to migrate existing backups and backup metadata to Recovery Appliance. In such a case you could connect to the catalog as often as feasible and run the RESYNC CATALOG command. Configure the database that contains the recovery catalog, as described in "Configuring the Recovery Catalog Database". RMAN provides multiple commands to create and manage virtual private catalogs. This flow of metadata from the mounted control file to the recovery catalog, which is known as recovery catalog resynchronization, ensures that the metadata that RMAN obtains from the control file is current. For example, if the administrators of two unrelated databases share the same recovery catalog, each administrator could, whether inadvertently or maliciously, destroy catalog data for the other's database. Issue CATALOG START WITH commands to recatalog any available backups. How can we build our REST API calls from Goldengate adminclient? Use SQL*Plus to connect to the recovery catalog database as the catalog owner. Otherwise, a syntax error is signalled, just as if the commands were entered at the keyboard. For example, RMAN renames bp_cmd to COPY OF bp_cmd. Oracle Database Backup and Recovery Reference. If you use RMAN in a Data Guard environment, then you can use the REGISTER DATABASE command only for the primary database. You can use the CREATE SCRIPT command to create a stored script. Start RMAN and connect to the database that will contain the catalog. The schema version of the recovery catalog is stored in the recovery catalog itself. The procedure for moving a recovery catalog from one database to another is a variation of the procedure for importing a catalog. It is not necessary to connect to the target database, but if you do not, then you must specify the name of the target database in the UNREGISTER command. For example, if you make a weekly whole database backup of a target database, then back up the recovery catalog after the backup of the target database. To send the contents of a script to a file, use this form of the command: For global scripts, the analogous syntax is as follows: Oracle Database Backup and Recovery Reference for PRINT SCRIPTcommand syntax. "Cataloging Backups in the Recovery Catalog" explains how to perform this task. A target database, recovery catalog database, and recovery catalog schema can be at different database versions. The commands allowable within the brackets of the CREATE SCRIPT command are the same commands supported within a RUN block. asm oracle doyensys For example, you could enter the following command to execute script /tmp/fbkp.cmd: You must connect to the recovery catalog, which contains the stored script, and the target database, to which the script applies, when starting the RMAN client. The owner of a centralized recovery catalog, which is also called the base recovery catalog, can grant or revoke restricted access to the catalog to other database users. If multiple databases have the same name in the recovery catalog, then you must create a RUN block around the command and use SET DBID to set the DBID for the database. In a Data Guard environment, RMAN can perform a reverse resynchronization to update a database control file with metadata from the catalog. The following example illustrates creation of a local script: For a global script, the syntax is similar: Optionally, you can provide a COMMENT with descriptive information: You can also create a script by reading its contents from a text file. When specifying a script name, RMAN permits but generally does not require that you use quotes around the name of a stored script. SCRIPT NAMES command to display the names of scripts defined in the recovery catalog. Consider using a naming convention to avoid confusion between global and local stored scripts. You must use a recovery catalog to manage RMAN metadata for all physical databases, both primary and standby databases, in the Data Guard environment.

You can also use EXECUTE GLOBAL SCRIPT to control which script is invoked if a local and a global script have the same name. If you assume that each row in the backup piece table uses the maximum amount of space, then one daily backup consumes less than 170 kilobytes in the recovery catalog. You create an incarnation of the database when you open the database with the RESETLOGS option. For example, run the following command to list the names of all global and local scripts that can be executed for the currently connected target database: The following example lists only global script names: To list the names of all scripts stored in the current recovery catalog, including global scripts and local scripts for all target databases registered in the recovery catalog, use the following form of the command: For each script listed, the output indicates which target database the script is defined for (or whether a script is global).

To purge RMAN repository records from the control file, re-create the control file. Thus, you must never store a recovery catalog containing the RMAN repository for a database in the same database as the target database. If you use the RMAN DUPLICATE command or the CREATE DATABASE statement in SQL, then the database is assigned a unique DBID automatically. Zero Data Loss Recovery Appliance Administrator's Guide for an overview of the Recovery Appliance catalog, Zero Data Loss Recovery Appliance Protected Database Configuration Guide for the steps to migrate backups and backup metadata. You can specify a maximum of 10 schema names. How to extract the DB LINKS DDL with the password. If you create a database by other means, then the copied database may have the same DBID as its source database. Include the recovery catalog database in your backup and recovery strategy. This capability is useful if you must do a recovery that goes further back in time than the history in the control file.

You want to create database user vpc1 and grant this user access privileges only to prod1 and prod2. For example, enter the following commands: For example, execute the LIST DB_UNIQUE_NAME command as follows: For example, execute the UNREGISTER command as follows to unregister database standby: In a Zero Data Loss Recovery Appliance (Recovery Appliance) environment, the UNREGISTER DATABASE command cannot be used to unregister a protected database from the Recovery Appliance catalog. If the name begins with a digit or is an RMAN reserved word, however, then you must put quotes around the name to use it as a stored script name. If local and global stored scripts are defined with the same name, then RMAN always executes the local script. Scripting on this page enhances content navigation, but does not change the content in any way. How to delete/reset a parameter in spfile using ALTER SYSTEM? The database unique name for these old records is null. If a database is currently registered in both catalog schemas, then unregister the database from source catalog schema before performing the import. Maintaining RMAN Backups and RepositoryRecords, Configuring the Recovery Catalog Database, Creating the Recovery Catalog Schema Owner, About Using the VPD Model for Virtual Private Catalogs, Description of "Figure 13-1 Using the Control File as the Repository for Backups of the Recovery Catalog", About RMAN File Management in a Data Guard Environment, Configuring the Snapshot Control File Location, Manually Resynchronizing the Recovery Catalog, Preventing the Loss of Control File Records, Determining the Schema Version of the Recovery Catalog. You can use the same procedure after changing the DB_UNIQUE_NAME of a primary database, except in Step 1 connect RMAN as TARGET to a standby database instead of a primary database. The following procedure assumes that the DB_UNIQUE_NAME of the primary database is prodny, and that you have changed the DB_UNIQUE_NAME of a standby database from prodsf1 to prodsf2. A recovery catalog provides the following benefits: A recovery catalog creates redundancy for the RMAN repository stored in the control file of each target database. The following example gives the user vpc1 access to the metadata for the PDB hr_pdb: You can also grant the user the ability to register new target databases in the recovery catalog. Use SQL*Plus to connect to the recovery catalog database as the. Move the recovery catalog into an Oracle Enterprise Edition database and then use the IMPORT CATALOG command to import the recovery catalog into this database. Oracle Database Backup and Recovery Reference for LIST SCRIPT NAMES command syntax and output format. To find RMAN catalog version log-in to the catalog through SQL*Plus and query the table rcver will print version. Oracle Data Guard Concepts and Administration. For example, the following commands connect to database. When RMAN connects to a standby database, it automatically registers the new database information and resynchronizes to obtain the file names from the control file. If GLOBAL is not specified, then RMAN searches for a local stored script defined for the current target database.

Assume that the following databases are registered in the base recovery catalog: prod1, prod2, and prod3. If the source catalog schema is a lower version, then upgrade it to the current version before importing the schema. For example, assume that a group of directories /disk1/backups, /disk1/backups-year2003, /disk1/backupsets, /disk1/backupsets/test and so on, all contain backup files.