Please send your Questions & Answers or Feedback to "dvmadhavreddy@javabook.org"

Please send your Questions & Answers or Feedback to "mohan@javabook.org"

Automatic Storage Management


root> uname
root> uname -r
root> cat /etc/issue
root> uname -a
root> getconf LONG_BIT
root> cat /etc/passwd |grep oracle
root> cat /etc/group |grep oinstall
root> userdel -r oracle
root> groupdel oinstall
root> groupdel dba

Creating Users and Groups
root> groupadd oinstall
root> groupadd dba
root> groupadd oper
root> groupadd asmoper
root> groupadd asmdba
root> groupadd asmadmin
root> useradd -m -g oinstall -G asmadmin,asmdba,asmoper grid
root> useradd -m -g oinstall -G dba,asmdba oracle
root> passwd grid
root> passwd oracle

Creating grid directories
root> mkdir -p /u01/app/grid
root> chown -R grid:oinstall /u01/app/grid
root> chmod -R 775 /u01/app/grid
root> mkdir -p /u01/product/11.2.0/grid_home
root> chown -R grid:oinstall /u01/product/11.2.0/grid_home
root> chmod -R 775 /u01/product/11.2.0/grid_home
root> mkdir -p /u01/app/oraInventory
root> chown -R grid:oinstall /u01/app/oraInventory
root> chmod -R 775 /u01/app/oraInventory

Creating oracle home
root> mkdir -p /u01/app/oracle
root> chown -R oracle:oinstall /u01/app/oracle
root> chmod -R 775 /u01/app/oracle
root> mkdir -p /u01/app/oracle/product/11.2.0/db_home
root> chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/db_home
root> chmod -R 775 /u01/app/oracle/product/11.2.0/db_home
root> cat /etc/sysctl.conf --> to see kernel parameters

Oracle user gets the limits by default and we need to set the limits for grid user.

root> vi /etc/security/limits.conf
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
:wq!

Creating Partitions
root> fdisk -l
root> fdisk /dev/hda
-press m and enter
-press n and enter
-press p and enter

partition number :1

Dont give size for first cylinder give +2g for last cylinder.
-press p --> to see the partitions
-press n and enter
-press e

partition number :2
Dont specify size for first and last cylinder for extended partition.
command : p
command : n
press l and enter

specify +5g for last cylinder of the logical partition
command : p
command : n
press l and enter

specify +5g for last cylinder of the logical partition
command : wq
root> partprobe --> updates the changes to kernel version.
root> dd if=/dev/zero of=/dev/hda5 bs=8192 count=2560
-repeat it for all
root> rpm -qa|grep oracleasm
root> rpm -qa|grep oracleasm|wc -l
root> cd /opt
root opt> ls
root opt> rpm -ivh oracleasmlib.rpm


Configuring Oracle ASM
root> oracleasm configure -i
default user : grid
default group : asmadmin
start oracle asm : y
scan for oracle asm :y
root> df -kh
root> df -ah
root> oracleasm init
root> cd /dev/oracleasm
root oracleasm> ls
root oracleasm> cd disks
root disks> ls
root> fdisk -l
root> oracleasm createdisk VOL1 /dev/hda5
root> oracleasm createdisk VOL2 /dev/hda6
root> oracleasm listdisks
root> oracleasm scandisks
root> cd /dev/oracleasm
root oracleasm> cd disks
root disks> ls
 

Installing GRID software
unzip 1of7, 2of7 and 3of7 zip files to get database and GRID software.
root> xhost +
root> su - grid
grid> vncpasswd
grid> vncserver
grid> vncserver
grid> vncviewer
grid> cd /opt/grid
grid grid> ls
grid grid> ./runInstaller
-skip software updates
-configure GIS for standalone server
-give disk group name
-redundancy = extenal
-select one volume
-use password for all these account
-yes
-oracle base
-software location = /u01/product/11.2.0/grid_home
-yes
-install
-copy paste and run 2 scripts in root user
-run first script
root> cat /etc/inittab
-run second script
root> cat /etc/inittab
-close




Configuring .bash_profile
grid> vi .bash_profile
export ORACLE_HOME=/u01/product/11.2.0/grid_home
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
:wq!
grid> . .bash_profile


Installing Oracle Software in oracle user



grid> ps -ef|grep smon
grid> export ORACLE_SID=+asm
grid> sqlplus / as sysasm
SQL> show parameter instance_type;
SQL> exit
grid> crs_stat -t
-all should be online except ora.ons.type
grid> crsctl check css


