Get the App
SLTechnology News&Howtos  ›  Servers  › 

RMAN- registers and cancels the database in the recovery directory

Shulou Source: shulou.com Published: 2022-06-02 06:23:55 10月04日 Update

Create a recovery directory

1. Create the table space used to restore the catalog in the catalog database

SQL > create tablespace rman_ts datafile'c:\ oracle\ oradata\ cc\ rmants.ora' size 20m

The tablespace has been created.

2. Create a RMAN user in the catalog database and authorize it

SQL > create user rman identified by rman default tablespace rman_ts temporary tablespace temp

Quota unlimited on rmants

User has been created

SQL > grant recovery_catalog_owner,resource to rman

Grant succeeded.

3. Create a recovery directory in the catalog database

[oracle@node1 ~] $rman catalog rman/rman@ping

Recovery Manager: Release 10.2.0.1.0-Production on Wed Jan 7 09:52:13 2009

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

Connected to recovery catalog database

RMAN > create catalog tablespace rman_ts

Recovery catalog created

4. Register the target database to the recovery directory

Target database: racdb

Restore directory: ping

[oracle@node1 ~] $rman target sys/1@racdb

Recovery Manager: Release 10.2.0.1.0-Production on Wed Jan 7 10:05:50 2009

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

Connected to target database: RACDB (DBID=672464192)

RMAN > connect catalog rman/rman@ping

Connected to recovery catalog database

RMAN > register database

Database registered in recovery catalog

Starting full resync of recovery catalog

Full resync complete

Cancel the registration of the database

1. Log in to the recovery directory using the RMAN user in SQLPLUS

[oracle@node1 ~] $sqlplus / nolog

SQL*Plus: Release 10.2.0.1.0-Production on Wed Jan 7 10:50:06 2009

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

SQL > conn rman/rman@ping

Connected.

2. Look up the registration record in the table DB

[oracle@node1 ~] $rman target sys/1@racdb

Recovery Manager: Release 10.2.0.1.0-Production on Wed Jan 7 10:49:03 2009

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

Connected to target database: RACDB (DBID=672464192)

RMAN >

SQL > select db_key,db_id from db

DB_KEY DB_ID

--

1 672464192

DBID=DB.DB_ID

# # remember that users who use RMAN must log in, or the following error will appear

SQL > conn sys/sys@ping as sysdba

Connected.

SQL > select db_key,db_id from db

Select db_key,db_id from db

*

ERROR at line 1:

ORA-00942: table or view does not exist

3. Log out of the database

SQL > execute dbms_rcvcat.unregisterdatabase (1pm 672464192)

PL/SQL procedure successfully completed.

4. Verify logout action

[oracle@node1 ~] $rman

Recovery Manager: Release 10.2.0.1.0-Production on Wed Jan 7 11:02:16 2009

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

RMAN > list backup

Using target database control file instead of recovery catalog

RMAN-00571: =

RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =

RMAN-00571: =

RMAN-03002: failure of list command at 01/07/2009 11:02:21

RMAN-06171: not connected to target database

RMAN >

Tags: Directory data database user Zhongchuang target space action used error prompt login login authentication Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Docker Shulou Technology NVidia vpn