oracle11g更改归档模式、目录、日志大小
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
oracle11g更改归档模式、目录、日志大小
一、更改Oracle为归档模式
1.关闭oracle
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
2.启动为mount状态
SQL> startup mount
ORACLE instance started.
Total System Global Area 2572144640 bytes
Fixed Size 2283984 bytes
Variable Size 738199088 bytes
Database Buffers 1828716544 bytes
Redo Buffers 2945024 bytes
Database mounted.
3.更改为归档模式
SQL> alter database archivelog
Database altered.
备注:‘archivelog’为归档模式;‘noarchivelog’为非归档模式。
4.更改数据库为‘打开’状态
SQL> alter database open
5.查看归档模式信息
SQL> archvie log list
它会提示归档的模式、是否启用、参数
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 88
Next log sequence to archive 90
Current log sequence 90
二、更改归档目录
1.查看参数db_recovery_file_dest
(1)“db_recovery_file_dest”是用于定义存储归档日志的目录。通过show parameter命令,显示参数的值为(默认为)fast_recovery_area。示例如下:SQL> show parameter db_recovery
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string D:\oracle\fast_recovery_area db_recovery_file_dest_size big integer 4182M
(2)查看v$recovery_file_dest视图,可得知fast_recovery_area的空间限制、已使用的空间、文件数等。
SQL> select * from v$recovery_file_dest;
NAME SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES
----------- ---------- ----------------- ---------------
D:\oracle\fast_recovery_area 4385144832 4346230272 2741248 102
2.更改归档日志目录
语法:alter system set 参数=值scope=spfile;
示例:SQL> alter system set db_recovery_file_dest='D:\oracle\archivelog' scope=spfile;
System altered.
三、更改归档日志大小
1.查看参数'db_recovery_file_dest_size'值
SQL> show parameter db_recover
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string D:\oracle\archivelog db_recovery_file_dest_size big integer 4182M
2.更改参数'db_recovery_file_dest_size'值大小
SQL> alter system set db_recovery_file_dest_size=41820M scope=spfile; System altered.
3.关闭数据库,重启数据库
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup open;
ORACLE instance started.
Total System Global Area 2572144640 bytes
Fixed Size 2283984 bytes
Variable Size 738199088 bytes
Database Buffers 1828716544 bytes
Redo Buffers 2945024 bytes
Database mounted.
Database opened.
4.再次查看参数'db_recovery_file_dest_size'值
SQL> show parameter db_reco
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string D:\oracle\archivelog db_recovery_file_dest_size big integer 41820M