数据库自动归档问题?

[复制链接]
查看11 | 回复9 | 2006-11-3 01:02:53 | 显示全部楼层 |阅读模式
请教:为什么不能自动归档?清高手指点,谢谢!!
SQL> archive log list;
Database log mode
Archive Mode
Automatic archival
Disabled
Archive destination
d:\oracle\oradata\tti\archivelog
Oldest online log sequence 0
Next log sequence to archive 1
Current log sequence 1
SQL> alter system archive log start;
System altered.
SQL> archive log list;
Database log mode
Archive Mode
Automatic archival
Enabled
Archive destination
d:\oracle\oradata\tti\archivelog
Oldest online log sequence 0
Next log sequence to archive 1
Current log sequence 1
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area135338868 bytes

Fixed Size
453492 bytes

Variable Size
109051904 bytes

Database Buffers 25165824 bytes

Redo Buffers
667648 bytes

Database mounted.
Database opened.
SQL> archive log list;
Database log mode
Archive Mode
Automatic archival
Disabled --仍旧是不可用
Archive destination
d:\oracle\oradata\tti\archivelog
Oldest online log sequence 0
Next log sequence to archive 1
Current log sequence 1
SQL> spool off;
回复

使用道具 举报

千问 | 2006-11-3 01:02:53 | 显示全部楼层
修改此参数为log_archive_start=TRUE
回复

使用道具 举报

千问 | 2006-11-3 01:02:53 | 显示全部楼层
9i还需要修改log_archive_start参数
http://www.uplinux.com/www/dev/04/550.shtml
1.shutdown normal或shutdown immediate关闭数据库
[oracle@jumper oracle]$ sqlplus "/ as sysdba"



SQL*Plus: Release 9.2.0.4.0 - Production on Sat Oct 15 15:48:36 2005



Copyright (c) 1982, 2002, Oracle Corporation.All rights reserved.





Connected to:

Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production

With the Partitioning option

JServer Release 9.2.0.4.0 - Production



SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.




2.启动数据库到mount状态
SQL> startup mount;

ORACLE instance started.



Total System Global Area101782828 bytes

Fixed Size
451884 bytes

Variable Size
37748736 bytes

Database Buffers 62914560 bytes

Redo Buffers
667648 bytes

Database mounted.


3.启用或停止归档模式
如果要启用归档模式,此处使用
alter database archivelog 命令。
SQL> alter database archivelog;

Database altered.



SQL> alter database open;



Database altered.



SQL> archive log list;

Database log mode
Archive Mode

Automatic archival
Enabled

Archive destination
/opt/oracle/oradata/conner/archive

Oldest online log sequence 148

Next log sequence to archive 151

Current log sequence 151


如果需要停止归档模式,此处使用:
alter database noarchivelog 命令。
SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount;

ORACLE instance started.



Total System Global Area101782828 bytes

Fixed Size
451884 bytes

Variable Size
37748736 bytes

Database Buffers 62914560 bytes

Redo Buffers
667648 bytes

Database mounted.

SQL> alter database noarchivelog;



Database altered.



SQL> alter database open;



Database altered.



SQL> archive log list;

Database log mode
No Archive Mode

Automatic archival
Enabled

Archive destination
/opt/oracle/oradata/conner/archive

Oldest online log sequence 149

Current log sequence 152


4.修改相应的初始化参数
Oracle10g之前,你还需要修改初始化参数使数据库处于自动归档模式。
在pfile/spfile中设置如下参数:
log_archive_start = true
重启数据库此参数生效,此时数据库处于自动归档模式。
也可以在数据库启动过程中,手工执行:
archive log start
使数据库启用自动归档,但是重启后数据库仍然处于手工归档模式。
从Oracle10g开始,log_archive_start参数已经废除
回复

使用道具 举报

千问 | 2006-11-3 01:02:53 | 显示全部楼层
俺是菜鸟,请教斑竹如何修改??注册表里??spfile?init.ora??谢谢
回复

使用道具 举报

千问 | 2006-11-3 01:02:53 | 显示全部楼层
sqlplus /nolog
conn /as sysdba
alter system set log_archive_start=TRUE scope=spfile;
然后restart数据库。
回复

使用道具 举报

千问 | 2006-11-3 01:02:53 | 显示全部楼层
我的数据库版本是9206,请教:是否在spfile文件里添加log_archive_start = true即可??在spfile中我没找到log_archive_start这个参数。
回复

使用道具 举报

千问 | 2006-11-3 01:02:53 | 显示全部楼层
谢谢wsny大哥,问题已经搞定!!
回复

使用道具 举报

千问 | 2006-11-3 01:02:53 | 显示全部楼层
最初由 gufengge 发布
[B]我的数据库版本是9206,请教:是否在spfile文件里添加log_archive_start = true即可??在spfile中我没找到log_archive_start这个参数。 [/B]

关闭数据库,删除spfile,并应用pfile创建之
create spfile from pfile;
再启动数据库就可以了,
当然如果你用的是spfile直接
alter system set log_archive_start = true scope=both;
就可以了,
当然你也可以使用pfile
startup pfile=.....
回复

使用道具 举报

千问 | 2006-11-3 01:02:53 | 显示全部楼层
不要手工更改spfile
回复

使用道具 举报

千问 | 2006-11-3 01:02:53 | 显示全部楼层
谢谢各位老大,在这里问题解决得太快了!!呵呵
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行