您好,欢迎访问一九零五行业门户网

Oracle 10备份与恢复之归档模式配置

文章的前面回把开启归档模式及设置归档日志格式等内容放到前面,便于查阅及理清思路。后面会对每一部都进行详细的描述 sqlgt; a
文章的前面回把开启归档模式及设置归档日志格式等内容放到前面,便于查阅及理清思路。后面会对每一部都进行详细的描述
sql> archive log list  //查看当前归档模式
database log mode              no archive mode
automatic archival             disabled
archive destination            use_db_recovery_file_dest
oldest online log sequence     3
current log sequence           5
开启归档模式
sql> shutdown immediate
database closed.
database dismounted.
oracle instance shut down.
sql> startup mount;
oracle instance started.
total system global area  612368384 bytes
fixed size                  2022832 bytes
variable size             222298704 bytes
database buffers          385875968 bytes
redo buffers                2170880 bytes
database mounted.
sql> alter database archivelog;  //开启归档模式
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     3
next log sequence to archive   5
current log sequence           5
修改归档日志存放地
sql> alter system set db_recovery_file_dest=‘’;
system altered.
sql> alter system set log_archive_dest=‘/home/oracle/backup’;
system altered.
sql> archive log list
database log mode              archive mode
automatic archival             enabled
archive destination            /home/oracle/backup
oldest online log sequence     3
next log sequence to archive   5
current log sequence           5
注:
从oracle10g开始默认情况下,归档日志会存放到快速恢复区所对应的目录(对应于初始化参数db_recovery_file_dest)并且会按照特定的格式生成归档日志文件名,如果我们不修改db_recovery_file_dest=‘'为空,,而直接指定log_archive_dest的路径则会报错。如下:
sql> alter system set log_archive_dest='/home/oracle/backup';
alter system set log_archive_dest='/home/oracle/backup'
*
error at line 1:
ora-02097: parameter cannot be modified because specified value is invalid
ora-16018: cannot use log_archive_dest with log_archive_dest_n or
db_recovery_file_dest
sql> alter system set log_archive_format=’arc%s_%r.%t.arc‘ scope=spfile;
system altered.
sql> alter system switch logfile;  //日志格式的修改仍然没有生效,尝试重启数据库使之生效,生成.arc结尾的文件
system altered.
sql> alter database open;
database altered.
sql> alter system switch logfile;  //手工切换,目的是产生归档日志,在backup目录下查看生成的文件
system altered.
cd /home/oracle/backup
$ ls
1_5_736446919.dbf                  1_6_736446919.dbf                  1_7_736446919.dbf                  arc0000000008_0736446919.0001.arc
其它类似信息

推荐信息