在12c之前,要备份,必须要sysdba权限,即使system用户都不行,从12c开始,新增加了一个新用户 sysbackup,以及权限 sysbackup,有这个权限的用户,就可以进行数据库备份了
sql>create user c##bak identified by bak;
sql>grant connect,sysbackup to c##bak;
rman target '"c##bak/bak@sztech as sysbackup"'
rman >backup spfile;
附操作:
[oracle@dbserver ~]$ rman target '"c##bak/bak@sztech as sysbackup"'
Recovery Manager: Release 12.1.0.2.0 - Production on Tue Jul 30 14:43:33 2019
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: SZTECH (DBID=3310902941)
RMAN> backup spfile;
Starting backup at 30-JUL-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=280 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 30-JUL-19
channel ORA_DISK_1: finished piece 1 at 30-JUL-19
piece handle=/u01/app/oracle/fast_recovery_area/SZTECH/backupset/2019_07_30/o1_mf_nnsnf_TAG20190730T144345_gmzss1yc_.bkp tag=TAG20190730T144345 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 30-JUL-19
Starting Control File and SPFILE Autobackup at 30-JUL-19
piece handle=/u01/app/oracle/fast_recovery_area/SZTECH/autobackup/2019_07_30/o1_mf_s_1014993827_gmzss37l_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 30-JUL-19
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 80.00K DISK 00:00:00 29-JUL-19
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20190729T190723
Piece Name: /u01/app/oracle/fast_recovery_area/SZTECH/backupset/2019_07_29/o1_mf_nnsnf_TAG20190729T190723_gmxnvc70_.bkp
SPFILE Included: Modification time: 29-JUL-19
SPFILE db_unique_name: SZTECH
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Full 17.20M DISK 00:00:00 29-JUL-19
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20190729T190724
Piece Name: /u01/app/oracle/fast_recovery_area/SZTECH/autobackup/2019_07_29/o1_mf_s_1014923244_gmxnvdlg_.bkp
SPFILE Included: Modification time: 29-JUL-19
SPFILE db_unique_name: SZTECH
Control File Included: Ckp SCN: 2488459 Ckp time: 29-JUL-19
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 80.00K DISK 00:00:00 30-JUL-19
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20190730T144345
Piece Name: /u01/app/oracle/fast_recovery_area/SZTECH/backupset/2019_07_30/o1_mf_nnsnf_TAG20190730T144345_gmzss1yc_.bkp
SPFILE Included: Modification time: 30-JUL-19
SPFILE db_unique_name: SZTECH
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Full 17.20M DISK 00:00:00 30-JUL-19
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20190730T144347
Piece Name: /u01/app/oracle/fast_recovery_area/SZTECH/autobackup/2019_07_30/o1_mf_s_1014993827_gmzss37l_.bkp
SPFILE Included: Modification time: 30-JUL-19
SPFILE db_unique_name: SZTECH
Control File Included: Ckp SCN: 2490627 Ckp time: 30-JUL-19
RMAN>
|