oracle 11gR2 改資料庫為歸檔模式

paulyibinyi發表於2010-02-27

        前幾天在公司做了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

 

 

 

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-628045/,如需轉載,請註明出處,否則將追究法律責任。

相關文章