sqlpls / as sysdba

进入管理员

shutdown immediate;

关闭数据库

startup mount

mount模式启动数据库

alter database archivelog;

设置数据库为归档模式

查看归档模式

archive log list;

启动数据库

alter database open;

启用自动归档

alter system archive log start;



选择性修改日志文件命名格式(操作完重启数据库生效):

alter system set log_archive_max_processes = 5;
alter system set log_archive_format = "archive_%t_%s_%r.log" scope=spfile;

7)选择性更改日志文件路径:

alter system set log_archive_dest_1='location=/data/archivelog/orcl';

此时 Archive destination的值更改为 /data/archivelog/orcl

再添加一个日志位置可使用以下语句:

alter system set log_archive_dest_2='location=/bak/orcl/archive_log';

8)归档当前重做日志:

select name from v$archived_log;
alter system archive log current;
show parameter log_archive_dest;
alter system set log_archive_dest_1='location=d:\app\Administrator\arch\arch1\’;
alter system set log_archive_dest_2='location=d:\app\Administrator\arch\arch2\’;
select * from v$log;
select * from v$logfile;
alter database add logfile member 'D:\APP\ADMINISTRATOR\ORADATA\YJFH\REDO01a.LOG' to group 1;
alter database add logfile member 'D:\APP\ADMINISTRATOR\ORADATA\YJFH\REDO02a.LOG' to group 2;
alter database add logfile member 'D:\APP\ADMINISTRATOR\ORADATA\YJFH\REDO03a.LOG' to group 3;

进入rman

rman target /


0级增量备份

backup incremental level=0 database format 'D:\app\Administrator\rman\db_%d_%T_%U.bak';

1级增量备份

backup incremental level=1 database format 'D:\app\Administrator\rman\db_%d_%T_%U.bak';

列出备份

list backup of database by backup;

参考资料链接https://blog.csdn.net/tttzzzqqq2018/article/details/132939674