ORACLE数据库有两种运行方式:一是归档方式(ARCHIVELOG),归档方式的目的是当数据库发生故障时最大限度恢复所有已提交的事物;二是不归档方式(NOARCHIVELOG),恢复数据库到最近的回收点。我们根据数据库的高可用性和用户可承受丢失的工作量的多少,把我们正式运行的数据库采用为归档方式;那些正在开发和调试的数据库采用不归档方式。
以权限最高用户身份进入数据库
SQL> conn / as sysdba
Connected to an idle instance.
启动数据库
SQL> startup
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 96470608 bytes
Database Buffers 184549376 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> set lines 1000 pages 1000
查看是否在归档模式下
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 2
Current log sequence 4
查看数据库默认归档日志存放目录
SQL> show parameter recover
NAME TYPE VALUE
db_recovery_file_dest string /opt/oracle/flash_recovery_area
db_recovery_file_dest_size big integer 2G
recovery_parallelism integer 0
数据库归档方式配置
1. 正常关闭数据库
SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
2. 启动数据库到加载状态
SQL> startup mount
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 96470608 bytes
Database Buffers 184549376 bytes
Redo Buffers 2973696 bytes
Database mounted.
责任编辑:cyth