The process of backing up a whole database online is same as datafiles, you must make the tablespace into the active backup mode for a consistent backup. The key steps are as following.
Make the tablespace USERS into the active backup mode.
SQL> column tb_name format a10; SQL> column df# format 99; SQL> column df_name format a50; SQL> column status format a10; SQL> SELECT t.name AS "TB_NAME", 2 d.file# AS "DF#", 3 d.name AS "DF_NAME", 4 b.status 5 FROM V$DATAFILE d, 6 V$TABLESPACE t, 7 V$BACKUP b 8 WHERE d.TS#=t.TS# 9 AND b.FILE#=d.FILE#; 10 AND t.NAME='USERS';
TB_NAME DF# DF_NAME STATUS ---------- --- -------------------------------------------------- ---------- USERS 4 /u01/app/oracle/oradata/smalldb/users01.dbf NOT ACTIVE
SQL> alter tablespace users begin backup;
Tablespace altered.
SQL> SELECT t.name AS "TB_NAME", 2 d.file# AS "DF#", 3 d.name AS "DF_NAME", 4 b.status 5 FROM V$DATAFILE d, 6 V$TABLESPACE t, 7 V$BACKUP b 8 WHERE d.TS#=t.TS# 9 AND b.FILE#=d.FILE#; 10 AND t.NAME='USERS';
TB_NAME DF# DF_NAME STATUS ---------- --- -------------------------------------------------- ---------- USERS 4 /u01/app/oracle/oradata/smalldb/users01.dbf ACTIVE
Copy the datafile /u01/app/oracle/oradata/smalldb/users01.dbf to the backup destination.
End the active backup mode.
SQL> alter tablespace users end backup;
Tablespace altered.
SQL> SELECT t.name AS "TB_NAME", 2 d.file# AS "DF#", 3 d.name AS "DF_NAME", 4 b.status 5 FROM V$DATAFILE d, 6 V$TABLESPACE t, 7 V$BACKUP b 8 WHERE d.TS#=t.TS# 9 AND b.FILE#=d.FILE#; 10 AND t.NAME='USERS';
TB_NAME DF# DF_NAME STATUS ---------- --- -------------------------------------------------- ---------- USERS 4 /u01/app/oracle/oradata/smalldb/users01.dbf NOT ACTIVE