Oracle 11g 更改归档模式、目录和日志大小

前端之家收集整理的这篇文章主要介绍了Oracle 11g 更改归档模式、目录和日志大小前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

更改Oracle为归档模式

关闭oracle

sql> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

启动为mount状态

sql> startup mount
ORACLE instance started.

Total System Global Area 9486905344 bytes
Fixed Size		    2215624 bytes
Variable Size		 5234491704 bytes
Database Buffers	 4227858432 bytes
Redo Buffers		   22339584 bytes
Database mounted.

更改为归档模式

sql> alter database archivelog
Database altered.

备注:‘archivelog’为 归档模式;‘noarchivelog’为非归档模式。

更改数据库为‘打开’状态

sql> alter database open

查看归档模式信息

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

更改归档目录

查看参数db_recovery_file_dest

  • 这里是列表文本“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
  • 查看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

更改归档日志目录

语法:alter system set 参数=值 scope=spfile;

sql> alter system set db_recovery_file_dest='D:\oracle\archivelog' scope=spfile;
System altered.

更改归档日志大小

查看参数'db_recovery_file_dest_size'值

sql> show parameter db_recov;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      D:\oracle\archivelog
db_recovery_file_dest_size           big integer 3072M

更改参数'db_recovery_file_dest_size'值大小

sql> alter system set db_recovery_file_dest_size=30720M scope=spfile;
System altered.

关闭数据库,重启数据库

sql> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
sql> startup
ORACLE instance started.

Total System Global Area 9486905344 bytes
Fixed Size		    2215624 bytes
Variable Size		 5234491704 bytes
Database Buffers	 4227858432 bytes
Redo Buffers		   22339584 bytes
Database mounted.
Database opened.

再次查看参数'db_recovery_file_dest_size'值

sql> show parameter db_recov;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      D:\oracle\archivelog
db_recovery_file_dest_size           big integer 30720M

猜你在找的Oracle相关文章