码迷,mamicode.com
首页 > 其他好文 > 详细

备份恢复

时间:2017-08-21 09:56:08      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:name   配置   lan   ada   设置   base   backup   list   tab   

配置可恢复性

Shutdown immediate  关闭数据库

控制文件

SQL> show parameter control_files查看控制文件

SQL> select * from v$controlfile;

修改路径:

$ cd $ORACLE_HOME/dbs   备份目录里 进去后ls查看

$ 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

备份恢复

标签:name   配置   lan   ada   设置   base   backup   list   tab   

原文地址:http://www.cnblogs.com/Mengjia173/p/7402502.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!