• No se han encontrado resultados

El Acceso a la Cultura como Derecho Fundamental

In document UNIVERSIDAD DE CHILE (página 42-56)

In this practice, you configure the DBFS file system to be mounted by the Oracle Clusterware services.

Assumptions

Practices 4-1 and 4-2 have been successfully carried out, the RAC instance is running, and DBFS has been successfully deployed and manually started.

Tasks

1. On both nodes, you must dismount the DBFS file system. Start with ol6-121-rac1. Click the ol6-121-rac1 virtual machine window, select the terminal shell open there, and type in the following commands:

[OS] $ /u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh stop unmounting DBFS from /oracle/dbfs_dir

umounting the filesystem using '/bin/fusermount -u /oracle/dbfs_direct'

Stop - stopped, now not mounted [OS] $ df –h

2. Dismount DBFS on the second node. Click the VirtualBox window that contains the ol6-121-rac2 virtual machine and reuse the terminal shell open there:

[OS] $ /u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh stop unmounting DBFS from /oracle/dbfs_dir

umounting the filesystem using '/bin/fusermount -u /oracle/dbfs_direct'

Stop - stopped, now not mounted [OS] $ df –h

Oracle University and Error : You are not a Valid Partner use only

3. Only on the first node, copy the add-dbfs-resource.sh file from /media/sf_install to /home/oracle. Make the file executable and display its contents on the screen. Click the ol6-121-rac1 virtual machine window, select the terminal shell open there, and type the commands below:

[OS prompt]$ cp /media/sf_install/add-dbfs-resource.sh ~ [OS prompt]$ cd ~

[OS prompt]$ chmod +x add-dbfs-resource.sh [OS prompt]$ cat add-dbfs-resource.sh

##### start script add-dbfs-resource.sh

#!/bin/bash

ACTION_SCRIPT=/u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh RESNAME=dbfs_mount

DBNAME=OGGRAC

DBNAMEL=`echo $DBNAME | tr A-Z a-z`

ORACLE_HOME=/u01/app/12.1.0.2/grid PATH=$ORACLE_HOME/bin:$PATH

export PATH ORACLE_HOME

crsctl add resource $RESNAME \ -type local_resource \

-attr "ACTION_SCRIPT=$ACTION_SCRIPT, \

CHECK_INTERVAL=30,RESTART_ATTEMPTS=10, \

START_DEPENDENCIES='hard(ora.$DBNAMEL.db)pullup(ora.$DBNAMEL.db) ',\

STOP_DEPENDENCIES='hard(ora.$DBNAMEL.db)',\

SCRIPT_TIMEOUT=300"

##### end script add-dbfs-resource.sh

Note: Make sure that the "-type" subcommand for crsctl is "local_resource." You will modify that entry in Practice 12, but here the dbfs_mount resource must be defined as

"local" rather than "cluster."

The shell file sets some environment variables that are needed for crsctl to work. Then it invokes crsctl, defining the dbfs_mount service.

4. Execute the add-dbfs-resource.sh shell file. Then use the grid_env alias to set the environment for Oracle Clusterware and verify that CRS is aware of the newly added dbfs_mount service:

[OS prompt]$ ./add-dbfs-resource.sh [OS prompt]$ grid_env

[OS prompt]$ crsctl stat res dbfs_mount NAME=dbfs_mount

TYPE=local_resource TARGET=OFFLINE, OFFLINE STATE=OFFLINE, OFFLINE [OS prompt]$

Oracle University and Error : You are not a Valid Partner use only

5. Use crsctl to start the dbfs_mount service, and check that the service was effectively started:

[OS prompt]$ crsctl start resource dbfs_mount

CRS-2672: Attempting to start 'dbfs_mount' on 'ol6-121-rac1' CRS-2672: Attempting to start 'dbfs_mount' on 'ol6-121-rac2' CRS-2676: Start of 'dbfs_mount' on 'ol6-121-rac2' succeeded CRS-2676: Start of 'dbfs_mount' on 'ol6-121-rac1' succeeded [OS prompt]$ crsctl stat res dbfs_mount

NAME=dbfs_mount TYPE=local_resource

TARGET=ONLINE , ONLINE

