oracle建完库后,我们必须先设好的三个参数

无论我们是用dbca建库,还是手工建。在完成了建库的任务后,有三个参数在以后的生产运用中非常重要,通常,我们是需要将其打开的。
第一个是log_checkpoints_to_alert。
SQL> show parameter checkpoint

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_checkpoint_interval integer 0
log_checkpoint_timeout integer 1800
log_checkpoints_to_alert boolean FALSE
SQL> alter system set log_checkpoints_to_alert=true;

System altered.

第二个是archivelog mode

这里介绍两种方式查看归档模式:

1)archive log list

2)select log_mode from v$database

第一种方式,最常用了。至于方式二,还看你有无查看v$database的权限。

我们可以手动归档,也可以让oracle自己归档。

手动归档有两种方法:

1)alter system archive log current

2)alter system switch logfile

方式一需要运行在归档模式下。其实,方式一在逻辑上是包含方式二的。因为,归档前必须日志却。

若设置完归档,我们可以通过v$archived_log进行查询和运用。

自动归档如下:
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 243269632 bytes
Fixed Size 1218748 bytes
Variable Size 79693636 bytes
Database Buffers 159383552 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> alter database noarchivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 16
Current log sequence 19
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> shutdown mount
SP2-0717: illegal SHUTDOWN option
SQL> startup mount
ORACLE instance started.

Total System Global Area 243269632 bytes
Fixed Size 1218748 bytes
Variable Size 79693636 bytes
Database Buffers 159383552 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 16
Next log sequence to archive 19
Current log sequence 19

第三个是fast_start_mttr_target
这个参数的调整可能比较麻烦。具体请参见我的博客:
http://blog.csdn.net/linwaterbin/article/details/7651039
下面简单做一下操作说明:
SQL> show parameter fast_start_mttr_target

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
fast_start_mttr_target integer 0
SQL> alter system set fast_start_mttr_target=24;

System altered.

SQL> show parameter fast_start_mttr_target

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
fast_start_mttr_target integer 24

这里的24秒是个比较靠谱的做法。

你可能感兴趣的:(oracle)