oracle 11g RAC : Archivelog save in OCFS2 (version 2)

23 Sep

oracle 11g RAC : Archivelog save in OCFS2 (version 2)

Oracle merelease file system ocfs2 yang dapat digunakan untuk keperluan cluster file system, jenis file system ini selain untuk keperluan grid computing (10g, 11g) juga dapat digunakan untuk keperluan saya, yaitu mengumpulkan archive file.

Saya kutip dari http://en.wikipedia.org/wiki/OCFS2

“OCFS (Oracle Cluster File System) It is a shared storage file system developed by Oracle Corporation and released under the GNU General Public License.

OCFS2 (version 2) was integrated into the version 2.6.16 of Linux kernel. Initially, it was marked as “experimental” (Alpha-test) code. This restriction was removed in Linux version 2.6.19.

OCFS2 uses a distributed lock manager which resembles the OpenVMS DLM but is much simpler.”

1. menyiapkan harddisk untuk archive (saya simpan di Storage Area Network / vmware disk share)
[root@node1 ~]# fdisk -l /dev/sdf
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-49278, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-49278, default 49278):
Command (m for help): w

2. format ocfs2 (hanya di lakukan di salah satu node)
[root@node1 ~]# mkfs.ocfs2 -F -b 4K -C 32K -N 4 -L oradatafiles /dev/sdf1
3. mountpoint otomatis, tambahkan di /etc/fstab, di semua node
[root@node1 ~]# vi /etc/fstab
/dev/sdf1 /u03 ocfs2 _netdev,datavolume 0 0
[root@node2 ~]# vi /etc/fstab
/dev/sdf1 /u03 ocfs2 _netdev,datavolume 0 0

4. konfigurasi agar ocfs run pada saat booting, di semua node
[root@node1 ~]# /etc/init.d/o2cb configure
Configuring the O2CB driver.
This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot. The current values will be shown in brackets (‘[]’). Hitting
<ENTER> without typing an answer will keep that current value. Ctrl-C
will abort.
Load O2CB driver on boot (y/n) [n]: y
Cluster to start on boot (Enter “none” to clear) [ocfs2]:
Writing O2CB configuration: OK
Cluster ocfs2 already online

[root@node2 ~]# /etc/init.d/o2cb configure
Configuring the O2CB driver.
This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot. The current values will be shown in brackets (‘[]’). Hitting
<ENTER> without typing an answer will keep that current value. Ctrl-C
will abort.
Load O2CB driver on boot (y/n) [n]: y
Cluster to start on boot (Enter “none” to clear) [ocfs2]:
Writing O2CB configuration: OK
Cluster ocfs2 already online
5. hak & security
[root@node1 ~]# mkdir /u03
[root@node1 ~]# mount /dev/sdf1 /u03 -t ocfs2
[root@node1 ~]# chown oracle.oinstall /u03
[root@node1 ~]# chmod 775 /u03
[root@node1 ~]# ls -ld /u03

[root@node2 ~]# mkdir /u03
[root@node2 ~]# mount /dev/sdf1 /u03 -t ocfs2
[root@node2 ~]# chown oracle.oinstall /u03
[root@node2 ~]# chmod 775 /u03
[root@node2 ~]# ls -ld /u03
6. Mengubah mode archive log pada Oracle 11g RAC
a. apakah database Instance masih hidup ?
[oracle@node1 ~]$ srvctl status database -d node
Instance node1 is running on node node1
Instance node2 is running on node node2

b. matikan database Instance
[oracle@node1 ~]$ srvctl stop database -d node

c. Menyiapkan salah satu database instance agar diset menjadi mode archive log, dengan mengirimkan perintah instance mount
[oracle@node1 ~]$ srvctl start instance -d node -i node1 -o mount
[oracle@node1 ~]$ srvctl status database -d node
Instance node1 is running on node node1
Instance node2 is not running on node node2

[oracle@node1 ~]$ sqlplus / as sysdba
SQL> alter database archivelog;
Database altered.

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +DATA1
Oldest online log sequence 3
Current log sequence 4
SQL> exit

d. restart database instance
[oracle@node1 ~]$ srvctl stop instance -d node -i node1
[oracle@node1 ~]$ srvctl start database -d node
[oracle@node1 ~]$ srvctl status database -d node
Instance node1 is running on node node1
Instance node2 is running on node node2

7. Mengarahkan archive log pada Oracle 11g RAC ke folder tertentu
SQL> alter system set log_archive_dest_1=’location=/u03/archive01′;
System altered.

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u03/archive01
Oldest online log sequence 42
Next log sequence to archive 43
Current log sequence 43
SQL> exit;

One Response to “oracle 11g RAC : Archivelog save in OCFS2 (version 2)”

  1. ase January 30, 2009 at 4:25 am #

    mau tanya pak
    klo sy login pake root bukan oracle, perintah ini
    SQL> alter database archivelog;
    Database altered.

    sharusnya bisa ga? soalnya sy coba untuk user root selalu

    *
    ERROR at line 1:
    ORA-01126: database must be mounted EXCLUSIVE and not open for this operation

    bisa diberi penjelasannya🙂

    thanks a lot

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: