Oracle Grid Infrastructure Tips: differenze tra le versioni

Da Emigar.
Jump to navigation Jump to search
Nessun oggetto della modifica
 
(17 versioni intermedie di 2 utenti non mostrate)
Riga 1: Riga 1:
==Grid Infratructure==
==Grid Infratructure 12c==

===Oracle Listener aggiuntivi===

come grid:
cp -p $ORACLE_HOME/crs/demo/coldfailover/act_listener.pl $ORACLE_HOME/crs/public/

crsctl


===Gestire applicazione generica===
===Gestire applicazione generica===
1) creare un indirizzo IP Virtuale:
1) creare un indirizzo IP Virtuale:

[root@server ~]# appvipcfg create -network=1 -ip=172.16.1.4 -vipname=app.miaapp01.vip -user root
[root@server ~]# appvipcfg create -network=1 -ip=172.16.1.4 -vipname=app.miaapp01.vip -user root
[root@server ~]# crsctl start res app.miaapp01.vip
[root@server ~]# crsctl start res app.miaapp01.vip
[root@server ~]# crsctl modify resource "app.miaapp01.vip" -attr "AUTO_START=1"
2) creare risorsa
[root@server ~]# crsctl modify resource app.miaapp01.vip -attr "ACL='owner:root:rwx,pgrp:root:r-x,other::r--,group:oinstall:r-x,user:grid:r-x'"
[root@server ~]#

2) creare risorsa listener (con home grid)

[grid@server ~]$ crsctl add resource app.LISTENER_${SID}.lsnr -type generic_application -attr \
"ACTION_SCRIPT='%CRS_HOME%/crs/public/act_listener_${sid}.sh',
START_PROGRAM='%CRS_HOME%/crs/public/act_listener_${sid}.sh start',
STOP_PROGRAM='%CRS_HOME%/crs/public/act_listener_${sid}.sh stop',
CLEAN_PROGRAM='%CRS_HOME%/crs/public/act_listener_${sid}.sh clean',
CHECK_PROGRAMS='%CRS_HOME%/crs/public/act_listener_${sid}.sh check',
ENVIRONMENT_VARS='_USR_ORA_HOME=/app/grid/product/12.1.0/grid,_USR_ORA_LSNR=LISTENER_${SID}',
PLACEMENT=restricted,
HOSTING_MEMBERS='node1 node2',
CHECK_INTERVAL=30,
RESTART_ATTEMPTS=2,
START_DEPENDENCIES='pullup(app.database-${sid}.vip,app.DATABASE_${sid}.db) hard(app.database-${sid}.vip,app.DATABASE_${sid}.db)',
STOP_DEPENDENCIES='hard(shutdown:app.database-${sid}.vip,app.DATABASE_${sid}.db)'"

crsctl modify resource "app.LISTENER_${SID}.lsnr" -attr "AUTO_START=1"

crsctl setperm resource app.LISTENER_${SID}.lsnr -u user:root:r-x,user:oracle:r-x

Per visualizzare la configurazione:

crsctl status resource app.LISTENER_${SID}.lsnr -f


3) creare risorsa listener (con home rdbms)
4) crea risorsa database
[oracle@server ~]$ crsctl add resource app.DATABASE_${sid}.db -type generic_application -attr \
"ACTION_SCRIPT='%CRS_HOME%/crs/public/act_database_${sid}.sh',
START_PROGRAM='%CRS_HOME%/crs/public/act_database_${sid}.sh start',
STOP_PROGRAM='%CRS_HOME%/crs/public/act_database_${sid}.sh stop',
CLEAN_PROGRAM='%CRS_HOME%/crs/public/act_database_${sid}.sh clean',
CHECK_PROGRAMS='%CRS_HOME%/crs/public/act_database_${sid}.sh check',
ENVIRONMENT_VARS='_USR_ORA_HOME=/app/oracle/product/11.2.0/dbhome_1,_USR_ORA_SID=${sid}',
PLACEMENT=restricted,
HOSTING_MEMBERS='node1 node2',
CHECK_INTERVAL=30,
SCRIPT_TIMEOUT=120,
RESTART_ATTEMPTS=2,
AUTO_START=1"

impostare poi le dipendenze:

crsctl modify resource app.DATABASE_${sid}.db -attr "START_DEPENDENCIES=pullup(app.database-${sid}.vip) hard(app.database-${sid}.vip)"
crsctl modify resource app.DATABASE_${sid}.db -attr "STOP_DEPENDENCIES=hard(app.database-${sid}.vip)"


===Oracle ASM Cluster Filesystem===
===Oracle ASM Cluster Filesystem===


Per creare un cluster filesystem:
Per creare un cluster filesystem (testato con GI 12.1.0.2):
grid@server:~$ echo 'ALTER DISKGROUP DATA ADD VOLUME MIOVOL01 SIZE 10G;' | sqlplus '/ as sysasm'
grid@server:~$ echo 'ALTER DISKGROUP DATA ADD VOLUME MIOVOL01 SIZE 10G;' | sqlplus '/ as sysasm'


Riga 24: Riga 80:
root@server:~# /bin/mount -t acfs /dev/asm/miovol01-21 /MIOVOL01
root@server:~# /bin/mount -t acfs /dev/asm/miovol01-21 /MIOVOL01


Per resize, da utente grid (ma funziona anche da root):
grid@server:~$ acfsutil info fs /MIOVOL01
grid@server:~$ acfsutil size +1024M /MIOVOL01

