top of page

Results found for ""

  • Oracle 11gR2 RAC Installation on Oracle Linux 6.5

    Oracle 11gR2 RAC Installation on Oracle Linux 6.5 In this article we will be installing 2 node 11gR2 RAC on Oracle Linux 6.5. We will be looking at below steps Configure Virtual machine for Node 1 Configure Virtual machine for Node 2 OS prerequisites on all nodes Setup public & private network Configure shared storage Oracle Grid Installation Oracle RAC software installation Create RAC Database Configure VM for Node 1 Open virtual box and create a new VM for node 1. We will be installing OEL 6.5 on both RAC nodes. Create New VM Open virtual box and click on New. Create first virtual machine with oraracn1 as the name Min RAM allocation should be 4 GB per RAC node Create a virtual disk now Select VDI and click next Select Dynamically allocated option and click next Allocate Min 80 GB HDD to your virtual machine. You can allocate even more if you have good hard disk space. Click on Create Now your virtual machine should be created. This is how your virtual box will look like Right click on virtual machine and select settings. Under System settings, make sure to set below bootorder Under storage > Optical Drive > choose OEL 6.5 iso file from your system. Under Network, make sure attached to is set to Bridged Adapter and Enable the Network Adapter In RAC, we need to have two network adapters. So, enable the second adapter same like the first one. Click on OK to complete the RAC node 1 setup. Install OEL 6.5 on Node 1 Now that our virtual machine is ready, go ahead, start the virtual machine and install OEL 6.5 Skip media test Click next to continue Go with default language > click next Go with default keyboard type and click on next Select Basic Storage Devices > Click Next Select Yes, Discard and data Give a hostname to your machine oraracn1.oraclgenesis.com Click on configure network and assign a static IP Assign public IP to your machine. In my case, I have assigned 192.168.0.101 as the machine IP Select second network card and click on edit Assign private IP to your node 1 on a different subnet mask. Leave Gateway blank Click next and select your timezone Give a root password Select create custom layout and click next Select Free disk space and click on create Choose standard partition and click Create Create boot partition with 512 MB size Once again choose free disk space and click on create Select file system type as Swap and give 15 GB size (Approx 15000 MB) Again select free space and click on create Give mount point as root (/) and chose option Fill to maximum allowable size Click next and choose Format option Select Write changes to disk No changes on below screen, just click next Choose customize now and just click next From the list, select packages as below: Base System Base Client management tools Compatibility libraries Hardware monitoring utilities Large Systems Performance Network file system client Performance Tools Perl Support Servers Server Platform System administration tools Desktops Desktop Desktop Platform Fonts General Purpose Desktop Graphical Administration Tools Input Methods X Window System Development Additional Development Development Tools Applications Internet Browser Click next and OEL installation will begin Once done, click on Reboot After reboot, there are few post installation steps. Click on Forward Accept the license and click on Forward Choose No and click on Forward Select No thanks and proceed Click forward Do not create any user at this stage, click forward Choose Yes Check the Date and Time settings and click on forward Nothing to choose under Kdump, click forward OEL 6.5 installation is completed. Configure VM for Node 2 You need to create Node 2 like how you have created Node 1 in virtual box. This will be a separate new virtual machine. I have used below configuration for node 2: Install OEL 6.5 on Node 2 Now that our virtual machine is ready, go ahead and start the virtual machine. Start virtual machine and install OEL 6.5 Skip media test Click next to continue Go with default language > click next Go with default keyboard type and click on next Select Basic Storage Devices > Click Next Select Yes, Discard and data Give a hostname to your machine oraracn2.oraclgenesis.com Click on configure network and assign a static IP Assign public IP to your machine. In my case, I have assigned 192.168.0.102 as the machine IP. Select second network card and click on edit Assign private IP to your node 2 on a different subnet mask. Leave Gateway blank Click next and select your timezone Give a root password Select create custom layout and click next Select Free disk space and click on create Choose standard partition and click Create Create boot partition with 512 MB size Once again choose free disk space and click on create Select file system type as Swap and give 15 GB size (Approx 15000 MB) Again select free space and click on create Give mount point as root (/) and chose option Fill to maximum allowable size Click next and chose Format option Select Write changes to disk No changes on below screen, just click next Choose customize now and just click next From the list, select packages as below Base System Servers:Desktops Desktops Applications Development Click next and OEL installation will begin Once done, click on Reboot After reboot, there are few post installation steps. Click on Forward Accept the license and click on Forward Choose No and click on Forward Select No thanks and proceed Click forward Do not create any user at this stage, click forward Choose Yes Check the Date and Time settings and click on forward Nothing to choose under Kdump, click forward OEL 6.5 installation on Node 2 is completed. OS Prerequisites – All Nodes Connect to both RAC nodes via putty and execute all the below commands on both nodes. Check if your machine is able to speak to internet. You can ping yahoo.com. Then install below package to perform all oracle installation pre-requisites yum -y install oracle-rdbms* Install ASM packages yum -y install oracleasm* yum -y install kmod-oracleasm Change password for oracle user passwd oracle Disable firewall /etc/rc.d/init.d/iptables status /etc/rc.d/init.d/iptables stop service iptables stop chkconfig iptables off echo 0 > /selinux/enforce Create directories to install grid and oracle software mkdir -p /u01/app/11.2.0/grid mkdir -p /u01/app/oracle/product/11.2.0/db_1 chown -R oracle:oinstall /u01 chmod -R 775 /u01/ mkdir -p /u02 chown -R oracle:oinstall /u02 Download Oracle 11.2.0.4 gird and database binaries. Copy it to /u02 location (Only on Node 1) Setup Public & Private Network We have below public and private network configuration for our RAC setup Also, below are the Virtual IP and Scan IP details: Depending upon your environment, change IP addresses and put below under /etc/hosts file on both oraracn1 and oraracn2 nodes On both nodes: ============== 127.0.0.1 localhost.localdomain localhost # Public Network - (eth0) 192.168.0.101 oraracn1.oraclegenesis.com oraracn1 192.168.0.102 oraracn2.oraclegenesis.com oraracn2 # Private Interconnect - (eth1) 10.10.10.101 oraracn1-priv.oraclegenesis.com oraracn1-priv 10.10.10.102 oraracn2-priv.oraclegenesis.com oraracn2-priv # Public Virtual IP (VIP) addresses - (eth0:1) 192.168.0.105 oraracn1-vip.oraclegenesis.com oraracn1-vip 192.168.0.106 oraracn2-vip.oraclegenesis.com oraracn2-vip # Single Client Access Name (SCAN) 192.168.0.110 orarac-scan.oraclegenesis.com orarac-scan Test the network configuration On oraracn1: ============ # ping oraracn1 --> use Ctrl+C to exit from ping # ping oraracn2 # ping oraracn1-priv # ping oraracn2-priv On oraracn2: ============ # ping oraracn1 --> use Ctrl+C to exit from ping # ping oraracn2 # ping oraracn1-priv # ping oraracn2-priv Note: You cannot ping VIP and SCAN IP. Those IPs can only be used by an application and are not ping-able! Configure Shared Storage At this stage, shutdown both the virtual machines. We will allocate shared disks to RAC nodes. Open oraracn1 virtual machine settings and select storage . Click on Adds Hard Disk button under SATA controller Choose Create new disk Choose VDI and click Next Select Fixed size and click Next Allocate 100 GB of shared storage to your RAC setup This will take some time to add shared disk to Node 1 Once disk is added, you can see the disk under Node 1 settings > storage Now our goal is to make newly added disk on node 1 shared with node 2. For this, go to File > Virtual Media Manager Select your shared disk > right click > choose Modify Change the property from Normal to Shareable and click on OK Now we are ready to share the disk with Node 2. Open oraracn2 settings > Storage > Adds hard disk icon Do not create a new disk, Choose existing disk Locate your shared disk at OS level. It must mostly be stored under your Node 1 location The disk must now be shared with node 2 as well. You will see the RAC Shared Storage below Create Shared Partitions Now that we have 100 GB of shared storage, we need to create three partitions for the main three ASM disk groups Create three partitions under the newly added 100 GB shared disk via node 1 On Node 1: ========== fdisk /dev/sdb n p 1 +10G ============ Frist partition is created, create second one ============ n p 1 +45G ============ Second partition is created, create third one ============= n p 1 +45G ======= All partitions are created, now save the partition table ========== w  this command will save the partition table Configure ASM & ASM Disks As we have created 3 partitions, we must allocate each partition to single ASM disks, which will then be allocated to ASM Disk groups Configure ASM on both nodes On Node 1 as root user: ======================= /usr/sbin/oracleasm configure -i Default user to own the driver interface []: oracle Default group to own the driver interface []: dba Start Oracle ASM library driver on boot (y/n) [n]: y Scan for Oracle ASM disks on boot (y/n) [y]: y On Node 2 as root user: ======================= /usr/sbin/oracleasm configure -i Default user to own the driver interface []: oracle Default group to own the driver interface []: dba Start Oracle ASM library driver on boot (y/n) [n]: y Scan for Oracle ASM disks on boot (y/n) [y]: y Load oracle-asm kernel module on both nodes. This command Creates the /etc/sysconfig/oracleasm configuration file, creates the /dev/oracleasm mount point and mounts the ASMLib driver file system On Node 1 as root user: ======================= /usr/sbin/oracleasm init On Node 2 as root user: ======================= /usr/sbin/oracleasm init Create ASM disks – Any one Node On Node 1 as root user: ======================= oracleasm createdisk CRS1 /dev/sdb5 oracleasm createdisk DATA1 /dev/sdb6 oracleasm createdisk FRA1 /dev/sdb7 Run below commands on both nodes to scan and list ASM disks oracleasm scandisks oracleasm listdisks Oracle Grid Installation Oracle grid software is the one which binds multiple independent servers into a cluster. You can configure ASM only when Oracle grid is installed because ASM is bundled with Oracle Grid Software. Configure NTP – All Nodes On Node 1 and Node 2: ===================== # yum install ntp # service ntpd start # chkconfig ntpd on # vi /etc/sysconfig/ntpd -> Open file delete all and put below line OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid -g" # service ntpd stop # ntpdate 1.tw.pool.ntp.org # service ntpd start Now its good time to clean-up the YUM repository to release some space from the disk On both nodes as root user: =========================== # yum clean all Set Bash Profile Setup oracle user bash profile on node 1 # su - oracle # vi .bash_profile # Oracle Settings TMP=/tmp; export TMP TMPDIR=$TMP; export TMPDIR ORACLE_HOSTNAME=oraracn1; export ORACLE_HOSTNAME ORACLE_UNQNAME=RAC; export ORACLE_UNQNAME ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE GRID_HOME=/u01/app/11.2.0/grid; export GRID_HOME DB_HOME=$ORACLE_BASE/product/11.2.0/db_1; export DB_HOME ORACLE_HOME=$DB_HOME; export ORACLE_HOME ORACLE_SID=RAC1; export ORACLE_SID ORACLE_TERM=xterm; export ORACLE_TERM BASE_PATH=/usr/sbin:$PATH; export BASE_PATH PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPAT H alias grid_env='. /home/oracle/grid_env' alias db_env='. /home/oracle/db_env' Create a file to set grid variables on node 1 . This file will set grid environmental variables making it easy to switch between DB home and grid home. # vi /home/oracle/grid_env ORACLE_SID=+ASM1; export ORACLE_SID ORACLE_HOME=$GRID_HOME; export ORACLE_HOME PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPAT H Create below file to set database environmental variables on Node 1 # vi /home/oracle/db_env ORACLE_SID=RAC1; export ORACLE_SID ORACLE_HOME=$DB_HOME; export ORACLE_HOME PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPAT H Setup oracle user bash profile on node 2 # su - oracle # vi .bash_profile # Oracle Settings TMP=/tmp; export TMP TMPDIR=$TMP; export TMPDIR ORACLE_HOSTNAME=oraracn2; export ORACLE_HOSTNAME ORACLE_UNQNAME=RAC; export ORACLE_UNQNAME ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE GRID_HOME=/u01/app/11.2.0/grid; export GRID_HOME DB_HOME=$ORACLE_BASE/product/11.2.0/db_1; export DB_HOME ORACLE_HOME=$DB_HOME; export ORACLE_HOME ORACLE_SID=RAC2; export ORACLE_SID ORACLE_TERM=xterm; export ORACLE_TERM BASE_PATH=/usr/sbin:$PATH; export BASE_PATH PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPAT H alias grid_env='. /home/oracle/grid_env' alias db_env='. /home/oracle/db_env' Create a file to set grid variables on node 2 . This file will set grid environmental variables making it easy to switch between DB home and grid home. # vi /home/oracle/grid_env ORACLE_SID=+ASM2; export ORACLE_SID ORACLE_HOME=$GRID_HOME; export ORACLE_HOME PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPAT H Create below file to set database environmental variables on Node 2 # vi /home/oracle/db_env ORACLE_SID=RAC2; export ORACLE_SID ORACLE_HOME=$DB_HOME; export ORACLE_HOME PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPAT H At this stage, exit as oracle user and the open another terminal with new session OR switch to root user and then back to oracle user. This will make the new environmental variables in effect. Now it’s time to test our environment variables and check if they are working fine or not. As oracle user, execute below commands on both nodes to check if environmental variables are set properly Node 1: ------- su – oracle # . grid_env --To set grid env variables # env |grep ORA ORACLE_UNQNAME=RAC ORACLE_SID=+ASM1 ORACLE_BASE=/u01/app/oracle ORACLE_HOSTNAME=oraracn1 ORACLE_TERM=xterm ORACLE_HOME=/u01/app/11.2.0/grid # . db_env --To set DB env variables # env |grep ORA ORACLE_UNQNAME=RAC ORACLE_SID=RAC1 ORACLE_BASE=/u01/app/oracle ORACLE_HOSTNAME=oraracn1 ORACLE_TERM=xterm ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 Node 2: ------- su – oracle # . grid_env --To set grid env variables # env |grep ORA ORACLE_UNQNAME=RAC ORACLE_SID=+ASM2 ORACLE_BASE=/u01/app/oracle ORACLE_HOSTNAME=oraracn2 ORACLE_TERM=xterm ORACLE_HOME=/u01/app/11.2.0/grid # . db_env --To set DB env variables # env |grep ORA ORACLE_UNQNAME=RAC ORACLE_SID=RAC2 ORACLE_BASE=/u01/app/oracle ORACLE_HOSTNAME=oraracn2 ORACLE_TERM=xterm ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 Configure SSH Between Nodes Configure SSH connectivity between the nodes as oracle user. There are two methods to setup SSH connectivity between the nodes is: Manual method and automatic method. The manual method is very long and you might encounter errors while doing it. The easy way is the automatic method via script provided by oracle. As you have already copied the grid and database software files under /u02, unzip the grid software file. This will create a new folder name grid under /u02. Oracle provides automatic ssh setup script On node 1 as oracle user: ========================= cd /u02 unzip cd grid/sshsetup ./sshUserSetup.sh -user oracle -hosts "oraracn1 oraracn2" -noPromptPassphrase -confir m -advanced Run cluvfy utility Oracle provide a pre-installation utility which is called as Cluster Verification Utility (CLUVFY). This utility performs cluster verification before, during and after install of grid software. Let us run CLUVFY utility to check cluster before installation of grid # /u01/softwares/grid # ./runcluvfy.sh stage -pre crsinst -n oraracn1,oraracn2 -fixup -verbose Below is the sample output [oracle@oraracn1 grid]$ ./runcluvfy.sh stage -pre crsinst -n oraracn1,oraracn2 -fixup -verbose Performing pre-checks for cluster services setup Checking node reachability... Check: Node reachability from node "oraracn1" Destination Node Reachable? ------------------------------------ ------------------------ oraracn2 yes oraracn1 yes Result: Node reachability check passed from node "oraracn1" Checking user equivalence... Check: User equivalence for user "oracle" Node Name Comment ------------------------------------ ------------------------ oraracn1 passed oraracn2 passed Result: User equivalence check passed for user "oracle" Checking node connectivity... Checking hosts config file... Node Name Status Comment ------------ ------------------------ ------------------------ oraracn1 passed oraracn2 passed Verification of the hosts config file successful Interface information for node "oraracn1" Name IP Address Subnet Gateway Def. Gateway HW Address MTU ------ --------------- --------------- --------------- --------------- ---------------- ------ eth0 192.168.0.151 192.168.0.0 0.0.0.0 192.168.0.1 00:0C:29:B6:0 F:87 1500 eth1 10.10.10.151 10.10.10.0 0.0.0.0 192.168.0.1 00:0C:29:B6:0 F:91 1500 Interface information for node "oraracn2" Name IP Address Subnet Gateway Def. Gateway HW Address MTU ------ --------------- --------------- --------------- --------------- ---------------- ------ eth0 192.168.0.152 192.168.0.0 0.0.0.0 192.168.0.1 00:0C:29:81:9 1:FA 1500 eth1 10.10.10.152 10.10.10.0 0.0.0.0 192.168.0.1 00:0C:29:81:9 1:04 1500 Check: Node connectivity of subnet "192.168.0.0" Source Destination Connected? ------------------------------ ------------------------------ --------- oraracn1:eth0 oraracn2:eth0 yes Result: Node connectivity passed for subnet "192.168.0.0" with node(s) oraracn1,orara cn2 Check: TCP connectivity of subnet "192.168.0.0" Source Destination Connected? -------------------- ------------------------ -------- oraracn1:192.168.0.151 oraracn2:192.168.0.152 passed Result: TCP connectivity check passed for subnet "192.168.0.0" Check: Node connectivity of subnet "10.10.10.0" Source Destination Connected? ------------------------------ ------------------- ----------- oraracn1:eth1 oraracn2:eth1 yes Result: Node connectivity passed for subnet "10.10.10.0" with node(s) oraracn1,orarac n2 Check: TCP connectivity of subnet "10.10.10.0" Source Destination Connected? ------------------------------ ------------- ---------- oraracn1:10.10.10.151 oraracn2:10.10.10.152 passed Result: TCP connectivity check passed for subnet "10.10.10.0" Interfaces found on subnet "192.168.0.0" that are likely candidates for VIP are: oraracn1 eth0:192.168.0.151 oraracn2 eth0:192.168.0.152 Interfaces found on subnet "10.10.10.0" that are likely candidates for a private inte rconnect are: oraracn1 eth1:10.10.10.151 oraracn2 eth1:10.10.10.152 Result: Node connectivity check passed Check: Total memory Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 2.44GB (2559180.0KB) 1.5GB (1572864.0KB) passed oraracn2 2.44GB (2559180.0KB) 1.5GB (1572864.0KB) passed Result: Total memory check passed Check: Available memory Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 2.11GB (2211952.0KB) 50MB (51200.0KB) passed oraracn2 2.19GB (2294412.0KB) 50MB (51200.0KB) passed Result: Available memory check passed Check: Swap space Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 4.88GB (5116692.0KB) 2.44GB (2559180.0KB) passed oraracn2 4.88GB (5116692.0KB) 2.44GB (2559180.0KB) passed Result: Swap space check passed Check: Free disk space for "oraracn1:/tmp" Path Node Name Mount point Available Required Comment ---------------- ------------ ------------ ------------ ------------ -------- /tmp oraracn1 / 4.94GB 1GB passed Result: Free disk space check passed for "oraracn1:/tmp" Check: Free disk space for "oraracn2:/tmp" Path Node Name Mount point Available Required Comment ---------------- ------------ ------------ ------------ ------------ --------- /tmp oraracn2 / 4.71GB 1GB passed Result: Free disk space check passed for "oraracn2:/tmp" Check: User existence for "oracle" Node Name Status Comment ------------ ------------------------ ------------------------ oraracn1 exists passed oraracn2 exists passed Result: User existence check passed for "oracle" Check: Group existence for "oinstall" Node Name Status Comment ------------ ------------------------ ------------------------ oraracn1 exists passed oraracn2 exists passed Result: Group existence check passed for "oinstall" Check: Group existence for "dba" Node Name Status Comment ------------ ------------------------ ------------------------ oraracn1 exists passed oraracn2 exists passed Result: Group existence check passed for "dba" Check: Membership of user "oracle" in group "oinstall" [as Primary] Node Name User Exists Group Exists User in Group Primary Comment ----------- --------- --------- ------------ ------------ ------- oraracn1 yes yes yes yes passed oraracn2 yes yes yes yes passed Result: Membership check for user "oracle" in group "oinstall" [as Primary] passed Check: Membership of user "oracle" in group "dba" Node Name User Exists Group Exists User in Group Comment ---------------- ------------ ------------ ------------ ---------------- oraracn1 yes yes yes passed oraracn2 yes yes yes passed Result: Membership check for user "oracle" in group "dba" passed Check: Run level Node Name run level Required Comment ------------ ----------- ----------- ----------- oraracn1 5 3,5 passed oraracn2 5 3,5 passed Result: Run level check passed Check: Hard limits for "maximum open file descriptors" Node Name Type Available Required Comment ---------------- ------------ ------------ ------------ ---------------- oraracn1 hard 131072 65536 passed oraracn2 hard 131072 65536 passed Result: Hard limits check passed for "maximum open file descriptors" Check: Soft limits for "maximum open file descriptors" Node Name Type Available Required Comment ---------------- ------------ ------------ ------------ ---------------- oraracn1 soft 131072 1024 passed oraracn2 soft 131072 1024 passed Result: Soft limits check passed for "maximum open file descriptors" Check: Hard limits for "maximum user processes" Node Name Type Available Required Comment ---------------- ------------ ------------ ------------ ---------------- oraracn1 hard 131072 16384 passed oraracn2 hard 131072 16384 passed Result: Hard limits check passed for "maximum user processes" Check: Soft limits for "maximum user processes" Node Name Type Available Required Comment ---------------- ------------ ------------ ------------ ---------------- oraracn1 soft 131072 2047 passed oraracn2 soft 131072 2047 passed Result: Soft limits check passed for "maximum user processes" Check: System architecture Node Name Available Required Comment ----------- ------------------------ ------------------------ ---------- oraracn1 x86_64 x86_64 passed oraracn2 x86_64 x86_64 passed Result: System architecture check passed Check: Kernel version Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 2.6.18-164.el5 2.6.18 passed oraracn2 2.6.18-164.el5 2.6.18 passed Result: Kernel version check passed Check: Kernel parameter for "semmsl" Node Name Configured Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 250 250 passed oraracn2 250 250 passed Result: Kernel parameter check passed for "semmsl" Check: Kernel parameter for "semmns" Node Name Configured Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 32000 32000 passed oraracn2 32000 32000 passed Result: Kernel parameter check passed for "semmns" Check: Kernel parameter for "semopm" Node Name Configured Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 100 100 passed oraracn2 100 100 passed Result: Kernel parameter check passed for "semopm" Check: Kernel parameter for "semmni" Node Name Configured Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 142 128 passed oraracn2 142 128 passed Result: Kernel parameter check passed for "semmni" Check: Kernel parameter for "shmmax" Node Name Configured Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 4398046511104 536870912 passed oraracn2 4398046511104 536870912 passed Result: Kernel parameter check passed for "shmmax" Check: Kernel parameter for "shmmni" Node Name Configured Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 4096 4096 passed oraracn2 4096 4096 passed Result: Kernel parameter check passed for "shmmni" Check: Kernel parameter for "shmall" Node Name Configured Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 4294967296 2097152 passed oraracn2 4294967296 2097152 passed Result: Kernel parameter check passed for "shmall" Check: Kernel parameter for "file-max" Node Name Configured Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 6815744 6815744 passed oraracn2 6815744 6815744 passed Result: Kernel parameter check passed for "file-max" Check: Kernel parameter for "ip_local_port_range" Node Name Configured Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 between 9000 & 65500 between 9000 & 65500 passed oraracn2 between 9000 & 65500 between 9000 & 65500 passed Result: Kernel parameter check passed for "ip_local_port_range" Check: Kernel parameter for "rmem_default" Node Name Configured Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 262144 262144 passed oraracn2 262144 262144 passed Result: Kernel parameter check passed for "rmem_default" Check: Kernel parameter for "rmem_max" Node Name Configured Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 4194304 4194304 passed oraracn2 4194304 4194304 passed Result: Kernel parameter check passed for "rmem_max" Check: Kernel parameter for "wmem_default" Node Name Configured Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 262144 262144 passed oraracn2 262144 262144 passed Result: Kernel parameter check passed for "wmem_default" Check: Kernel parameter for "wmem_max" Node Name Configured Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 1048576 1048576 passed oraracn2 1048576 1048576 passed Result: Kernel parameter check passed for "wmem_max" Check: Kernel parameter for "aio-max-nr" Node Name Configured Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 3145728 1048576 passed oraracn2 3145728 1048576 passed Result: Kernel parameter check passed for "aio-max-nr" Check: Package existence for "make-3.81" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 make-3.81-3.el5 make-3.81 passed oraracn2 make-3.81-3.el5 make-3.81 passed Result: Package existence check passed for "make-3.81" Check: Package existence for "binutils-2.17.50.0.6" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 binutils-2.17.50.0.6-12.el5 binutils-2.17.50.0.6 passed oraracn2 binutils-2.17.50.0.6-12.el5 binutils-2.17.50.0.6 passed Result: Package existence check passed for "binutils-2.17.50.0.6" Check: Package existence for "gcc-4.1.2" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 gcc-4.1.2-46.el5 gcc-4.1.2 passed oraracn2 gcc-4.1.2-46.el5 gcc-4.1.2 passed Result: Package existence check passed for "gcc-4.1.2" Check: Package existence for "libaio-0.3.106 (i386)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 libaio-0.3.106-5 (i386) libaio-0.3.106 (i386) passed oraracn2 libaio-0.3.106-5 (i386) libaio-0.3.106 (i386) passed Result: Package existence check passed for "libaio-0.3.106 (i386)" Check: Package existence for "libaio-0.3.106 (x86_64)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 libaio-0.3.106-5 (x86_64) libaio-0.3.106 (x86_64) passed oraracn2 libaio-0.3.106-5 (x86_64) libaio-0.3.106 (x86_64) passed Result: Package existence check passed for "libaio-0.3.106 (x86_64)" Check: Package existence for "glibc-2.5-24 (i686)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 glibc-2.5-42 (i686) glibc-2.5-24 (i686) passed oraracn2 glibc-2.5-42 (i686) glibc-2.5-24 (i686) passed Result: Package existence check passed for "glibc-2.5-24 (i686)" Check: Package existence for "glibc-2.5-24 (x86_64)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 glibc-2.5-42 (x86_64) glibc-2.5-24 (x86_64) passed oraracn2 glibc-2.5-42 (x86_64) glibc-2.5-24 (x86_64) passed Result: Package existence check passed for "glibc-2.5-24 (x86_64)" Check: Package existence for "compat-libstdc++-33-3.2.3 (i386)" Node Name Available Required Comment ------------ ------------------------ ----------------------- ------- oraracn1 compat-libstdc++-33-3.2.3-61 (i386) compat-libstdc++-33-3.2.3 (i386) passed oraracn2 compat-libstdc++-33-3.2.3-61 (i386) compat-libstdc++-33-3.2.3 (i386) passed Result: Package existence check passed for "compat-libstdc++-33-3.2.3 (i386)" Check: Package existence for "compat-libstdc++-33-3.2.3 (x86_64)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 compat-libstdc++-33-3.2.3-61 (x86_64) compat-libstdc++-33-3.2.3 (x86 _64) passed oraracn2 compat-libstdc++-33-3.2.3-61 (x86_64) compat-libstdc++-33-3.2.3 (x86 _64) passed Result: Package existence check passed for "compat-libstdc++-33-3.2.3 (x86_64)" Check: Package existence for "elfutils-libelf-0.125 (x86_64)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 elfutils-libelf-0.137-3.el5 (x86_64) elfutils-libelf-0.125 (x86_64) passed oraracn2 elfutils-libelf-0.137-3.el5 (x86_64) elfutils-libelf-0.125 (x86_64) passed Result: Package existence check passed for "elfutils-libelf-0.125 (x86_64)" Check: Package existence for "elfutils-libelf-devel-0.125" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 elfutils-libelf-devel-0.137-3.el5 elfutils-libelf-devel-0.125 passed oraracn2 elfutils-libelf-devel-0.137-3.el5 elfutils-libelf-devel-0.125 passed Result: Package existence check passed for "elfutils-libelf-devel-0.125" Check: Package existence for "glibc-common-2.5" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 glibc-common-2.5-42 glibc-common-2.5 passed oraracn2 glibc-common-2.5-42 glibc-common-2.5 passed Result: Package existence check passed for "glibc-common-2.5" Check: Package existence for "glibc-devel-2.5 (i386)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 glibc-devel-2.5-42 (i386) glibc-devel-2.5 (i386) passed oraracn2 glibc-devel-2.5-42 (i386) glibc-devel-2.5 (i386) passed Result: Package existence check passed for "glibc-devel-2.5 (i386)" Check: Package existence for "glibc-devel-2.5 (x86_64)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 glibc-devel-2.5-42 (x86_64) glibc-devel-2.5 (x86_64) passed oraracn2 glibc-devel-2.5-42 (x86_64) glibc-devel-2.5 (x86_64) passed Result: Package existence check passed for "glibc-devel-2.5 (x86_64)" Check: Package existence for "glibc-headers-2.5" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 glibc-headers-2.5-42 glibc-headers-2.5 passed oraracn2 glibc-headers-2.5-42 glibc-headers-2.5 passed Result: Package existence check passed for "glibc-headers-2.5" Check: Package existence for "gcc-c++-4.1.2" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 gcc-c++-4.1.2-46.el5 gcc-c++-4.1.2 passed oraracn2 gcc-c++-4.1.2-46.el5 gcc-c++-4.1.2 passed Result: Package existence check passed for "gcc-c++-4.1.2" Check: Package existence for "libaio-devel-0.3.106 (i386)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 libaio-devel-0.3.106-5 (i386) libaio-devel-0.3.106 (i386) passed oraracn2 libaio-devel-0.3.106-5 (i386) libaio-devel-0.3.106 (i386) passed Result: Package existence check passed for "libaio-devel-0.3.106 (i386)" Check: Package existence for "libaio-devel-0.3.106 (x86_64)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 libaio-devel-0.3.106-5 (x86_64) libaio-devel-0.3.106 (x86_64) passed oraracn2 libaio-devel-0.3.106-5 (x86_64) libaio-devel-0.3.106 (x86_64) passed Result: Package existence check passed for "libaio-devel-0.3.106 (x86_64)" Check: Package existence for "libgcc-4.1.2 (i386)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 libgcc-4.1.2-46.el5 (i386) libgcc-4.1.2 (i386) passed oraracn2 libgcc-4.1.2-46.el5 (i386) libgcc-4.1.2 (i386) passed Result: Package existence check passed for "libgcc-4.1.2 (i386)" Check: Package existence for "libgcc-4.1.2 (x86_64)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 libgcc-4.1.2-46.el5 (x86_64) libgcc-4.1.2 (x86_64) passed oraracn2 libgcc-4.1.2-46.el5 (x86_64) libgcc-4.1.2 (x86_64) passed Result: Package existence check passed for "libgcc-4.1.2 (x86_64)" Check: Package existence for "libstdc++-4.1.2 (i386)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 libstdc++-4.1.2-46.el5 (i386) libstdc++-4.1.2 (i386) passed oraracn2 libstdc++-4.1.2-46.el5 (i386) libstdc++-4.1.2 (i386) passed Result: Package existence check passed for "libstdc++-4.1.2 (i386)" Check: Package existence for "libstdc++-4.1.2 (x86_64)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 libstdc++-4.1.2-46.el5 (x86_64) libstdc++-4.1.2 (x86_64) passed oraracn2 libstdc++-4.1.2-46.el5 (x86_64) libstdc++-4.1.2 (x86_64) passed Result: Package existence check passed for "libstdc++-4.1.2 (x86_64)" Check: Package existence for "libstdc++-devel-4.1.2 (x86_64)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 libstdc++-devel-4.1.2-46.el5 (x86_64) libstdc++-devel-4.1.2 (x86_64) passed oraracn2 libstdc++-devel-4.1.2-46.el5 (x86_64) libstdc++-devel-4.1.2 (x86_64) passed Result: Package existence check passed for "libstdc++-devel-4.1.2 (x86_64)" Check: Package existence for "sysstat-7.0.2" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 sysstat-7.0.2-13.0.1.el5 sysstat-7.0.2 passed oraracn2 sysstat-7.0.2-13.0.1.el5 sysstat-7.0.2 passed Result: Package existence check passed for "sysstat-7.0.2" Check: Package existence for "unixODBC-2.2.11 (i386)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 unixODBC-2.2.11-10.el5 (i386) unixODBC-2.2.11 (i386) passed oraracn2 unixODBC-2.2.11-10.el5 (i386) unixODBC-2.2.11 (i386) passed Result: Package existence check passed for "unixODBC-2.2.11 (i386)" Check: Package existence for "unixODBC-2.2.11 (x86_64)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 unixODBC-2.2.11-10.el5 (x86_64) unixODBC-2.2.11 (x86_64) passed oraracn2 unixODBC-2.2.11-10.el5 (x86_64) unixODBC-2.2.11 (x86_64) passed Result: Package existence check passed for "unixODBC-2.2.11 (x86_64)" Check: Package existence for "unixODBC-devel-2.2.11 (i386)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 unixODBC-devel-2.2.11-10.el5 (i386) unixODBC-devel-2.2.11 (i386) passed oraracn2 unixODBC-devel-2.2.11-10.el5 (i386) unixODBC-devel-2.2.11 (i386) passed Result: Package existence check passed for "unixODBC-devel-2.2.11 (i386)" Check: Package existence for "unixODBC-devel-2.2.11 (x86_64)" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 unixODBC-devel-2.2.11-10.el5 (x86_64) unixODBC-devel-2.2.11 (x86_64) passed oraracn2 unixODBC-devel-2.2.11-10.el5 (x86_64) unixODBC-devel-2.2.11 (x86_64) passed Result: Package existence check passed for "unixODBC-devel-2.2.11 (x86_64)" Check: Package existence for "ksh-20060214" Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 ksh-20080202-14.el5 ksh-20060214 passed oraracn2 ksh-20080202-14.el5 ksh-20060214 passed Result: Package existence check passed for "ksh-20060214" Checking for multiple users with UID value 0 Result: Check for multiple users with UID value 0 passed Check: Current group ID Result: Current group ID check passed Checking Core file name pattern consistency... Core file name pattern consistency check passed. Checking to make sure user "oracle" is not in "root" group Node Name Status Comment ------------ ------------------------ ------------------------ oraracn1 does not exist passed oraracn2 does not exist passed Result: User "oracle" is not part of "root" group. Check passed Check default user file creation mask Node Name Available Required Comment ------------ ------------------------ ------------------------ ---------- oraracn1 0022 0022 passed oraracn2 0022 0022 passed Result: Default user file creation mask check passed Starting Clock synchronization checks using Network Time Protocol(NTP)... NTP Configuration file check started... Network Time Protocol(NTP) configuration file not found on any of the nodes. Oracle C luster Time Synchronization Service(CTSS) can be used instead of NTP for time synchro nization on the cluster nodes Result: Clock synchronization check using Network Time Protocol(NTP) passed Pre-check for cluster services setup was successful. Note: You must see Pre-check for cluster services setup was successful at the end of the cluvfy output. Install Grid Software The following steps will guide you to install Oracle Grid software with Oracle ASM binaries. As oracle user, start the grid runInstaller On Node 1: ========== su – oracle # cd /u02/grid/ # ./runInstaller Note: sometimes there might be display variable error. issues below command as root user to enable GUI # xhost + Under Select Installation Option, choose Install and Configure Grid Infrastructure for a Cluster and Click Next Select Advanced Installation and click Next Select Advanced Installation and click Next Input below details and click Next Below screen will list out the nodes which you want to install and configure as part of Grid Click on Add and enter details of Node 2. Click on OK In case you have more than two nodes, Add each node by clicking on Add . Click Next to proceed Specify network interface by selecting public and private interfaces. Click Next Select storage option as Automatic Storage Management (ASM ). Click Next You need to assign a disk where the grid installer will keep OCR and Voting disks. Click on Change Discovery Path, type /dev/oracleasm/disks/* and click OK. Under Add Disks, you must see the three disks which we have created as part of Shard Storage. Before you proceed, sometimes you might not see the lists of disks. In such cases, follow below: 1. Check if /dev/sdb1, /dev/sdc1, /dev/sdd1 had ownership as oracle user. If not then issue below commands as root user on both nodes # chown oracle:oinstall /dev/sdb1 # chown oracle:oinstall /dev/sdc1 # chown oracle:oinstall /dev/sdd1 2. Also give full permissions on above disks # chmod 777 /dev/sdb1 # chmod 777 /dev/sdc1 # chmod 777 /dev/sdd1 Again go to Change Discovery Path, type /dev/oracleasm/disks/* and click OK. Now all the disks will be listed. Type Disk Group Name as CRS, Redundancy as External and under Disk Path /dev/oracleasm/disks/CRSVOL1 Now provide password for sys user and click Next It will prompt you for password standard, just click on Yes Select Do Not Use IPMI and click Next Go with default operating system groups and click Next . If prompted with notification, just click on Yes Provide Oracle Base and Software Installation Location. Click on Next Go with default inventory location. Click Next The run Installer will perform pre-requsites test again. If any step is failed, you must fix it before proceeding ahead The final screen displays installation summary. Important things to note here: Oracle Base Location Oracle Home – This should actually be grid home Click on Finish to start the installation Now the setup will start installing Grid Software on both nodes Now the installer will prompt you for two root.sh scripts to be run on each node. Execute them as root user on both nodes one by one . Your grid installation will finish and Cluster Verification Utility Filed error will be displayed. Just ignore the error. Oracle RAC Installation During the installation of Oracle grid infrastructure, we configured one ASM disk group named +CRS which was used to store the Oracle clusterware files (OCR and voting disk). Now we will configure ASM disk groups for DATA and FRA Create DATA & FRA Diskgroups Launch asmca form the command prompt as oracle user On node 1: ========== su – oracle asmca ASM Configuration Assistant window will launch. From the Disk Groups tab, click on Create . The Create Disk Group window will open and it should show two of the ASMLib volumes we created earlier Click on Create. Give a name to your DATA disk group. This disk group will hold database files. Then click on OK Install Oracle RAC Software – Node 1 only Unzip the database software files under /u02. There will be two files downloaded. Unzip them as oracle user one by one # su - oracle # cd /u02 # unzip linux.x64_11gR2_database_1of2.zip # unzip linux.x64_11gR2_database_2of2.zip Unzipping files will create a new folder as database under same location # ls -lrt drwxr-xr-x 8 oracle oinstall 4096 Aug 21 2009 database -rwxr-xr-x 1 oracle oinstall 1052897657 Nov 2 09:41 linux.x64_11gR2_grid.zip -rwxr-xr-x 1 oracle oinstall 1239269270 Dec 1 01:00 linux.x64_11gR2_database_1of2.zip -rwxr-xr-x 1 oracle oinstall 1111416131 Dec 1 01:01 linux.x64_11gR2_database_2of2.zip Go to database folder and start the runInstaller # cd database # ./runInstaller Create RAC Database From node 1, start dbca as oracle user On node 1: ========== su - oracle dbca Done! Your 2 node RAC database is ready to use! Related Posts Heading 2 Add paragraph text. Click “Edit Text” to customize this theme across your site. You can update and reuse text themes.

  • Find Invalid Objects Inside Oracle

    Find Invalid Objects Inside Oracle Changing things in database can cause some objects to become INVALID . Query to check invalid objects in oracle SELECT OWNER, OBJECT_TYPE, OBJECT_NAME FROM DBA_OBJECTS WHERE STATUS != ‘VALID’ ORDER BY OWNER, OBJECT_TYPE; OR SELECT OWNER, STATUS FROM DBA_OBJECTS WEHRE STATUS !=’VALID’ GROUP BY OWNER, STATUS; Recompiling Invalid Objects You can handle INVALID objects to make them VALID. Execute the below script EXEC UTL_RECOMP.recomp_serial(‘schema name’); --> Oracle 9i EXEC DBMS_UTILITY.COMPILE_SCHEMA(‘SCOTT’); --> 10g and above Note: Oracle highly recommends running the script towards the end of any migration/upgrade/downgrade. Oracle invalid objects sometimes have dependencies, so it may be necessary to run the oracle invalid objects recompile repeatedly. Related Posts Heading 2 Add paragraph text. Click “Edit Text” to customize this theme across your site. You can update and reuse text themes.

  • Oracle Data Guard Manual Switchover and Failover on Physical Standby

    Oracle Data Guard Manual Switchover and Failover on Physical Standby Seamlessly transitioning between primary and standby roles, allowing database administrators to efficiently manage high-availability operations and disaster recovery scenarios in an Oracle Data Guard environment . Perform Manual Switchover on Physical Standby Performing Manual Failover on Physical Standby Perform Manual Switchover on Physical Standby Connect to proddb database via client and keep querying below sqlplus sys/sys@proddb as sysdba select name, open_mode, db_unique_name, database_role from v$database; NAME OPEN_MODE DB_UNIQUE_NAME DATABASE_ROLE --------- -------------- ---------------------- -------------- proddb READ WRITE proddb PRIMARY Check primary and standby for any gaps On primary: =========== select STATUS, GAP_STATUS from V$ARCHIVE_DEST_STATUS where DEST_ID = 2; On standby: =========== select NAME, VALUE, DATUM_TIME from V$DATAGUARD_STATS; We will first convert primary to standby and later standby to primary On primary: =========== select SWITCHOVER_STATUS from V$DATABASE; You must see TO STANDBY or SESSIONS ACTIVE alter database commit to switchover to physical standby with session shutdown; startup mount; At this stage, there is no primary to accept queries from client. Run below query on client putty terminal. The query will hang and wait until standby is converted to primary select name, open_mode, db_unique_name, database_role from v$database; Convert standby to primary: Our primary is already converted to standby. Now it’s time to convert original standby into primary select SWITCHOVER_STATUS from V$DATABASE; alter database commit to switchover to primary with session shutdown; alter database open; At this stage, the client query would execute successfully! On new standby – Initially your primary database: Start MRP alter database recover managed standby database disconnect; Revert back: Once again follow the above process from top and re-execute steps in proper databases to revert back to original setup. Performing Manual Failover on Physical Standby Failover is when your primary database is completely lost. When there is a failover, standby is converted into primary but primary is not converted into standby as it is lost. If you do not have Flashback enabled on primary, you must re-create primary from scratch (Using RMAN duplicate method). In this example, we have already enabled flashback on both primary and standby. Crash Primary Database Perform Failover to Standby Rebuild Primary After Failover Our current physical standby server overview ​Database SID Database Role Proddb Primary Database proddb_st Physical Standby Crash Primary database Let’s crash primary (proddb): In order to simulate failure, we will shut down the primary server proddb. As root user, shutdown the server without shutting down DB. Execute query on client: At this stage, there is no primary to accept queries from client. Run below query on client putty terminal. The query will hang and wait until standby is converted to primary select name , open_mode , db_unique_name , database_role from v$database ; Perform Failover to Standby Minimize data loss (proddb): If you can mount the primary database, then flush the logs to standby On primary : =========== SQL > startup mount SQL > alter system flush redo to 'proddb_st' ; If you are not able to mount the database, then check if primary server is up. In that case manually copy archive logs from primary to standby and register those logs on standby database On standby : =========== SQL > alter database register physical logfile '&logfile_path' ; Check for redo gaps: If any gap exists, copy log files from primary and register on standby as per last step On standby : =========== SQL > select THREAD# , LOW_SEQUENCE# , HIGH_SEQUENCE# from V$ARCHIVE_GAP ; Start failover: We need to activate standby so that client can continue to access even after failover On standby : =========== SQL > ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL ; SQL > ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH ; SQL > select SWITCHOVER_STATUS from V$DATABASE ; You must see TO PRIMARY or SESSIONS ACTIVE. Switch standby to primary SQL > alter database commit to switchover to primary with session shutdown ; SQL > alter database open ; Check client query: Check the query you executed in step 2 on client, it must get executed Rebuild Primary After Failover Post failover, there are two methods of rebuilding your failed primary Method 1: Rebuild from scratch à RMAN duplicate Method 2: Flashback database à only if Flashback was enabled Note: In our earlier activity, we have performed Failover. Current state of your servers should be ​Database SID ​Database Role ​proddb ​crashed (we shutdown the server) proddb_st ​Primary Get the SCN at which standby became primary: We need to get the SCN at which the current primary(proddb_st) was activated. This SCN will be used to flashback crashed (proddb) database SQL > select to_char ( standby_became_primary_scn ) from v$database ; Flashback crashed primary(proddb): Start the proddb server, mount the database and flashback proddb to SCN from the last step SQL > shutdown immediate ; SQL > startup mount ; SQL > flashback database to scn < standby_became_primary_scn > ; Convert crashed primary to physical standby(proddb): Now the old primary is at SCN when proddb_st was activated. We can convert proddb into a physical standby and start redo apply SQL > alter database convert to physical standby ; SQL > shutdown immediate ; SQL > startup mount ; SQL > alter database recover managed standby database disconnect ; Current state of your databases should be ​Database SID Database Role proddb Physical Standby proddb_st Primary Revert to original configuration: At this stage, if you would like to revert the current state of databases to original, you can perform manual switchover! Related Posts Heading 2 Add paragraph text. Click “Edit Text” to customize this theme across your site. You can update and reuse text themes.

  • Database Administration | DBA Genesis Support

    Database Administration Oracle 21c Installation on Linux Oracle 21c is an innovation release that provides early insights to latest developments and features. Install Oracle 19c with ASM In this article we would be looking at installing Oracle 19c with ASM on Linux. This will allow us to create 19c databases on ASM disks.... Oracle Flashback Oracle flashback allows you to move database back in time. You can use flashback technology to move entire database or a particular table... Oracle 12c Installation on Oracle Linux 7 In this article, we will be looking at Oracle 12cR2 installation on Oracle Linux 7.7 version. The steps are exactly same for OEL 6 and... Oracle 12c Installation on Linux with ASM In this article we will be looking at Oracle 12c release 2 installation on Oracle Linux 7.6 with ASM. If you already know, Oracle ASM... Tablespace Administration Administering Tablespace is one of the most important jobs of an Oracle DBA. It makes sure that database has enough space to accommodate... Physical Oracle Database Limits When you try to add data files or resize existing data files, you cannot go with any number in your mind. Oracle database has limitations... Removing Deadlocks in Oracle You locked row A, another session locked row B. Now, you want to lock row B but you are blocked by the other session. The other session... Oracle 12c Multi-tenant Interview Questions Interview questions specific to Oracle 12c Multi-tenant architecture. Enjoy! Q. What are the major changes in architecture for 12c? From... Oracle 11g to 12c Rolling Upgrade A rolling upgrade allows you to perform database upgrade without having any noticeable downtime to the end users. There are multiple ways... Downloading Oracle 12c Using Linux wget When you are working on a Linux server, you do not need to use tools like WINSCP or other file sharing software. You can simply use wget... Oracle 11g Silent Install In this article we will be looking at Oracle 11g silent mode installation (without using the GUI method). Create Response File...

  • Oracle Database Migration from Windows to Linux Using RMAN

    Oracle Database Migration from Windows to Linux Using RMAN We all know that RMAN is a powerful tool for database backup, recovery, cloning and migration. In this article, we will be perform database migration from Windows to Linux using RMAN with two scenarios. RMAN Windows to Linux Migration (same version) RMAN Windows to Linux Migration (higher version) RMAN Windows to Linux Migration (same version) In this scenario, we will be migrating Oracle database from Windows to Linux where both source and target database version are 12c. Both source & target database version is same - 12c In order to convert the database from one platform to another, the endian format of both databases should be the same. Let's check the v$transportable_platform view for both platforms col platform_name for a35 set pagesize 1000 select * from v$transportable_platform order by 2; We can see from the output that both Windows and Linux are in the little-endian format. Open the source database is read-only mode shutdown immediate; startup mount; alter database open read only; Use dbms_tdb.check_db function to check whether the database can be transported to a target platform set serveroutput on declare v_return boolean; begin v_return:=dbms_tdb.check_db('Linux x86 64-bit'); end; / If nothing is returned, then it means that the database is ready to be transported to the destination platform. Execute below function to check for the existence of external objects, directories, and BFILEs declare v_return boolean; begin v_return:=dbms_tdb.check_external; end; / Create pfile from spfile create pfile from spfile; Start RMAN conversion in SOURCE database rman target / convert database new database 'orcl' transport script 'c:\Clone\transport.sql' db_file_name_convert 'C:\app\piyus\oradata\orcl' 'c:\Clone' to platform 'Linux x86 64-bit'; Now copy the parameter file, transport.sql script, which is located at the $ORACLE_HOME/database directory, that is used to create the database and all datafiles to the destination host Create dump directories on target host cd $ORACLE_BASE mkdir -p admin/orcl/adump admin/orcl/bdump mkdir -p admin/orcl/cdump admin/orcl/udump mkdir -p oradata/orcl/ mkdir -p fast_recovery_area/orcl Copy below files carefully from source to target host: We have to copy all the datafile in oradata folder Pfile to $ORACLE_HOME/dbs and TRANSPORT.SQL to the /tmp Edit the Pfile on target host and change the path of the below: adump location control_files locations Edit the transportscript.sql file and change the locations of pdfile, redolog files and data files Now set the ORACLE_SID to orcl , connect to sqlplus and run the transport script SQL> @/tmp/TRANSPORT.SQL RMAN Windows to Linux Migration (higher version) In this scenario, we will be migrating Oracle database from Windows to Linux where both source database is 12c version and target database is 19c version. Source database is 12c and target database is 19c version In order to Clone the database from Windows 12c to Linux 19c we have to do the same as steps as we did above, we just need to edit the TRANSPORT.SQL and remove all the lines after STARTUP UPGRADE parameter Set the ORACLE_SID to orcl and run the script inside sqlplus SQL> @/tmp/TRANSPORT.SQL Our next steps is to upgrade the database to 19c cd $ORACLE_HOME/rdbms/admin $ORACLE_HOME/perl/bin/perl catctl.pl catupgrd.sql This will take around takes about 40-50mins to upgrade 12c to 19c Login to the sqlplus again and bounce the database and create spfile create SPFILE from PFILE; Run utlrp.sql script to re-compile invalid objects - if any SQL> @?/rdbms/admin/utlrp.sql Wait for the script to complete and your database migration from Windows to Linux onto a higher version is done! Further Read How to move database between platforms Related Posts Heading 2 Add paragraph text. Click “Edit Text” to customize this theme across your site. You can update and reuse text themes.

  • Install MySQL 8 on Oracle Linux

    Install MySQL 8 on Oracle Linux Installing MySQL on Oracle Linux is simple and straightforward. Download the latest version of MySQL based on your OS version. Server Configuration Install MySQL 8 Secure MySQL 8 Installation Server Configuration Disable SE Linux on the server as root user setenforce Permissive vi /etc/selinux/config --> change SELINUX to permissive Install wget utility (if not installed) to download MySQL RPM directly inside Linux server yum -y install wget Install MySQL 8 At the time of writing this article, below was the latest MySQL rpm. You must download the latest rpm for RedHat, copy download link and use wget to download MySQL directly on your Linux server wget https://repo.mysql.com//mysql80-community-release-el7-6.noarch.rpm Install the downloaded RPM yum -y install mysql80-community-release-el7-6.noarch.rpm Check if repo is enabled to download MySQL yum repolist enabled | grep mysql Run below to install MySQL 8. The first command is required for updated GPG key rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 yum -y install mysql-community-server Create directories to hold database files mkdir -p /u01/data mkdir -p /u01/log_bin mkdir -p /u01/tmpdir chown -R mysql:mysql /u01 chmod -R 755 /u01 Edit /etc/my.cnf file and add below parameters user=mysql log_bin=/u01/log_bin/myDB datadir=/u01/data tmpdir=/u01/tmpdir Enable MySQL services to autostart on reboot systemctl enable mysqld systemctl start mysqld systemctl status mysqld Secure MySQL 8 Installation Check the temporary password for MySQL grep 'temporary password' /var/log/mysqld.log Secure MySQL /usr/bin/mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: The existing password for the user account root has expired. Please set a new password. New password: Re-enter new password: The 'validate_password' component is installed on the server. The subsequent steps will run with the existing configuration of the component. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : ... skipping. By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : ... skipping. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : ... skipping. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : ... skipping. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : ... skipping. All done! Connect to MySQL and check the databases mysql --user=root --password mysql> show databases; Enjoy! Related Posts Heading 2 Add paragraph text. Click “Edit Text” to customize this theme across your site. You can update and reuse text themes.

  • Send Email From Oracle Linux Server

    Send Email From Oracle Linux Server Getting an email alert from your Linux server is very important when it comes to notifying administrators. Every time a script is executed, its a great ideas to configure you Linux server to send emails. Let's look at the different ways in which you can configure email alerts using SMTP via Gmail. Gmail Pre-Requisites for SMTP Configure Mail on Linux Note: as we don't have mail server configured on Linux server, we will use gmail to send emails to recipient Gmail Pre-Requisites for SMTP We are basically using gmail account (email sender) which will send emails to recipients. For gmail to send emails, we need to make some changes. Login to your gmail https://myaccount.google.com/u/6/security and and enable 2-factor authentication, if not already done Once done, we will not generate app password so that we do not have to put our gmail password on Linux server mail configuration files Select app as Mail Select device as Other (Custom name), type postfix and click on Generate You alternate password is ready, you will be using this password going forward to setup email sending from the Linux server Our gmail account is ready to be used as email sender! Configure Mail on Linux There two methods you can use to configure email on Linux server Method 1: Send Email Using Postfix (Quick!) Method 2: Send Email Using Mailx Use any one method to configure mail on Linux, not both Method 1: Send Email Using Postfix Install postfix and other dependent packages yum install -y postfix mailx cyrus-sasl cyrus-sasl-plain Start postfix systemctl enable postfix systemctl start postfix Replace sender email and app password before executing below echo 'smtp.gmail.com : ' > /etc/postfix/sasl_passwd Set the permissions and load the sasl_passwd file chmod 600 /etc/postfix/sasl_passwd postmap hash:/etc/postfix/sasl_passwd Open postfix configuration file and paste below at the end of the file on Oracle Linux If you using gmail to send emails, just copy paste below vi /etc/postfix/main.cf #SMTP Gmail Relay for Oracle Linux smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_tls_security_level = secure smtp_tls_mandatory_protocols = TLSv1 smtp_tls_mandatory_ciphers = high smtp_tls_secure_cert_match = nexthop smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt relayhost = smtp.gmail.com:587 Only for CentOS , comment smtp_tls_security_level parameter, else email won't work #smtp_tls_security_level = secure Restart postfix systemctl restart postfix Send test email echo "Hello" | mail -s "test" Verify via below command if email is sent or stuck due to some error mailq Method 2: Send Email using Mailx This method of Linux mail setup does not work with CentOS Install Mailx package yum install -y mailx Edit /etc/mail.rc file and put below SMTP configuration at the end vi /etc/mail.rc #smtp settings set smtp=smtp://smtp.gmail.com:587 set smtp-auth=login set smtp-auth-user= set smtp-auth-password= set smtp-use-starttls set nss-config-dir=/etc/mail_certs set ssl-verify=ignore We need to setup SSL certificate so that gmail knows that emails are being sent from a trusted source. Create a certificate directory then create new certificate and key databases mkdir /etc/mail_certs certutil -N -d /etc/mail_certs --> give password Copy the cert chain for smtp.google.com:465 over to my_certs file ( CTRL + C to end ) openssl s_client -showcerts -connect smtp.gmail.com:465 > /etc/mail_certs/my_certs Open my_certs file and you will see three certs starting with --BEGIN CERTIFICATE-- and --END CERTIFICATE-- cat /etc/mail_certs/my_certs Copy the google cert (usually the first one) into a new file vi /etc/mail_certs/google --> save & close Copy the geotrust cert (usually the second one) into a new file vi /etc/mail_certs/geotrust --> save & close Copy the equifax cert (usually the third one) into a new file vi /etc/mail_certs/equifax --> save & close Start importing the google cert certutil -A -n "Google Internet Authority" -t "TC,," -d /etc/mail_certs -i /etc/mail_certs/google Start importing the geotrust cert certutil -A -n "GeoTrust Global CA" -t "TC,," -d /etc/mail_certs -i /etc/mail_certs/geotrust Start importing the equifax cert certutil -A -n "Equifax Secure Certificate Authority" -t "TCP,," -d /etc/mail_certs -i /etc/mail_certs/equifax Verify if certs are imported properly certutil -L -d /etc/mail_certs The next step is crucial as this will allow other users on Linux server to send email Give permissions on mail_certs so that other users on Linux server can send emails chmod -R 755 /etc/mail_certs/* Send test email echo "Your message" | mail -s "Subject" Enjoy! Related Posts Heading 2 Add paragraph text. Click “Edit Text” to customize this theme across your site. You can update and reuse text themes.

  • Projects | DBA Genesis Support

    Projects SQL Project - Supermarket Billing The goal of the project is to create a database for a supermarket to efficiently manage inventory, sales, and customer information. SQL Project - Library Management The goal of the project is to create a database for a library management system that allows users to efficiently manage customer information, book inventory & book borrowings Linux Project - Monitor Server Disk Space In this Linux project we will write a shell script that will monitor the disk space and put the info in a file every 20 mints. Setting up...

  • SQL Project - Supermarket Billing

    SQL Project - Supermarket Billing The goal of the project is to create a database for a supermarket to efficiently manage inventory, sales, and customer information. 1. Products Table creation and insert sample data: Table Creation: CREATE TABLE mkt_Products ( ProductID INT PRIMARY KEY, ProductName VARCHAR(50), Category VARCHAR(50), Price DECIMAL(10, 2), StockQuantity INT ); Insert Data: INSERT ALL INTO mkt_Products VALUES (1, 'Laptop', 'Electronics', 800.00, 50) INTO mkt_Products VALUES (2, 'Smartphone', 'Electronics', 500.00, 100) INTO mkt_Products VALUES (3, 'Desk Chair', 'Furniture', 120.00, 25) INTO mkt_Products VALUES (4, 'Coffee Maker', 'Appliances', 40.00, 30) INTO mkt_Products VALUES (5, 'Running Shoes', 'Apparel', 80.00, 50) INTO mkt_Products VALUES (6, 'Bookshelf', 'Furniture', 150.00, 20) INTO mkt_Products VALUES (7, 'Backpack', 'Accessories', 30.00, 40) INTO mkt_Products VALUES (8, 'Microwave', 'Appliances', 70.00, 15) INTO mkt_Products VALUES (9, 'Office Desk', 'Furniture', 200.00, 10) INTO mkt_Products VALUES (10, 'T-shirt', 'Apparel', 15.00, 75) SELECT * FROM dual; 2. Clients Table creation and insert sample data: Table Creation: CREATE TABLE mkt_Clients ( ClientID INT PRIMARY KEY, FirstName VARCHAR(50), LastName VARCHAR(50), Email VARCHAR(100), Phone VARCHAR(15) ); Insert Data: INSERT ALL INTO mkt_Clients VALUES (1, 'John', 'Doe', 'john.doe@example.com', '555-1234') INTO mkt_Clients VALUES (2, 'Jane', 'Smith', 'jane.smith@example.com', '555-5678') INTO mkt_Clients VALUES (3, 'Robert', 'Johnson', 'robert.j@example.com', '555-9876') INTO mkt_Clients VALUES (4, 'Emily', 'Davis', 'emily.davis@example.com', '555-4321') INTO mkt_Clients VALUES (5, 'Michael', 'Wilson', 'michael.w@example.com', '555-8765') INTO mkt_Clients VALUES (6, 'Lisa', 'Miller', 'lisa.miller@example.com', '555-2345') INTO mkt_Clients VALUES (7, 'David', 'Brown', 'david.brown@example.com', '555-6789') INTO mkt_Clients VALUES (8, 'Sarah', 'Turner', 'sarah.turner@example.com', '555-3456') INTO mkt_Clients VALUES (9, 'Kevin', 'Harris', 'kevin.harris@example.com', '555-7890') INTO mkt_Clients VALUES (10, 'Emma', 'Taylor', 'emma.t@example.com', '555-4567') SELECT * FROM dual; 3. Sales Table creation and insert sample data: Table Creation: CREATE TABLE mkt_Sales ( SaleID INT PRIMARY KEY, ProductID INT, ClientID INT, SaleDate DATE, Quantity INT, TotalAmount DECIMAL(10, 2), FOREIGN KEY (ProductID) REFERENCES mkt_Products(ProductID), FOREIGN KEY (ClientID) REFERENCES mkt_Clients(ClientID) ); Insert Data: INSERT ALL INTO mkt_Sales VALUES (1, 1, 1, TO_DATE('2024-01-01', 'YYYY-MM-DD'), 2, 1600.00) INTO mkt_Sales VALUES (2, 3, 2, TO_DATE('2024-01-03', 'YYYY-MM-DD'), 1, 120.00) INTO mkt_Sales VALUES (3, 7, 4, TO_DATE('2024-01-05', 'YYYY-MM-DD'), 3, 90.00) INTO mkt_Sales VALUES (4, 5, 5, TO_DATE('2024-01-08', 'YYYY-MM-DD'), 5, 400.00) INTO mkt_Sales VALUES (5, 9, 3, TO_DATE('2024-01-10', 'YYYY-MM-DD'), 1, 200.00) INTO mkt_Sales VALUES (6, 2, 6, TO_DATE('2024-01-12', 'YYYY-MM-DD'), 2, 1000.00) INTO mkt_Sales VALUES (7, 4, 7, TO_DATE('2024-01-15', 'YYYY-MM-DD'), 4, 160.00) INTO mkt_Sales VALUES (8, 8, 9, TO_DATE('2024-01-18', 'YYYY-MM-DD'), 1, 70.00) INTO mkt_Sales VALUES (9, 6, 8, TO_DATE('2024-01-20', 'YYYY-MM-DD'), 3, 450.00) INTO mkt_Sales VALUES (10, 10, 10, TO_DATE('2024-01-22', 'YYYY-MM-DD'), 2, 30.00) SELECT * FROM dual; 4. Suppliers Table creation and insert sample data: Table Creation: CREATE TABLE mkt_Suppliers ( SupplierID INT PRIMARY KEY, SupplierName VARCHAR(50), ContactPerson VARCHAR(50), Email VARCHAR(100), Phone VARCHAR(15), FOREIGN KEY (SupplierID) REFERENCES mkt_Sales(SaleID) ); Insert Data: INSERT ALL INTO mkt_Suppliers VALUES (1, 'Tech Distributors', 'Mark Johnson', 'info@techdist.com', '555-1111') INTO mkt_Suppliers VALUES (2, 'Furniture Mart', 'Sarah Smith', 'sales@furnituremart.com', '555-2222') INTO mkt_Suppliers VALUES (3, 'Appliance World', 'David Brown', 'support@applianceworld.com', '555-3333') INTO mkt_Suppliers VALUES (4, 'Shoe Wholesalers', 'Emily Davis', 'sales@shoewholesale.com', '555-4444') INTO mkt_Suppliers VALUES (5, 'Book Suppliers', 'Michael Wilson', 'books@suppliers.com', '555-5555') INTO mkt_Suppliers VALUES (6, 'Office Solutions', 'Lisa Miller', 'info@officesolutions.com', '555-6666') INTO mkt_Suppliers VALUES (7, 'Accessory Hub', 'Robert Johnson', 'contact@accessoryhub.com', '555-7777') INTO mkt_Suppliers VALUES (8, 'Kitchen Essentials', 'Jane Smith', 'info@kitchenessentials.com', '555-8888') INTO mkt_Suppliers VALUES (9, 'Apparel World', 'Kevin Harris', 'info@apparelworld.com', '555-9999') INTO mkt_Suppliers VALUES (10, 'Sports Gear Inc.', 'Emma Taylor', 'sales@sportsgear.com', '555-0000') SELECT * FROM dual; 5. Employee Details creation and insert sample data: Table Creation: CREATE TABLE mkt_EmployeeDetails ( EmployeeID INT PRIMARY KEY, FirstName VARCHAR(50), LastName VARCHAR(50), Email VARCHAR(100), Phone VARCHAR(15) ); Insert Data: INSERT ALL INTO mkt_EmployeeDetails VALUES (1, 'Adam', 'Johnson', 'adam.j@example.com', '555-1234') INTO mkt_EmployeeDetails VALUES (2, 'Olivia', 'Brown', 'olivia.b@example.com', '555-5678') INTO mkt_EmployeeDetails VALUES (3, 'Liam', 'Miller', 'liam.m@example.com', '555-9876') INTO mkt_EmployeeDetails VALUES (4, 'Ava', 'Davis', 'ava.d@example.com', '555-4321') INTO mkt_EmployeeDetails VALUES (5, 'Noah', 'Wilson', 'noah.w@example.com', '555-8765') INTO mkt_EmployeeDetails VALUES (6, 'Sophia', 'Smith', 'sophia.s@example.com', '555-2345') INTO mkt_EmployeeDetails VALUES (7, 'Jackson', 'Turner', 'jackson.t@example.com', '555-6789') INTO mkt_EmployeeDetails VALUES (8, 'Emma', 'Harris', 'emma.h@example.com', '555-3456') INTO mkt_EmployeeDetails VALUES (9, 'Aiden', 'Taylor', 'aiden.t@example.com', '555-7890') INTO mkt_EmployeeDetails VALUES (10, 'Grace', 'Jones', 'grace.j@example.com', '555-1111') SELECT * FROM dual; 6. Employees Table creation and insert sample data: Create mkt_Employees table with Employee_Position: CREATE TABLE mkt_Employees ( SaleID INT PRIMARY KEY, ProductID INT, ClientID INT, EmployeeID INT, SaleDate DATE, Quantity INT, Employee_Position VARCHAR(50), -- Add this column FOREIGN KEY (EmployeeID) REFERENCES mkt_EmployeeDetails(EmployeeID) ); Insert data into mkt_Employees from mkt_EmployeeDetails, mkt_Products, mkt_Clients, and mkt_Sales: INSERT INTO mkt_Employees (SaleID, ProductID, ClientID, EmployeeID, SaleDate, Quantity) SELECT s.SaleID, p.ProductID, c.ClientID, ed.EmployeeID, s.SaleDate, s.Quantity FROM mkt_Sales s JOIN mkt_Products p ON s.ProductID = p.ProductID JOIN mkt_Clients c ON s.ClientID = c.ClientID JOIN mkt_EmployeeDetails ed ON s.ClientID = ed.EmployeeID; Update the job positions in mkt_Employees: UPDATE mkt_Employees SET Employee_Position = ( CASE WHEN EmployeeID = 1 THEN 'Sales Associate' WHEN EmployeeID = 2 THEN 'Manager' WHEN EmployeeID = 3 THEN 'Customer Support' WHEN EmployeeID = 4 THEN 'Warehouse Clerk' WHEN EmployeeID = 5 THEN 'IT Specialist' WHEN EmployeeID = 6 THEN 'Marketing' WHEN EmployeeID = 7 THEN 'HR Manager' WHEN EmployeeID = 8 THEN 'Finance' WHEN EmployeeID = 9 THEN 'Logistics' WHEN EmployeeID = 10 THEN 'Research Analyst' ELSE NULL END ); Write Queries: To retrieve product details, customer information, and sales records. To generate sales details based on the product. To find remaining stock. Related Posts Heading 2 Add paragraph text. Click “Edit Text” to customize this theme across your site. You can update and reuse text themes.

  • Oracle ADDM Report

    Oracle ADDM Report It analysis AWR report to identify potential performance bottle neck. For each identified issue, it locates the root cause and provides recommendations. It is created and stored every time AWR report is run provided STATISTICS_LEVEL parameter is set to TYPICAL or ALL. To create ADDM Report @$ORACLE_HOME/rdbms/admin/addmrpt.sql Sample output of ADDM report: FINDING: 59% impact (944 seconds) The buffer cache was undersized causing significant additional read I/O. RECOMMENDATION 1: DB Configuration, 59% benefit (944 seconds) ACTION: Increase SGA target size by increasing the value of parameter “sga_target” by 28 M. SYMPTOMS THAT LED TO THE FINDING: Wait class User I/O was consuming significant database time. (83% impact [1336 seconds]) Related Posts Heading 2 Add paragraph text. Click “Edit Text” to customize this theme across your site. You can update and reuse text themes.

  • Schedule RMAN Backup on Windows

    Schedule RMAN Backup on Windows Scheduling RMAN backups on a windows machine is little different than Linux machine. Windows uses bash shell and windows scheduler to automate RMAN backups. Create RMAN Backup Script File Create Bash Shell Add Schedule to Windows Scheduler Create RMAN Backup Script File We will create a backup.cmd file with our RMAN run block for database backup run{ crosscheck backup; backup database plus archivelog; }; Create Bash Shell Create a proddb_rman_backup.bat (.bat is a windows bash shell) file which will call above file set oracle_sid=proddb rman target sys/sys@ecccatalog rman_rc/rman_rc@rcat cmdfile='F:\backup.cmd' log='F:\rman_backup_full\backup.log' Add Schedule to Windows Scheduler Schedule the above .bat script in windows scheduler Launch the Task Scheduler from start menu On the right-hand panel, click on Create Task Give a name to your task Click on Triggers tab >> New and define the schedule Make sure you set proper frequency like daily or weekly and set proper start date and time. Click on Actions tab >> New and provide the location of .bat file you created Click on OK and task will be created. You can even run the task for testing by right clicking on the task name and select Run Related Posts Heading 2 Add paragraph text. Click “Edit Text” to customize this theme across your site. You can update and reuse text themes.

  • Install Neo4j on Docker

    Install Neo4j on Docker On Windows platform: Install Docker by going to the website https://docs.docker.com/desktop/windows/install/ and downloading the docker file. Note: A 64-bit processor and 4GB system RAM are the hardware prerequisites required to successfully run Docker on Windows 10. Double-click on the Docker Desktop Installer.exe to run the installer. Once you start the installation process, always enable Hyper-V Windows Feature on the Configuration page and follow the installation process to allow the installer and wait till the process is done. After completion of the installation process, click Close and restart your PC. Sign In the Docker https://hub.docker.com/ search for the NEO4j Open Command Prompt as Administrative Rights run the below command to pull the official image of Neo4j docker pull neo4j After completion To verify open the Docker and click the Images menu. To Run open the command prompt and run the following command. docker run -it --rm --publish=7474:7474 --publish=7687:7687 -e NEO4J_dbms_connector_https_advertised__address=":7473" -e NEO4J_dbms_connector_http_advertised__address=":7474" -e NEO4J_dbms_connector_bolt_advertised__address=":7687" --env=NEO4J_AUTH=none neo4j open the link http://localhost:7474/ in the browser and set name and password. Now you are connected to database: open terminal and test cypher command neo4j@neo4j> match (n) return count(n); On Linux platform: Installing Docker on Oracle Linux 8/7 Before we begin, run the system update command to rebuild the repo cache and update installed packages. sudo yum update Now Install some of the default packages sudo yum install -y yum-utils Add Docker repository to Oracle Linux sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo Add this below entry to the /etc/yum.repos.d/docker-ce.repo file [centos-extras] name=Centos extras - $basearch baseurl=http://mirror.centos.org/centos/7/extras/x86_64 enabled=1 gpgcheck=1 gpgkey=http://centos.org/keys/RPM-GPG-KEY-CentOS-7 Now run the below command to install the extra plugin required by the docker yum -y install slirp4netns fuse-overlayfs container-selinux Lastly, to install Docker Engine, command line and contained (a standalone high-level container runtime) run, finally, this command. sudo yum install docker-ce docker-ce-cli containerd.io Enable and start the Docker service sudo systemctl start docker sudo systemctl enable docker Add User to Docker group By default, docker needs the root access to run commands, Therefore, we will add our current or the user that you want to use to access docker to the docker group. sudo groupadd docker sudo usermod -aG docker your_user Now, we have finally Installed Docker in Oracle Linux. Our Next step is to PULL the Neo4j Image. docker pull neo4j After, Image is downloaded in the docker, we are ready to run it. To verify it, we can use web browser to and open url localhost:7474 Cypher Shell If you want to run cypher shell, Run the below command docker exec -it testneo4j bash cypher-shell -u neo4j -p test Thank you. Related Posts Heading 2 Add paragraph text. Click “Edit Text” to customize this theme across your site. You can update and reuse text themes.

Search Results

bottom of page