oracle课堂随笔---第二十二天

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle课堂随笔---第二十二天相关的知识,希望对你有一定的参考价值。

备份恢复

配置可恢复性

 冗余

控制文件   (镜像)

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     _1 是默认

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

以上是关于oracle课堂随笔---第二十二天的主要内容,如果未能解决你的问题,请参考以下文章

爱创课堂每日一题第二十二天-什么是Etag?

第二十二天 存储管理

oracle课堂笔记--第十二天

oracle课堂随笔--第十六天

oracle课堂随笔--第十七天

oracle课堂随笔--第十四天