欢迎来到天天文库
浏览记录
ID:43506330
大小:91.01 KB
页数:4页
时间:2019-10-09
《归档日志格式》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、文章的前面回把开启归档模式及设置归档日志格式等内容放到前面,便于查阅及理清思路。后面会对每一部都进行详细的描述 SQL>archiveloglist //查看当前归档模式Databaselogmode NoArchiveModeAutomaticarchival DisabledArchivedestination USE_DB_RECOVERY_FILE_DESTOldestonlinelogsequence 3Currentlogsequence
2、5开启归档模式SQL>shutdownimmediateDatabaseclosed.Databasedismounted.ORACLEinstanceshutdown.SQL>startupmount;ORACLEinstancestarted.TotalSystemGlobalArea 612368384bytesFixedSize 2022832bytesVariableSize 222298704bytesDatabaseBuffers 385875968byte
3、sRedoBuffers 2170880bytesDatabasemounted. SQL>alterdatabasearchivelog; //开启归档模式Databasealtered. SQL>archiveloglistDatabaselogmode ArchiveModeAutomaticarchival EnabledArchivedestination USE_DB_RECOVERY_FILE_DESTOldestonlinelogs
4、equence 3Nextlogsequencetoarchive 5Currentlogsequence 5 修改归档日志存放地SQL>altersystemsetdb_recovery_file_dest=‘’;Systemaltered.#mkdir/oracle/backup/archivelogSQL>altersystemsetlog_archive_dest=‘/oracle/backup/archivelog’;Systemaltered. SQL>archiveloglistDatabaselog
5、mode ArchiveModeAutomaticarchival EnabledArchivedestination /oracle/backup/archivelogOldestonlinelogsequence 3Nextlogsequencetoarchive 5Currentlogsequence 5注:从oracle10g开始默认情况下,归档日志会存放到快速恢复区所对应的目录(对应于初始化参数db_recovery_file_dest)并
6、且会按照特定的格式生成归档日志文件名,如果我们不修改db_recovery_file_dest=‘'为空,而直接指定log_archive_dest的路径则会报错。如下:SQL>altersystemsetlog_archive_dest='/home/oracle/backup';altersystemsetlog_archive_dest='/home/oracle/backup'*ERRORatline1:ORA-02097:parametercannotbemodifiedbecausespecifiedvalueisinvalid
7、ORA-16018:cannotuseLOG_ARCHIVE_DESTwithLOG_ARCHIVE_DEST_norDB_RECOVERY_FILE_DEST SQL>altersystemsetlog_archive_format=’ARC%S_%R.%T.arc‘scope=spfile;Systemaltered.SQL>altersystemswitchlogfile; //日志格式的修改仍然没有生效,尝试重启数据库使之生效,生成.arc结尾的文件Systemaltered.SQL>alterdatabaseopen;Databa
8、sealtered.SQL>altersystemswitchlogfile; //手工切换,目的是产生归档日志,在backup目录下查看生成的文件Systemaltered.c
此文档下载收益归作者所有