MTBF两次故障的时间,时间越长越好。
MTTR两次系统恢复的时间,越短越好
修改完参数后若出现报205的错误,检查路径
控制文件
SQL> show parameter control_files
SQL> select * from v$controlfile;
修改路径:
$ cd $ORACLE_HOME/dbs
$ cp spfileorcl.ora spfileorcl.ora.bak
SQL> alter system set control_files='/u01/app/oracle/oradata/orcl/control01.ctl', '/home/oracle/control02.ctl' scope=spfile; 改参数
SQL> shutdown immediate
$ mv /u01/app/oracle/fast_recovery_area/orcl/control02.ctl /home/oracle/control02.ctl
SQL> startup
SQL> show parameter control_files
SQL> select * from v$controlfile;
增加镜像:
SQL> alter system set control_files='/u01/app/oracle/oradata/orcl/control01.ctl', '/home/oracle/control02.ctl', '/home/oracle/control03.ctl' scope=spfile;
SQL> shutdown immediate
$ cp /home/oracle/control02.ctl /home/oracle/control03.ctl
SQL> startup
SQL> show parameter control_files
SQL> select * from v$controlfile;
日志文件:
增加成员和日志组:
SQL> select GROUP#, SEQUENCE#, STATUS, MEMBERS from v$log;
SQL> select GROUP#, MEMBER from v$logfile;
SQL> alter database add logfile member '/home/oracle/redo01b.log' to group 1;
SQL> alter database add logfile member '/home/oracle/redo02b.log' to group 2;
SQL> alter database add logfile member '/home/oracle/redo03b.log' to group 3;
SQL> alter database add logfile group 4 ('/u01/app/oracle/oradata/orcl/redo04.log', '/home/oracle/redo04b.log') size 50M;
FRA:
SQL> show parameter db_recovery
backupset: 10GB, archived log: 5GB
10+5, 10G
开启归档模式:为了保证日志的连续性
SQL> archive log list 检查当前设置
SQL> shutdown immediate
SQL> startup mount
SQL> alter database archivelog;
SQL> alter database open;
SQL> archive log list
SQL> show parameter log_archive_dest
SQL> select group#, sequence#, status, archived from v$log;
SQL> alter system switch logfile; 切换日志文档
SQL> select group#, sequence#, status, archived from v$log;
SQL> select NAME, SEQUENCE#, STATUS from v$archived_log;
$ ls /u01/app/oracle/fast_recovery_area/ORCL
$ rman target / 或rman target sys/password@orcl
RMAN> show all; 查看rman自身所有的数据
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP On;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP clear; 进行清理
RMAN> backup tablespace users;
RMAN> list backup;
SQL> desc v$backup_set 浏览器中也可以查看
指定备份格式:
RMAN> backup as backupset tablespace users; (备份集)
RMAN> backup as compressed backupset tablespace users; (压缩备份集)
RMAN> backup as copy tablespace users; (镜像拷贝)
RMAN> list backup of tablespace users;
RMAN> list copy of tablespace users;