ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 启用oracle数据库归档模式

启用oracle数据库归档模式

原创 Linux操作系统 作者:Candy_pro 时间:2012-03-26 17:16:18 0 删除 编辑
· 查看数据库状态
SQL> alter database open;

Database altered.

SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/arch
Oldest online log sequence     7
Current log sequence           9

· 通过修改初始化参数文件,指定归档文件目录
[oracle@dy1 dbs]$ vi initora1.ora
log_archive_dest_1='location=/home/oracle/app/oracle/arch'

· 将数据库改为归档模式
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  422670336 bytes
Fixed Size                  1336960 bytes
Variable Size             306186624 bytes
Database Buffers          109051904 bytes
Redo Buffers                6094848 bytes
SQL> alter database archivelog;

Database altered.

· 启动数据库并查看数据库状态
SQL> alter database open;

Database altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/arch
Oldest online log sequence     7
Next log sequence to archive   9
Current log sequence           9

SQL> show parameter log_archive_dest_1

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_1                   string      location=/home/oracle/app/orac
                                                 le/arch

SQL> create spfile from pfile;

· 切换日志并查看是否正确产生归档日志
SQL> alter system switch logfile;

System altered.

SQL> !

[oracle@dy1 arch]$ cd /home/oracle/app/oracle/arch
[oracle@dy1 arch]$ ls
1_10_778651832.dbf

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26825102/viewspace-719571/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-03-26

  • 博文量
    3
  • 访问量
    2530