This topic describes preparations for physical backup of an Oracle database. Before you performing physical backup of an Oracle database, you must enable the archive mode of the Oracle database, obtain the Oracle SID, and query the database program directory.

Enable archive mode

You can use the Recovery Manager (RMAN) tool to back up an Oracle database. The archive mode of an Oracle database is disabled by default. You must enable it first.
  1. Log on to the Oracle database as sysdba.
  2. Execute the ARCHIVE LOG LIST statement to query the archive status of the current database. A similar output is displayed:
    Database log mode              No Archive Mode
    Automatic archival             Disabled
    Archive destination            USE_DB_RECOVERY_FILE_DEST  
    Oldest online log sequence     1    
    Current log sequence           2  
    Note If Archive mode is returned for the Database log mode parameter, the archive mode is enabled. You can stop the Enable archive mode operation here.
  3. Execute the SHUTDOWN IMMEDIATE statement to shut down the database because you cannot enable the archive mode when the database in the OPEN state.
    Warning We recommend that you perform this step during off-peak hours.
  4. Execute the STARTUP MOUNT statement to turn the database to the MOUNT state.
  5. Execute the ALTER DATABASE ARCHIVELOG statement to enable the archive mode.
  6. Execute the ARCHIVE LOG LIST statement again to query the archive status. A similar output is displayed:
    Databaselog mode             Archive Mode
    Automatic archival           Enabled 
    Archive destination          USE_DB_RECOVERY_FILE_DEST 
    Oldest online log sequence  1
    Next log sequence to archive 2 
    Currentlog sequence         2
    Note After the archive mode is enabled, the default log archive path for an Oracle database is $ORACLE_BASE/fast_recovery_area. This directory has only 4 GB of space by default and is also the default path for backup files and flashback logs. To prevent the insufficient space of this directory from causing database exceptions, you can adjust the size of the directory or change the log archive path.
  7. Execute the ALTER DATABASE OPEN statement to start the database.

Obtain the Oracle SID

  • Linux
    Run the following command:
    ps -ef | grep ora_pmon_ | grep -v grep | awk -F "ora_pmon_" '{print "oracle sid: "$NF }' | grep -v print
    The following output indicates that the Oracle SID is orcl:
    oracle sid: orcl
  • Windows
    Run the following command in cmd:
    sc query type=service | findstr SERVICE_NAME | findstr OracleService
    The following output indicates that the Oracle SID is orcl:
    SERVICE_NAME: OracleServiceORCL

Obtain the database program directory

The database program directory is ORACLE_HOME path.
  1. Run the su - oracle command in cmd to log on to the Oracle database.
  2. Execute the echo ORACLE_HOME statement on the Oracle database to view the ORACLE_HOME path.
    The following output indicates that the ORACLE_HOME path is /opt/oracle/product/19c/dbhome_1:
    ====================
    /opt/oracle/product/19c/dbhome_1
    ====================