Home > Database > Mysql Tutorial > Oracle 关闭和开启归档日志

Oracle 关闭和开启归档日志

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:24:51
Original
1250 people have browsed it

Oracle 关闭和开启归档日志 一 设置为归档方式 1 sqlgt; archive log list; #查看是不是归档方式2 sqlgt; alter system set

Oracle 关闭和开启归档日志

一 设置为归档方式

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,即第二步的/oracle/ora9/oradata/arch1和/oracle/ora9/oradata/arch1,,要是要对目录确认

在oracle情况中运行如下查询:
sql> select name from v$archived_log;
而后在操作系统中确认查询所列出的文件
二 设置非归档方式
1 sql> archive log list;  #查看是否是归档方式
2 sql> alter system set log_archive_start=false scope=spfile; #禁用自动归档
3 sql> shutdown immediate;
4 sql> startup mount;    #打开控制文件,不打开数据文件
5 sql> alter database noarchivelog; #将数据库切换为非归档模式
6 sql> alter database open;  #将数据文件打开
7 sql> archive log list;  #查看此时便处于非归档模式

三 归档相关命令

archive log stop;
archive log start;
archive log list;

show parameters;
show parameters log_archive_start;
show parameters log_archive_max_process; #归档进程数
alter system set log_archive_max_process=5; #将归档进程数改为5
select * from v$bgprocess;    #检察后台进程

linux

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