一次归档的历程
C:/Documents and Settings/Administrator>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 12月 23 14:13:22 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
已连接。
SQL> startup fource;
SP2-0714: 无效的 STARTUP 选项组合
SQL> startup force;
ORACLE 例程已经启动。
Total System Global Area 289406976 bytes
Fixed Size 1248576 bytes
Variable Size 96469696 bytes
Database Buffers 184549376 bytes
Redo Buffers 7139328 bytes
数据库装载完毕。
ORA-16038: 日志 2 序列号 6 无法归档
ORA-19504: 无法创建文件""
ORA-00312: 联机日志 2 线程 1:
'D:/ORACLE/PRODUCT/10.2.0/ORADATA/TEST/REDO02.LOG'
SQL> shutdown immediate;
ORA-01109: 数据库未打开
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup
ORACLE 例程已经启动。
Total System Global Area 289406976 bytes
Fixed Size 1248576 bytes
Variable Size 96469696 bytes
Database Buffers 184549376 bytes
Redo Buffers 7139328 bytes
数据库装载完毕。
ORA-16038: 日志 2 序列号 6 无法归档
ORA-19504: 无法创建文件""
ORA-00312: 联机日志 2 线程 1:
'D:/ORACLE/PRODUCT/10.2.0/ORADATA/TEST/REDO02.LOG'
SQL> alter system switch logfile;
alter system switch logfile
*
第 1 行出现错误:
ORA-01109: 数据库未打开
SQL> alter database mount;
alter database mount
*
第 1 行出现错误:
ORA-01100: 数据库已装载
SQL>
SQL> alter database clear unarchived logfile 'D:/ORACLE/PRODUCT/10.2.0/ORADATA/T
EST/REDO02.LOG';
数据库已更改。
SQL> shutdown immediate;
ORA-01109: 数据库未打开
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup
ORACLE 例程已经启动。
Total System Global Area 289406976 bytes
Fixed Size 1248576 bytes
Variable Size 96469696 bytes
Database Buffers 184549376 bytes
Redo Buffers 7139328 bytes
数据库装载完毕。
数据库已经打开。
SQL>
继续手工切换log,等了几分钟没成功,去看了下alert_SID.log:
ARC1: Archiving not possible: No primary destinations
ARC1: Failed to archive thread 1 sequence 7 (4)
Tue Dec 23 15:07:13 2008
ARC0: Failed to archive thread 1 sequence 7 (19504)
ARCH: Archival stopped, error occurred. Will continue retrying
Tue Dec 23 15:07:13 2008
Errors in file d:/oracle/product/10.2.0/admin/test/bdump/test_arc0_3536.trc:
ORA-16038: log 3 sequence# 7 cannot be archived
ORA-19504: failed to create file ""
ORA-00312: online log 3 thread 1: 'D:/ORACLE/PRODUCT/10.2.0/ORADATA/TEST/REDO03.LOG'
Tue Dec 23 15:07:18 2008
ARC1: Archiving not possible: No primary destinations
ARC1: Failed to archive thread 1 sequence 7 (4)
ARCH: Archival stopped, error occurred. Will continue retrying
Tue Dec 23 15:07:18 2008
Errors in file d:/oracle/product/10.2.0/admin/test/bdump/test_arc1_3068.trc:
ORA-16014: log 3 sequence# 7 not archived, no available destinations
ORA-00312: online log 3 thread 1: 'D:/ORACLE/PRODUCT/10.2.0/ORADATA/TEST/REDO03.LOG'
Tue Dec 23 15:07:23 2008
ARC0: Archiving not possible: No primary destinations
ARC0: Failed to archive thread 1 sequence 7 (4)
Tue Dec 23 15:07:28 2008
ARC1: Archiving not possible: No primary destinations
ARC1: Failed to archive thread 1 sequence 7 (4)
后来发现是有个参数被设置错了
想设置如下:
SQL> alter system set log_archive_format='ARC%S_%R.%T' SCOPE=SPFILE;
alter system set log_archive_format='ARC%S_%R.%T' SCOPE=SPFILE
*
第 1 行出现错误:
ORA-32001: 已请求写入 SPFILE, 但是在启动时未指定 SPFILE
狂晕,什么乱七八糟的
再来重新写过参数。OK
show了下参数,没改过来;
重启
SQL> shutdown immediate;
ORA-01109: 数据库未打开
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup
ORACLE 例程已经启动。
Total System Global Area 289406976 bytes
Fixed Size 1248576 bytes
Variable Size 100664000 bytes
Database Buffers 180355072 bytes
Redo Buffers 7139328 bytes
数据库装载完毕。
数据库已经打开。
再show下,没问题了,OK
接下来是操作归档的问题了,发现了个问题,10g后的自动归档时默认的,也没办法停止的,呵呵。。。是不是比较先进
哦,接下来的一切顺利。
总结:
1、做任何事情前先备份spfile;
create pfile from spfile;
2、spfile是无法直接编辑的,但是可以用vim编辑pfile的;
3、可以直接修改pfile后用下面的command写回spfile
create spfile from pfile ;
或者直接用下面的command:
alter system set ...=...;
4、oracle10g后屏蔽了自动归档的属性;