Per creare volumi più grandi di 4Gb:
grid@server:~$ echo "alter diskgroup datap set ATTRIBUTE 'compatible.advm' = '11.2.0.4.0';" | sqlplus '/ as sysasm'


[[Categoria: Database]]
[[Categoria: Database]]
[[Categoria:Oracle]]

Versione attuale delle 09:18, 22 set 2017

Grid Infratructure 12c

Oracle Listener aggiuntivi

come grid:

cp -p $ORACLE_HOME/crs/demo/coldfailover/act_listener.pl $ORACLE_HOME/crs/public/
crsctl

Gestire applicazione generica

1) creare un indirizzo IP Virtuale:

[root@server ~]# appvipcfg create -network=1 -ip=172.16.1.4 -vipname=app.miaapp01.vip -user root
[root@server ~]# crsctl start res app.miaapp01.vip
[root@server ~]# crsctl modify resource "app.miaapp01.vip" -attr "AUTO_START=1"
[root@server ~]# crsctl modify resource app.miaapp01.vip -attr "ACL='owner:root:rwx,pgrp:root:r-x,other::r--,group:oinstall:r-x,user:grid:r-x'"

2) creare risorsa listener (con home grid)

[grid@server ~]$ crsctl add resource app.LISTENER_${SID}.lsnr -type generic_application -attr \
 "ACTION_SCRIPT='%CRS_HOME%/crs/public/act_listener_${sid}.sh',
  START_PROGRAM='%CRS_HOME%/crs/public/act_listener_${sid}.sh start',
  STOP_PROGRAM='%CRS_HOME%/crs/public/act_listener_${sid}.sh stop',
  CLEAN_PROGRAM='%CRS_HOME%/crs/public/act_listener_${sid}.sh clean',
  CHECK_PROGRAMS='%CRS_HOME%/crs/public/act_listener_${sid}.sh check',
  ENVIRONMENT_VARS='_USR_ORA_HOME=/app/grid/product/12.1.0/grid,_USR_ORA_LSNR=LISTENER_${SID}',
  PLACEMENT=restricted,
  HOSTING_MEMBERS='node1 node2',
  CHECK_INTERVAL=30,
  RESTART_ATTEMPTS=2,
  START_DEPENDENCIES='pullup(app.database-${sid}.vip,app.DATABASE_${sid}.db) hard(app.database-${sid}.vip,app.DATABASE_${sid}.db)',
  STOP_DEPENDENCIES='hard(shutdown:app.database-${sid}.vip,app.DATABASE_${sid}.db)'"
  crsctl modify resource "app.LISTENER_${SID}.lsnr" -attr "AUTO_START=1"
  crsctl setperm resource app.LISTENER_${SID}.lsnr -u user:root:r-x,user:oracle:r-x

Per visualizzare la configurazione:

  crsctl status resource app.LISTENER_${SID}.lsnr -f


3) creare risorsa listener (con home rdbms)

4) crea risorsa database

[oracle@server ~]$ crsctl add resource app.DATABASE_${sid}.db -type generic_application -attr \
 "ACTION_SCRIPT='%CRS_HOME%/crs/public/act_database_${sid}.sh',
  START_PROGRAM='%CRS_HOME%/crs/public/act_database_${sid}.sh start',
  STOP_PROGRAM='%CRS_HOME%/crs/public/act_database_${sid}.sh stop',
  CLEAN_PROGRAM='%CRS_HOME%/crs/public/act_database_${sid}.sh clean',
  CHECK_PROGRAMS='%CRS_HOME%/crs/public/act_database_${sid}.sh check',
  ENVIRONMENT_VARS='_USR_ORA_HOME=/app/oracle/product/11.2.0/dbhome_1,_USR_ORA_SID=${sid}',
  PLACEMENT=restricted,
  HOSTING_MEMBERS='node1 node2',
  CHECK_INTERVAL=30,
  SCRIPT_TIMEOUT=120,
  RESTART_ATTEMPTS=2,
  AUTO_START=1"

impostare poi le dipendenze:

 crsctl modify resource app.DATABASE_${sid}.db -attr "START_DEPENDENCIES=pullup(app.database-${sid}.vip) hard(app.database-${sid}.vip)"
 crsctl modify resource app.DATABASE_${sid}.db -attr "STOP_DEPENDENCIES=hard(app.database-${sid}.vip)"

Oracle ASM Cluster Filesystem

Per creare un cluster filesystem (testato con GI 12.1.0.2):

grid@server:~$ echo 'ALTER DISKGROUP DATA ADD VOLUME MIOVOL01 SIZE 10G;' | sqlplus '/ as sysasm'

in alternativa si può fare da asmcmd:

grid@server:~$ asmcmd volcreate -G DATA -s 10G MIOVOL01

Formattare il device:

grid@server:~$ mkfs -t acfs -n "MIOVOL01" /dev/asm/miovol01-21

Da utente root:

root@server:~# srvctl add volume -volume MIOVOL01 -diskgroup DATA -device /dev/asm/miovol01-21
root@server:~# /sbin/acfsutil registry -a -n node1,node2 /dev/asm/miovol01-21 /MIOVOL01
root@server:~# /bin/mount -t acfs /dev/asm/miovol01-21 /MIOVOL01

Per resize, da utente grid (ma funziona anche da root):

grid@server:~$ acfsutil info fs /MIOVOL01
grid@server:~$ acfsutil size +1024M /MIOVOL01

Per creare volumi più grandi di 4Gb:

 grid@server:~$ echo "alter diskgroup datap set ATTRIBUTE 'compatible.advm' = '11.2.0.4.0';" | sqlplus '/ as sysasm'