修改数据库为日志归档.docx

上传人:11****ws 文档编号:3262108 上传时间:2019-05-27 格式:DOCX 页数:8 大小:16.46KB
下载 相关 举报
修改数据库为日志归档.docx_第1页
第1页 / 共8页
修改数据库为日志归档.docx_第2页
第2页 / 共8页
修改数据库为日志归档.docx_第3页
第3页 / 共8页
修改数据库为日志归档.docx_第4页
第4页 / 共8页
修改数据库为日志归档.docx_第5页
第5页 / 共8页
点击查看更多>>
资源描述

1、修改数据库为日志归档摸索查看数据日志是否为归档模式sqlplus /nologSQL conn sys/abc123empcard as sysdba;已连接。SQL select log_mode from v$database;LOG_MODE-NOARCHIVELOGSQL archive log list;数据库日志模式 非存档模式自动存档 禁用存档终点 E:oracleora92RDBMS最早的概要日志序列 868当前日志序列 870SQL select * from v$archive_processes;PROCESS STATUS LOG_SEQUENCE STAT- - -

2、-0 STOPPED 0 IDLE1 STOPPED 0 IDLE2 STOPPED 0 IDLE3 STOPPED 0 IDLE4 STOPPED 0 IDLE5 STOPPED 0 IDLE6 STOPPED 0 IDLE7 STOPPED 0 IDLE8 STOPPED 0 IDLE9 STOPPED 0 IDLE已选择 10 行。修改为归档模式SQL shutdown immediate;数据库已经关闭。已经卸载数据库。ORACLE 例程已经关闭。SQL startup mount;ORACLE 例程已经启动。Total System Global Area 135338868 byt

3、esFixed Size 453492 bytesVariable Size 109051904 bytesDatabase Buffers 25165824 bytesRedo Buffers 667648 bytes数据库装载完毕。SQL alter database archivelog;数据库已更改。SQL alter database open;数据库已更改。SQL alter system archive log start;系统已更改。SQL alter system set log_archive_format= archive_log_%t_%s.arc scope=spfi

4、le;系统已更改。在 Oracle 目录下新建目录如:E:oraclebackuprmanarchivelogSQLalter system set log_archive_dest=E:OracleBackupMYTESTRmanBackupFileArchiveLog scope=spfile;系统已更改。SQL alter system set log_archive_start=true scope=spfile;系统已更改。SQL shutdown immediate;数据库已经关闭。已经卸载数据库。ORACLE 例程已经关闭。SQL startup;ORACLE 例程已经启动。To

5、tal System Global Area 135338868 bytesFixed Size 453492 bytesVariable Size 109051904 bytesDatabase Buffers 25165824 bytesRedo Buffers 667648 bytes数据库装载完毕。数据库已经打开。SQL archive log list;数据库日志模式 存档模式自动存档 启用存档终点 E:oraclebackuprmanarchivelog最早的概要日志序列 868下一个存档日志序列 870当前日志序列 870SQL增加归档日志空间SQL archive log li

6、st;数据库日志模式 存档模式自动存档 启用存档终点 E:oraclebackuprmanarchivelog最早的概要日志序列 868下一个存档日志序列 870当前日志序列 870SQL select * from v$log;SQL select * from v$archive_processes;创建 2 个新的日志组SQL alter database add logfile group 4 (E:OraHome_1oradatamytestREDO04.LOG) size 500M;SQL alter database add logfile group 5 (E:OraHome_

7、1oradatamytestREDO05.LOG) size 500M;切换日志组SQLalter system switch logfile;SQLalter system switch logfile;SQLalter system switch logfile;SQLalter system switch logfile;SQLalter system switch logfile;SQL select * from v$log;GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS- - - - - - -FIRST_CHANGE# FIRS

8、T_TIME- -1 1 15 104857600 1 YES ACTIVE249069 07-6 月 -122 1 13 104857600 1 YES INACTIVE249060 07-6 月 -123 1 14 104857600 1 YES INACTIVE249063 07-6 月 -12GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS- - - - - - -FIRST_CHANGE# FIRST_TIME- -4 1 16 524288000 1 YES ACTIVE249156 07-6 月 -125 1 17 5242880

