Home > Database > Mysql Tutorial > 归档日志(下)

归档日志(下)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:05:15
Original
1097 people have browsed it

1 sql archive log list; #查看是不是归档方式 2 sql alter system set log_archive_start=true scope=spfile; #启用主动归档 sql alter system set log_archive_dest='location=/oracle/ora9/oradata/arch' scope=spfile; #设置归档路径 sql alter system s

1 sql> archive log list; #查看是不是归档方式
2 sql> alter system set log_archive_start=true scope=spfile; #启用主动归档
sql> alter system set log_archive_dest='location=/oracle/ora9/oradata/arch' scope=spfile;
#设置归档路径
sql> alter system set log_archive_dest_1='location=/oracle/ora9/oradata/arch1' scope=spfile;
sql> alter system set log_archive_dest_2='location=/oracle/ora9/oradata/arch2' scope=spfile;
#如果归档到两个位置,则可以通过上边方法实现
sql> alter system set log_archive_format='arch_%d_%t_%r_%s.log' #设置归档日记款式
3 sql> shutdown immediate;
4 sql> startup mount; #打开控制文件,不打开数据文件
5 sql> alter database archivelog; #将数据库切换为归档模式
6 sql> alter database open; #将数据文件打开
7 sql> archive log list; #查看此时是否处于归档模式
8 查询以确定数据库位于archivelog模式中且归档过程正在运行
sql> select log_mode from v$database;
sql> select archiver from v$instance;
9 日志切换
sql> alter system switch logfile;
10 这次日志切换将归档写到两个目标地,

1 使用ARCHIVE LOG LIST命令可以显示日志操作模式,归档位置,自动归档机器要归档的日志序列号等信息.
archive log list;

2 检查当前日志操作模式
SELECT log_mode from v$database;

3 打开或关闭归档日志
shutdown immediate;
startup monut;
alter database noarchivelog/archivelog ;
alter system set log_archive_dest='/ora_arch' scope=spfile sid='ora11g1';
alter database open;
SQL> alter system set db_recovery_file_dest='' scope=both;
SQL> alter system set log_archive_dest_1='LOCATION=/ora_arch' scope=both;

4 初始化参数LOG_ARCHIVE_FORMAT用于指定归档日志的文件名格式
show parameter log_archive_format; --%t_%s_%r.dbf

5 使用LOG_ARCHIVE_DEST配置归档位置
show parameter LOG_ARCHIVE_DEST;
ALTER SYSTEM SET log_archive_dest='/ora_arch';

6 查看归档日志路径状态信息
select dest_name,destination,status,error from v$archive_dest;

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template