创新互联专注于新河企业网站建设,成都响应式网站建设,商城网站建设。新河网站建设公司,为新河等地区提供建站服务。全流程定制网站开发,专业设计,全程项目跟踪,创新互联专业和态度为您提供的服务
在Oracle 11g,开启archive log模式时,默认归档目录为db_recovery_file_dest指定。此参数在pfile/spfile中可以指定:
db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
需要在mount状态下,更改归档模式
ü 启动到mount状态
SQL> startup mount;
ü 查看归档模式
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 5
Current log sequence 7
ü 修改归档路径,不使用默认的路径
更改log_archive_dest_1参数可更改归档日志目录(pfile/spfile中参数db_recovery_file_dest指定的目录将无效)
SQL> show parameter log_archive_dest_1;
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
log_archive_dest_1 string
修改路径:
SQL> alter system set log_archive_dest_1='location=/u01/oracle/archivelog' scope=spfile;
ü 重新启动到mount状态
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ü 修改成归档模式
SQL> alter database archivelog;
Database altered.
ü 检查归档是否生效
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/oracle/archivelog
Oldest online log sequence 5
Next log sequence to archive 7
Current log sequence 7
SQL> alter database open;
SQL> alter system switch logfile;
System altered.
生成归档文件:
[oracle@oracle archivelog]$ ls
1_7_888826695.dbf