Configuring .bash_profile
oracle> vi .bash_profile
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_home
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
:wq!
oracle> . .bash_profile

grid> !exp
SQL> select * from v$diag_info;

root> tail -f alert_+ASM.log




Creating Disk Group using ASMCA
grid> which asmca
grid> asmca
-create
-disk group name - ASM_DG_DATA
-external
-select VOL
-ok
-exit
-yes
grid> !exp

Creating Disk group Manually
SQL> create diskgroup ASM_DG_FRA external redundancy disk 'ORCL:VOL3' size 4777m;
SQL> desc V$asm_diskgroup;
SQL> select name,group_number,state from v$asm_diskgroup;
SQL> desc v$asm_disk;
SQL> exit

grid> asmcmd
asmcmd> ls
asmcmd> lsdg
asmcmd> lsct
asmcmd> exit

Create database using DBCA
-create database
-general purpose
-name : sales
-deselect 'configure enterprise manager'
-use same admin password
-storage type : ASM
-use common location for all database files
-browse
-select ASM_DG_DATA
-ok
-select 'Fast Recovery Area'
-browse
-select ASM_DG_FRA
-enable archiving
-finish -ok

oracle> export ORACLE_SID=sales
oracle> sqlplus / as sysdba
SQL> select name,open_mode,log_mode from v$database;
SQL> select instance_name,status from v$instance;
SQL> select name from v$datafile;
SQL> select name from v$controlfile;
SQL> select member from v$logfile;
SQL> select name from v$tablespaces;
SQL> select name from v$tempfile;
SQL> create tablespace raj datafile '+ASM_DG_DATA/sales/raj01.dbf' size 10,;
SQL> select name from v$tablespaces;

Adding a Disk to existing DiskGroup
grid> asmca
-disk group name : ASM_SSSS
-external
-VOL4
-ok

-right click on ASM_SSSS
-add disks
-select disks
-ok
grid> !exp
SQL> alter diskgroup ASM_SSSS add disk 'ORCL:VOL5' size 4777m;

-we can also store text based files using ACFS in diskgroups in oracle11g.
-ACFS = ASM Cluster File System.
root> cd /u01/product/11.2.0/grid_home/bin
root bin> ls
root bin> ls acfs*
root bin> ./acfsload start_s
root bin> cd
root> lsmod|grep oracle
root> su - grid
grid> !exp
SQL>
grid> asmca
-goto 'ASM Cluster File System' tab
-goto 'Volumes' tab
-create
-volume name:asm_volume
-diskgroup name:ASM_SSSS
-specify size: 2gb
-ok

-goto 'ASM Cluster File System' tab
-create
-select 'general purpose file system'
-mount point : /acfs
-ok
root> cd /
root /> ls
root /> mkdir /acfs
root /> ls
root /> cd acfs
root> df -kh
Click on 'show mount all command' in the asmca wizard.
Copy and execute the given path as root user.
root> /sbin/mount.acfs-o all
root> df -kh
root> mkdir -p /acfs/bkp
root> chown -R oracle:oinstall /acfs/bkp
root> chmod -R 775 /acfs/bkp
root> su - oracle
oracle> cd /acfs/bkp
oracle bkp> ls
oracle bkp> vi venu.sql
select name from v$datafile;
:wq!
oracle bkp> ls
oracle bkp> file* -to see the file type text/binary.
oracle> export ORACLE_SID=sales
oracle> sqlplus / as sysdba
SQL> @/acfs/bkp/venu.sql
grid> asmca
-goto 'ASM Cluster File System' tab
-show dismount all command
-copy path and execute in root
root> /bin/umount -t acfs -a
root> df
grid> asmca
asmcmd> ls
asmcmd> lsdg
asmcmd> lsdsk - lists used volumes
asmcmd> lsdsk --candidate -p --lists the free/unused volumes
asmcmd> lsdsk -G asm_ssss --lists disks under diskgroup
asmcmd> lsdg
asmcmd> umount -f asm_ssss
asmcmd> lsdg
asmcmd> mount -f asm_ssss
asmcmd> lsdg
asmcmd> umount -a --dismount all diskgroups
grid> srvctl status database -d sales
grid> srvctl stop database -d sales
grid> srvctl status database -d sales
grid> ps -ef|grep smon
grid> crsctl check has
grid> crsctl stop has
grid> crsctl check has
grid> ps -ef|grep smon
grid> crsctl start has
Related Posts Plugin for WordPress, Blogger...

Flag Counter