su - oracle
sqlplus /nolog
登录服务端:connect / as sysdba
关闭数据库:shutdown immediate
开启数据库至mount状态:startup mount
开启归档模式:alter database archivelog
修改数据库模式:alter database noarchivelog
查询归档模是否开启:archive log list数据库日志模式 存档模式
自动存档 启用
存档终点 /home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/arch
最早的联机日志序列 337
下一个存档日志序列 339
当前日志序列 339二、删除归档日志
1、登录rman,oracle用户登录:rman target sys/oracle@orcl
2、查看归档日志:crosscheck archive all;
3、删除只保留最近一天的日志:delete archivelog until time 'systate-1';
4、删除全部归档日志:delete expired archivelog all;
[root@sed ~]su - oracle
上一次登录:五 7月 9 14:01:30 CST 2021pts/2 上
-bash-4.2$ sqlplus /nolog
SQL*Plus: Release 12.2.0.1.0 Production on 星期五 7月 9 15:39:31 2021
Copyright (c) 1982, 2016, Oracle. All rights reserved.
SQL> connect / as sysdba
已连接。
SQL> archive log list
数据库日志模式 存档模式
自动存档 启用
存档终点 /home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/arch
最早的联机日志序列 337
下一个存档日志序列 339
当前日志序列 339
SQL> shutdown immediate
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup mount
ORACLE 例程已经启动。
Total System Global Area 1.0033E+10 bytes
Fixed Size 12169944 bytes
Variable Size 2046823720 bytes
Database Buffers 7952400384 bytes
Redo Buffers 21381120 bytes
数据库装载完毕。
SQL> alter database noarchivelog
2 ;
数据库已更改。
SQL> archive log list
数据库日志模式 非存档模式
自动存档 禁用
存档终点 /home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/arch
最早的联机日志序列 337
当前日志序列 339
SQL> quit
从 Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 断开
-bash-4.2$ sqlplus /nolog
SQL*Plus: Release 12.2.0.1.0 Production on 星期五 7月 9 15:41:45 2021
Copyright (c) 1982, 2016, Oracle. All rights reserved.
SQL> connect / as sysdba
已连接。
SQL> shutdown immediate
ORA-01109: 数据库未打开
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup
ORACLE 例程已经启动。
Total System Global Area 1.0033E+10 bytes
Fixed Size 12169944 bytes
Variable Size 2046823720 bytes
Database Buffers 7952400384 bytes
Redo Buffers 21381120 bytes
数据库装载完毕。
数据库已经打开。
SQL> archive log list
数据库日志模式 非存档模式
自动存档 禁用
存档终点 /home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/arch
最早的联机日志序列 337
当前日志序列 339
SQL>