SQL> conn test/test123
已连接。
SQL> create table t(id number ,name varchar2(10)) ;
表已创建。
SQL> commit ;
提交完成。
SQL> insert into t values(1,'2') ;
已创建 1 行。
这个时候打开另外一个cmd
连接到:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
SQL> select instance_name from v$instance ;
INSTANCE_NAME
----------------
testdb
SQL> shutdown abort ;
ORACLE 例程已经关闭。
SQL> startup
ORACLE 例程已经启动。
Total System Global Area 135339844 bytes
Fixed Size 454468 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
数据库装载完毕。
ORA-16038: 日志 1 序列号 7 无法归档
ORA-12535: TNS: 操作超时
ORA-00312: 联机日志 1 线程 1: 'D:\ORACLE\ORADATA\TESTDB\REDO01.LOG'
SQL> select * from v$log ;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIME
------------- ----------
1 1 7 104857600 1 NO INACTIVE
131673 08-6月 -06
2 1 10 104857600 1 NO INVALIDATED
148113 08-6月 -06
3 1 9 104857600 1 NO INACTIVE
147360 08-6月 -06
SQL> alter system clear archivelog group 1 ;
alter system clear archivelog group 1
*
ERROR 位于第 1 行:
ORA-02065: 非法的 ALTER SYSTEM 选项
SQL> alter database clear unarchived logfile group 1 ;
数据库已更改。
SQL> alter database open ;
数据库已更改。
SQL> select * from v$log ;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIME
------------- ----------
1 1 11 104857600 1 NO CURRENT
168624 09-6月 -06
2 1 10 104857600 1 NO INACTIVE
148113 08-6月 -06
3 1 9 104857600 1 NO INACTIVE
147360 08-6月 -06
SQL> conn test/test123
已连接。
SQL> select * from t ;
未选定行
修改归档
SQL> conn /as sysdba
已连接。
SQL> shutdown immediate ;
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup mount ;
ORACLE 例程已经启动。
Total System Global Area 135339844 bytes
Fixed Size 454468 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
数据库装载完毕。
SQL> alter database noarchivelog ;
数据库已更改。
SQL> alter database open ;
数据库已更改。
SQL> conn test/test123
已连接。
SQL> insert into t values(1,'2') ;
已创建 1 行。
再次打开另外一个cmd
SQL> shutdown abort
ORACLE 例程已经关闭。
SQL> startup
ORACLE 例程已经启动。
Total System Global Area 135339844 bytes
Fixed Size 454468 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
数据库装载完毕。
数据库已经打开。
SQL>