STATE=ONLINE on ol6-121-rac1, ONLINE on ol6-121-rac2 [OS prompt]$

6. On both nodes, verify that DBFS is mounted and that you can read and write in the FS1 directory:

[OS prompt]$ df -h

Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_ol6121rac1-lv_root

45G 20G 23G 47% /

tmpfs 1.9G 632M 1.3G 34% /dev/shm /dev/sda1 477M 127M 321M 29% /boot

install 699G 525G 174G 76% /media/sf_install dbfs-dbfs_user@:/ 3.0G 120K 3.0G 1% /oracle/dbfs_direct [OS prompt]$ ls -l /oracle/dbfs_direct/FS1

total 0

-rw-r--r-- 1 oracle oinstall 0 Apr 1 14:03 try.txt [OS prompt]$ touch /oracle/dbfs_direct/FS1/try2.txt [OS prompt]$ ls -l /oracle/dbfs_direct/FS1/

total 0

-rw-r--r-- 1 oracle oinstall 0 Apr 1 15:45 try2.txt -rw-r--r-- 1 oracle oinstall 0 Apr 1 14:03 try.txt [OS prompt]$

Oracle University and Error : You are not a Valid Partner use only

7. Click the VirtualBox window that contains the ol6-121-rac2 virtual machine and reuse the terminal shell open there. Verify that DBFS was in fact mounted by CRS. Also, verify that you can access the file that you just created (try2.txt) and also write files from the second node:

[OS prompt]$ df -h

Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_ol6121rac1-lv_root

45G 20G 23G 47% /

tmpfs 1.9G 628M 1.3G 33% /dev/shm /dev/sda1 477M 127M 321M 29% /boot

install 699G 525G 174G 76% /media/sf_install dbfs-dbfs_user@:/ 3.0G 120K 3.0G 1% /oracle/dbfs_direct [OS prompt]$ ls -l /oracle/dbfs_direct/FS1

total 0

-rw-r--r-- 1 oracle oinstall 0 Apr 1 15:45 try2.txt -rw-r--r-- 1 oracle oinstall 0 Apr 1 14:03 try.txt [OS prompt]$ touch /oracle/dbfs_direct/FS1/try3.txt [OS prompt]$ ls -l /oracle/dbfs_direct/FS1

total 0

-rw-r--r-- 1 oracle oinstall 0 Apr 1 15:45 try2.txt -rw-r--r-- 1 oracle oinstall 0 Apr 1 15:52 try3.txt -rw-r--r-- 1 oracle oinstall 0 Apr 1 14:03 try.txt

8. DBFS was in fact mounted by the Oracle Clusterware services, and both nodes can read and write in the shared device. This last step concludes Practice 4-3. You must now

gracefully terminate the VirtualBox session. First, stop the OGGRAC database. You must use the FORCE option of the srvctl command (-f) because DBFS is mounted and the

database cannot be stopped unless the force qualifier is used. Then "hibernate" the two virtual machines comprising the RAC configuration. Click the ol6-121-rac1 virtual machine window, select the terminal shell open there, and type the commands below:

[OS prompt]$ db_env

[OS prompt]$ srvctl stop database –d OGGRAC –f [OS prompt]$

Oracle University and Error : You are not a Valid Partner use only

9. Click the ol6-121-rac1 virtual machine window and use the su command to log in as root. Shut down the virtual machine by using the Linux shutdown command:

[OS prompt]$ su – Password: ******

[OS prompt]# shutdown –h now

Broadcast message from [email protected] (/dev/pts/0) at 22:41 ...

The system is going down for halt NOW!

[OS prompt]#

10. Click the ol6-121-rac2 virtual machine and use the su command to log in as root. Shut down also this virtual machine by using the Linux shutdown command.

[OS prompt]$ su – Password: ******

[OS prompt]# shutdown –h now

Broadcast message from [email protected] (/dev/pts/0) at 22:43 ...

The system is going down for halt NOW!

[OS prompt]#

This last step ends practice 4-3. This completes Practice 4 for Oracle GoldenGate 12c Advanced Configuration for Oracle.

Oracle University and Error : You are not a Valid Partner use only

Oracle University and Error : You are not a Valid Partner use only

In document UNIVERSIDAD DE CHILE (página 42-56)