Complete Guide to Oracle RMAN Connection and Client Startup

English

Backup is essential in Oracle Database operations. Are you having trouble starting Oracle Recovery Manager (RMAN) or with RMAN connection methods? This article provides a concise explanation of local and remote connection procedures, including the use of the SYSBACKUP privilege recommended in 19c, featuring practical examples.

Conclusion: Fastest Procedures for RMAN Connection

The basic commands to start RMAN and connect to a target database are as follows:

  • Local connection (OS authentication): rman target /
  • Remote connection (via network): rman target user/password@connect_string
  • Privilege specification (Recommended): rman target '"/ as sysbackup"'

RMAN Background and Basic Knowledge

Recovery Manager (RMAN) is a command-line interface dedicated to backup and recovery, included as a standard feature in Oracle Database.

Why use RMAN?

Compared to traditional “user-managed backups” (copying with OS commands), RMAN offers the following advantages:

  • Block-level checking: Detects corrupted blocks and ensures backup integrity.
  • Incremental backups: Extracts only changed data blocks, saving time and storage capacity.
  • Automatic management: Automatically tracks the status of control files and archivelogs, simplifying complex recovery procedures.

RMAN Client Startup and Connection Procedures

1. Verification of Prerequisites

Before execution, please ensure the following environment is prepared:

  • Target OS: Oracle Linux / Windows / Various UNIX flavors
  • Environment Variables: ORACLE_SID and ORACLE_HOME must be correctly configured.
  • Privileges: The executing user must belong to the dba group (for OS authentication).

2. Executing Local Connection (Practical Example)

This is the most common connection method used on the database server.

# 1. Load environment variables
export ORACLE_SID=orcl

# 2. Start RMAN and connect to target
rman target /

Supplementary information on execution results:

If “Recovery Manager: Release 19.0.0.0.0” is displayed and the prompt changes to RMAN>, the connection is successful. Verify that the DBID of the target database is displayed.

Types and Use Cases of RMAN Connection Methods

Choose from the following three patterns depending on the destination and security requirements.

① Local Connection via OS Authentication

Since you can connect without entering a password, this is suitable for automated operations such as shell scripts.

rman target /

② Remote Connection via Network

Connect via the network (Oracle Net) from a terminal where Oracle Client is installed.

rman target /@orcl_alias

③ Connection with Restricted Privileges (SYSBACKUP Privilege)

In Oracle 12c and later, the use of the SYSBACKUP privilege, which is dedicated to backups, is recommended instead of SYSDBA, which holds all privileges.

# Example of connecting with SYSBACKUP privilege
rman target '"/ as sysbackup"'
  • SYSDBA: Allows all operations including database creation and deletion.
  • SYSBACKUP: Restricted to backup/recovery and database startup/shutdown. This is safer for security reasons.

Troubleshooting RMAN Connections

Common errors (ORA errors) encountered during connection and their solutions are summarized below.

Error CodePrimary CauseVerification / Solution
ORA-01031Insufficient privilegesCheck if the OS user belongs to the dba or backupdba group.
ORA-12154TNS resolution failureCheck if the tnsnames.ora description matches the connection identifier (alias).
ORA-01017Invalid username/passwordVerify the existence of the password file. Check if specifications like as sysbackup are missing.

Operational and Security Precautions

  • Avoid using “@” in passwords: It can be confused with the connection string delimiter, causing connection errors.
  • Verify status after connecting: Develop the habit of executing SHOW ALL; immediately after connecting to verify if retention policies and auto-backup settings are as intended.
  • Multitenant (CDB/PDB) Environments:
    • To back up the entire CDB, connect to the root container.
    • For a single PDB, connect remotely using the service name of each PDB, or switch using SET ADVISE etc. after connecting to the CDB (connecting to the CDB is generally recommended).

FAQ: Frequently Asked Questions

Q: Is a password file mandatory for RMAN connection?

A: It is not required for local connections (OS authentication), but a password file must be created on the database server side when connecting remotely as SYSDBA or SYSBACKUP.

Q: How do I exit RMAN?

A: Type EXIT or QUIT at the prompt.

Q: Is a connection to a backup catalog (recovery catalog) mandatory?

A: No. In small to medium-sized environments, it is common practice to store information in the target database’s own “control file.” Consider a recovery catalog for large-scale environments or when long-term preservation is required.

Summary: Points of RMAN Connection

  • RMAN is a powerful standard backup tool for Oracle Database.
  • The basic connection command is rman target /.
  • For improved security, prioritize the use of the SYSBACKUP privilege in operations.
  • In case of connection errors, first check environment variables and OS group settings.

Note: This article covers Oracle Database 19c (screens and default values may differ for other versions).

[reference]
Oracle Database Backup and Recovery Reference, 19c

コメント

Copied title and URL