oracle数据库非归档模式,如何解决Oracle数据库的非归档模式迁移到归档模式中存在的问题...

今天在做oracle归档测试的时候发现了几个问题,在这里记录下来希望能得到大家的纰漏和帮助

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Dec 19 17:34:42 2014

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

由于对oracle数据库不太熟悉,在执行了下面的命令的时候感到好奇怪:

SQL> alter database archivelog;

alter database archivelog

*

ERROR at line 1:

ORA-01126: database must be mounted in this instance and not open in any instance

这句话意思是说,要想进行配置归档,必须属于一个数据库实例中,这个在RAC中会出现这个问题可以参见:

点击打开链接

但是我发现我是测试在VM的环境下,不存在这种RAC情况:我试了两种情况第一种可以。只有mount的情况才可以操作
SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount;

ORACLE instance started.

Total System Global Area  417546240 bytes

Fixed Size                  2213936 bytes

Variable Size             314574800 bytes

Database Buffers           96468992 bytes

Redo Buffers                4288512 bytes

Database mounted.

SQL> alter database archivelog;

Database altered.

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup

ORACLE instance started.

Total System Global Area  417546240 bytes

Fixed Size                  2213936 bytes

Variable Size             314574800 bytes

Database Buffers           96468992 bytes

Redo Buffers                4288512 bytes

Database mounted.

Database opened.

SQL> alter database archivelog;

alter database archivelog

*

ERROR at line 1:

ORA-01126: database must be mounted in this instance and not open in any instanc                                          e

SQL> show parameter db_recovery_file_dest;

NAME TYPE

------------------------------------ --------------------------------

VALUE

------------------------------

db_recovery_file_dest string

/u01/app/oracle/flash_recovery

_area

db_recovery_file_dest_size big integer

3882M

发现现在缺省使用的路径为 DB_RECOVERY_FILE_DEST,此路径是和Oracle的Flash_back_recovery 路径混杂在一起的,不太妥当。

所以要进行修改:

SQL> alter system set log_archive_dest = '/u01/app/oracle/arch' scope = spfile;

System altered.

SQL> !ls -lrt /u01/app/oracle

total 48

drwxr-xr-x 2 oracle oinstall 4096 Dec 15 21:25 checkpoints

drwxr-x--- 5 oracle oinstall 4096 Dec 15 22:03 cfgtoollogs

drwxr-x--- 3 oracle oinstall 4096 Dec 15 22:04 oradata

drwxr-x--- 3 oracle oinstall 4096 Dec 15 22:04 admin

drwxrwxr-x 4 oracle oinstall 4096 Dec 15 22:04 diag

drwxr-x--- 4 oracle oinstall 4096 Dec 15 22:06 flash_recovery_area

通过上面的查看你会发现数据库并没有为其创建一个arch目录,在建立日志文件的时候恰恰相反,假如当前目录下有你想创建的

文件你必须要先删除了再创建该文件。这个要注意一下。

SQL> !pwd

/home/oracle

SQL> !mkdir /u01/app/oracle/arch

SQL> !ls -lrt /u01/app/oracle

total 52

drwxr-xr-x 2 oracle oinstall 4096 Dec 15 21:25 checkpoints

drwxr-x--- 5 oracle oinstall 4096 Dec 15 22:03 cfgtoollogs

drwxr-x--- 3 oracle oinstall 4096 Dec 15 22:04 oradata

drwxr-x--- 3 oracle oinstall 4096 Dec 15 22:04 admin

drwxrwxr-x 4 oracle oinstall 4096 Dec 15 22:04 diag

drwxr-x--- 4 oracle oinstall 4096 Dec 15 22:06 flash_recovery_area

drwxr-xr-x 2 oracle oinstall 4096 Dec 19 17:41 arch

SQL>

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值