首页 > Linux操作系统 > Linux操作系统 > ORA-01126 错误
软件环境:win7+ORACLE11g(字符集为中文)
问题:
C:\Users\xxx>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期四 10月 27 18:19:42 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
SQL> alter database archivelog;
alter database archivelog
*
第 1 行出现错误:
ORA-01126: 数据库必须已装载到此实例并且不在任何实例中打开
原因:
打开归档功能必须在mount阶段打开,此时我所在的状态是open
SQL> select STATUS from v$instance;
STATUS
------------
OPEN
解决方法:
SQL> shutdown immediate
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup mount
ORACLE 例程已经启动。
Total System Global Area 1381056512 bytes
Fixed Size 1376772 bytes
Variable Size 318770684 bytes
Database Buffers 1048576000 bytes
Redo Buffers 12333056 bytes
数据库装载完毕。
SQL> alter database archivelog; --打开归档功能
数据库已更改。
SQL> archive log list; --查看当前归档日志状态
数据库日志模式 存档模式
自动存档 启用
存档终点 D:\ORACLE\app\ora11g\product\11.2.0\dbhome_2\RDBMS
最早的联机日志序列 113
下一个存档日志序列 115
当前日志序列 115
SQL> alter system set log_archive_format='%s_%t_%r.arc' scope=spfile; --设置归档日志格式,在open状态设置会出现ORA-02095错误
系统已更改。
SQL> alter database open;
数据库已更改。
SQL> alter system switch logfile;
系统已更改。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26171028/viewspace-709800/ ,如需转载,请注明出处,否则将追究法律责任。