Oracle 資料庫歸檔配置-9i,10g,11g

myhuaer發表於2015-06-29
  本月幫客戶9i 資料庫從Solaris 5.8 遷移到 AIX 平臺,並配置RAC ,設定歸檔,所以將Oracle 9i,10g,11g 資料庫設定歸檔的方法一併記錄於此。

Oracle RAC 歸檔配置:

9i:
    ALTER SYSTEM SET log_archive_start=TRUE SCOPE=spfile;

    ALTER SYSTEM SET log_archive_dest_1='location=/u01/oradata/LIS/archive/' SCOPE=spfile;
    ---各節點路徑一致則同意命名,不一致在log_archive_dest_1 前加上SID.
        ALTER SYSTEM SET LIS1.log_archive_dest_1='location=/u01/oradata/LIS/archive/' SCOPE=spfile;
        ALTER SYSTEM SET LIS2.log_archive_dest_1='location=/u01/oradata/LIS/archive/' SCOPE=spfile;

    ALTER SYSTEM SET log_archive_format='arch_%t_%s.arc' SCOPE=spfile;


      ALTER SYSTEM SET cluster_database=FALSE SCOPE=spfile;
  
      $ srvctl stop database -d LIS
  
        STARTUP MOUNT;
        ARCHIVE LOG START;
        ALTER DATABASE ARCHIVELOG;
        ALTER SYSTEM SET cluster_database=TRUE SCOPE=spfile;
        SHUTDOWN IMMEDIATE;

      $ srvctl start database -d LIS

10g:
        ALTER SYSTEM SET log_archive_dest_1='location=/u01/oradata/LIS/archive/' SCOPE=spfile;
        ---各節點路徑一致則同意命名,不一致在log_archive_dest_1 前加上SID.
            ALTER SYSTEM SET LIS1.log_archive_dest_1='location=/u01/oradata/LIS/archive/' SCOPE=spfile;
            ALTER SYSTEM SET LIS2.log_archive_dest_1='location=/u01/oradata/LIS/archive/' SCOPE=spfile;

        ALTER SYSTEM SET log_archive_format='arch_%t_%s_%r.arc' SCOPE=spfile;

        ALTER SYSTEM SET cluster_database=FALSE SCOPE=spfile;

        $ srvctl stop database -d LIS

        STARTUP MOUNT;
        ALTER DATABASE ARCHIVELOG;
        ALTER SYSTEM SET cluster_database=TRUE SCOPE=spfile;
        SHUTDOWN IMMEDIATE;
        
        $ srvctl start database -d LIS

11g:

     ALTER SYSTEM SET log_archive_dest_1='location=/u01/oradata/LIS/archive/' SCOPE=spfile;
        ---各節點路徑一致則同意命名,不一致在log_archive_dest_1 前加上SID.
            ALTER SYSTEM SET LIS1.log_archive_dest_1='location=/u01/oradata/LIS/archive/' SCOPE=spfile;
            ALTER SYSTEM SET LIS2.log_archive_dest_1='location=/u01/oradata/LIS/archive/' SCOPE=spfile;

        ALTER SYSTEM SET log_archive_format='arch_%t_%s_%r.arc' SCOPE=spfile;

        $ srvctl stop database -d LIS

        STARTUP MOUNT;
         ALTER DATABASE ARCHIVELOG;
        SHUTDOWN IMMEDIATE;
        
      $ srvctl start database -d LIS

相對9i 最麻煩,11g 最簡便。如果使用ASM 作為歸檔的路徑 則將 '/u01......' 改為 ’+FRA'(disk group name) 就行。


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

相關文章