在典型的配置中,仅有一个数据库实例访问oracle数据库,所以仅有一个redo thread存在;在rac环境下,多个实例同时访问同一份数据库文件,每一个实例都有属于自己的redo thread,为每个实例分配单独的redo thread 以避免资源争用。注,重做日志组编号整个数据库级唯一。
THREAD
Property | Description |
---|---|
Parameter type | Integer |
Default value | 0 |
Modifiable | No |
Range of values | 0 to the maximum number of enabled threads |
Real Application Clusters | If specified, multiple instances must have different values. |
THREAD
is a Real Application Clusters parameter that specifies the number of the redo thread to be used by an instance.
When you create a database, Oracle creates and enables thread 1 as apublic thread(one that can be used by any instance). You must create and enable subsequent threads using theADD LOGFILE THREAD
clause andENABLE THREAD
clause of theALTER DATABASE
statement. The number of threads you create is limited by theMAXINSTANCES
parameter specified in theCREATE DATABASE
statement.
In exclusive mode, thread 1 is the default thread. However, you can specifyTHREAD
for an instance running in exclusive mode if you want to use the redo log files in a thread other than thread 1.
In parallel mode, you can specify any available redo thread number, as long as that thread number is enabled and is not in use by another instance.
A value of zero specifies that this instance can use any available, enabled public thread.
--生成新的重做线程对应的重做日志组: ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 4; ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 5; --启用重做线程: ALTER DATABASE ENABLE THREAD 2;
其它对于重做日志的操作与单实例一致。