9、00 1 NO CURRENT249429 07-6 月 -12改变原日志大小删除旧的日志组SQL alter database drop logfile group 1;SQL alter database drop logfile group 2;SQL alter database drop logfile group 3;操作系统下删除原日志组 1、2、3 中的文件删除 E:OraHome_1oradatamytestREDOXX.LOG重建日志组 1、2、3SQL alter database add logfile group 1 (E:OraHome_1oradatamytest

10、REDO01.LOG) size 500M;SQL alter database add logfile group 2 (E:OraHome_1oradatamytestREDO02.LOG) size 500M;SQL alter database add logfile group 3 (E:OraHome_1oradatamytestREDO03.LOG) size 500M;切换日志组SQLalter system switch logfile;系统已更改。查看已经归档的信息SQLselect RECID,NAME,DEST_ID,SEQUENCE#,RESETLOGS_CHANGE

11、#,ARCHIVED,STATUS ,BACKUP_COUNT from v$archived_log;删除归档日志C:Documents and Settingsliquntaorman target sys/abc123恢复管理器: 版本 9.2.0.1.0 - ProductionCopyright (c) 1995, 2002, Oracle Corporation. All rights reserved.连接到目标数据库: MYTEST (DBID=2483970197)RMAN list expired archivelog all;正在使用目标数据库控制文件替代恢复目录说明与恢

12、复目录中的任何存档日志均不匹配RMAN crosscheck archivelog all;分配的通道: ORA_DISK_1通道 ORA_DISK_1: sid=16 devtype=DISK对归档日志的验证失败存档日志文件名 =E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_10.ARC 记录 ID=1 时间戳 =785323400对归档日志的验证失败存档日志文件名 =E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_11.ARC 记录 ID=2 时间戳 =

13、785323458对归档日志的验证失败存档日志文件名 =E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_12.ARC 记录 ID=3 时间戳 =785323486对归档日志的验证失败存档日志文件名 =E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_13.ARC 记录 ID=4 时间戳 =785323488对归档日志的验证失败存档日志文件名 =E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_14

14、.ARC 记录 ID=5 时间戳 =785323498对归档日志的验证失败存档日志文件名 =E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_15.ARC 记录 ID=6 时间戳 =785323528对归档日志的验证失败存档日志文件名 =E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_16.ARC 记录 ID=7 时间戳 =785323622对归档日志的验证失败存档日志文件名 =E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVEL

15、OGARCHIVE_LOG_1_17.ARC 记录 ID=8 时间戳 =785323787已交叉检验的 8 对象RMAN list expired archivelog all;说明与恢复目录中的任何存档日志均不匹配RMAN exit修改语言环境。恢复管理器完成。C:Documents and Settingsliquntaoset nls_lang=american_america.zhs16gbkC:Documents and Settingsliquntaorman target sys/abc123Recovery Manager: Release 9.2.0.1.0 - Produc

16、tionCopyright (c) 1995, 2002, Oracle Corporation. All rights reserved.connected to target database: MYTEST (DBID=2483970197)RMAN crosscheck archivelog all;using target database controlfile instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=17 devtype=DISKvalidation succe

17、eded for archived logarchive log filename=E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_10.ARC recid=1 stamp=785323400validation succeeded for archived logarchive log filename=E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_11.ARC recid=2 stamp=785323458validation succeeded for

18、 archived logarchive log filename=E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_12.ARC recid=3 stamp=785323486validation succeeded for archived logarchive log filename=E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_13.ARC recid=4 stamp=785323488validation succeeded for archive

19、d logarchive log filename=E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_14.ARC recid=5 stamp=785323498validation succeeded for archived logarchive log filename=E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_15.ARC recid=6 stamp=785323528validation succeeded for archived logarc

20、hive log filename=E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_16.ARC recid=7 stamp=785323622validation succeeded for archived logarchive log filename=E:ORACLEBACKUPMYTESTRMANBACKUPFILEARCHIVELOGARCHIVE_LOG_1_17.ARC recid=8 stamp=785323787Crosschecked 8 objectsreport obsolete;RMAN report obsolete;RMAN retention policy will be applied to the commandRMAN retention policy is set to redundancy 5no obsolete backups foundRMAN DELETE ARCHIVELOG ALL ;然后再做一个归档日志SQL alter system switch logfile;系统已更改。

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 重点行业资料库 > 医药卫生

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。