oracle 11gR2 修改数据库为归档模式

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:1296

oracle 11gR2 修改数据库为归档模式

前几天在公司做了oracle 11gR2 rac for aix的安装实验,记录了下将数据库非归档模式改为归档模式的
步骤,和10g步骤差不多,以下为详细步骤:

第一步:设置归档目录大小和路径
[oracle@p520:/oracle/app/oracle]$sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Fri Feb 26 09:56:24 2010
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, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> show parameter db_recover
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string
db_recovery_file_dest_size big integer 0
SQL> alter system set db_recovery_file_dest='+dgrecover' scope=spfile;
System altered.
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DGSYSTEM/orcl/spfileorcl.ora
SQL> alter system set db_recovery_file_dest_size=8G scope=spfile;
System altered.

第二步:修改cluster_database的值为false

QL> alter system set cluster_database=false scope=spfile sid='orcl1';
System altered.

第三步:停止所有节点上的实例

[oracle@p520:/oracle/app/oracle]$srvctl stop database -d orcl

第四步:启动到mount状态,改数据库为archivelog

[oracle@p520:/oracle/app/oracle]$sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Feb 26 10:00:25 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.

SQL> startup mount
ORACLE instance started.
Total System Global Area 2137886720 bytes
Fixed Size 2208496 bytes
Variable Size 1526730000 bytes
Database Buffers 603979776 bytes
Redo Buffers 4968448 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.

第五步:修改cluster_database的值为tuce
SQL> alter system set cluster_database=true scope=spfile sid='orcl1';
System altered.

第六步:关闭数据库,用srvctl 启动所有节点上的实例
SQL> shutdown immediate
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

[oracle@p520:/oracle/app/oracle]$srvctl start database -d orcl

第七步:检查数据库是否为归档模式
[oracle@p520:/oracle/app/oracle]$sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Feb 26 10:05:13 2010
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, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 70
Next log sequence to archive 71
Current log sequence 71

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】