Wednesday, 31 January 2018

Installing Grid Infrastructure for Single Instance (Oracle Restart) /Configuring Single instance Database on ASM


 Implementing GI for single Instance (Oracle Restart)

Configuring Oracle Parameter
Oracle restart is when we implement GI for single instance database, than we call it as oracle restarts, and you can use service utilities on it.
Below are the steps starting from oracle installation till Database creation on ASM Disk Groups:

vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
192.168.1.20            testdb
::1             localhost6.localdomain6 localhost6
Parameter Setting
Oracle recommend the following minimum parameter settings.
Vi /etc/sysctl.conf
    fs.suid_dumpable = 1
    fs.aio-max-nr = 1048576
    fs.file-max = 6815744
    kernel.shmall = 2097152
    kernel.shmmax = 536870912
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 9000 65500
    net.core.rmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_default = 262144
    net.core.wmem_max = 1048586

Run the following command to change the current kernel parameters.
    /sbin/sysctl –p


Adding Security Limits
Add the following lines to the "/etc/security/limits.conf" file.

    oracle              soft    nproc   2047
    oracle              hard    nproc   16384
    oracle              soft    nofile  4096
    oracle              hard    nofile  65536
    oracle              soft    stack   10240
grid              soft    nproc   2047
    grid              hard    nproc   16384
    grid              soft    nofile  1024
    grid              hard    nofile  65536

Package Installation

nstall the following packages if they are not already present.

    # From Oracle Linux 5 DVD
    cd /media/cdrom/Server
    rpm -Uvh --force --nodeps binutils-2.*
    rpm -Uvh --force --nodeps compat-libstdc++-33*
    rpm -Uvh --force --nodeps compat-libstdc++-33*.i386.rpm
    rpm -Uvh --force --nodeps elfutils-libelf*
    rpm -Uvh --force --nodeps glibc-2.*
    rpm -Uvh --force --nodeps glibc-common-2.*
    rpm -Uvh --force --nodeps glibc-devel-2.*
    rpm -Uvh --force --nodeps glibc-headers-2.*
    rpm -Uvh --force --nodeps gcc-4.*
    rpm -Uvh --force --nodeps gcc-c++-4.*
    rpm -Uvh --force --nodeps ksh*
    rpm -Uvh --force --nodeps libaio-0.*
    rpm -Uvh --force --nodeps libaio-devel-0.*
    rpm -Uvh --force --nodeps libgomp-4.*
    rpm -Uvh --force --nodeps libgcc-4.*
    rpm -Uvh --force --nodeps libstdc++-4.*
    rpm -Uvh --force --nodeps libstdc++-devel-4.*
    rpm -Uvh --force --nodeps make-3.*
    rpm -Uvh --force --nodeps sysstat-7.*
    rpm -Uvh --force --nodeps unixODBC-2.*
    rpm -Uvh --force --nodeps unixODBC-devel-2.*
    rpm -Uvh --force --nodeps numactl-devel-*
    cd /

Create users and groups:

#groupadd -g 501 oinstall
#groupadd -g 502 dba
#groupadd -g 503 oper
#groupadd -g 504 asmadmin
#groupadd -g 506 asmdba
#groupadd -g 507 asmoper

# /usr/sbin/useradd -g oinstall -G asmadmin,asmdba,asmoper,dba -d /home/grid -m grid

# /usr/sbin/useradd -g oinstall -G dba,asmdba,oper -d /home/oracle -m oracle

Set new password for oracle user:

#passwd grid
#passwd oracle

Create the Oracle Inventory Directory

To create the Oracle Inventory directory, enter the following commands as the root user:

# mkdir -p /u01/app/oraInventory
# chown -R grid:oinstall /u01/app/oraInventory
# chmod -R 775 /u01/app/oraInventory


Create the Oracle Grid Infrastructure Home Directory

To create the Grid Infrastructure home directory, enter the following commands as the root user:

# mkdir -p /u01/app/11.2.0/grid
# chown -R grid:oinstall /u01/app/11.2.0/grid
# chmod -R 775 /u01/app/11.2.0/grid

# mkdir -p /u01/app/grid
# chown -R grid:oinstall /u01/app/grid
# chmod -R 775 /u01/app/grid


Create the Oracle Base Directory

To create the Oracle Base directory, enter the following commands as the root user:

# mkdir -p /u01/app/oracle
# mkdir /u01/app/oracle/cfgtoollogs --needed to ensure that dbca is able to run after the rdbms installation.
# chown -R oracle:oinstall /u01/app/oracle
# chmod -R 775 /u01/app/oracle

Create the Oracle RDBMS Home Directory

To create the Oracle RDBMS Home directory, enter the following commands as the root user:

# mkdir -p /u01/app/oracle/product/11.2.0
# chown -R oracle:oinstall /u01/app/oracle/product/11.2.0
# chmod -R 775 /u01/app/oracle/product/11.2.0

Edit the ‘/home/grid/.bash_profile’ file on first Oracle RAC Node for Oracle Grid Infrastructure Installation:

# Oracle 11gR2 Grid Infrastructure environment
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/u01/app/grid

Edit the ‘/home/oracle/.bash_profile’ file on first Oracle RAC Node for Oracle RDBMS Installation:

# Oracle 11gR2 RDBMS environment
# Oracle Settings
    TMP=/tmp; export TMP
    TMPDIR=$TMP; export TMPDIR

    ORACLE_HOSTNAME=testdb; export ORACLE_HOSTNAME
    ORACLE_UNQNAME=testdb; export ORACLE_UNQNAME
    ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
    ORACLE_HOME=$ORACLE_BASE/product/11.2.0; export ORACLE_HOME
    ORACLE_SID=testdb; export ORACLE_SID
    PATH=/usr/sbin:$PATH; export PATH
    PATH=$ORACLE_HOME/bin:$PATH; export PATH

    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
    CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

Now installing packages for ASMLIB
[root@testdb Server]# pwd
/media/Enterprise Linux dvd 20080528/Server
[root@testdb Server]# rpm -Uvh --force --nodeps oracleasm-support-2.0.4-1.el5.i386.rpm
warning: oracleasm-support-2.0.4-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasm-support      ########################################### [100%]
[root@testdb Server]# rpm -Uvh --force --nodeps oracleasm-2.6.18-92.el5-2.0.4-1.el5.i686.rpm
warning: oracleasm-2.6.18-92.el5-2.0.4-1.el5.i686.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasm-2.6.18-92.el5########################################### [100%]
[root@testdb Server]# cd /u01/
[root@testdb u01]# rpm -Uvh --force --nodeps oracleasmlib-2.0.4-1.el5.i386.rpm
warning: oracleasmlib-2.0.4-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasmlib           ########################################### [100%]
[root@testdb u01]# rpm -Uvh --force --nodeps oracleasm-2.6.18-92.el5PAE-2.0.4-1.el5.i686.rpm
[root@testdb u01]#

Now Unzipping the Grid Software
cd /u01
unzip linux_11gR2_grid.zip

Partitioning the Disks added

[root@testdb ~]# fdisk -l

Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         637     5116671   83  Linux
/dev/sda2             638        1790     9261472+  82  Linux swap / Solaris
/dev/sda3            1791        2487     5598652+  83  Linux
/dev/sda4            2488        5221    21960855    5  Extended
/dev/sda5            2488        3124     5116671   83  Linux
/dev/sda6            3125        5221    16844121   83  Linux

Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

Disk /dev/sdd: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdd doesn't contain a valid partition table

Disk /dev/sde: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sde doesn't contain a valid partition table

Disk /dev/sdf: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdf doesn't contain a valid partition table

Disk /dev/sdg: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdg doesn't contain a valid partition table

[root@testdb ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-652, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-652, default 652):
Using default value 652

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Similarly for all others
[root@testdb ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-652, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-652, default 652):
Using default value 652

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Creating ASM Volume Disks:

#
[root@testdb Server]# /etc/init.d/oracleasm createdisk disk1 /dev/sdb1
Marking disk "/dev/sdb1" as an ASM disk: [  OK  ]
[root@testdb Server]# /etc/init.d/oracleasm createdisk disk2 /dev/sdc1
Marking disk "/dev/sdc1" as an ASM disk: [  OK  ]
[root@testdb Server]# /etc/init.d/oracleasm createdisk disk3 /dev/sdd1
Marking disk "/dev/sdd1" as an ASM disk: [  OK  ]
[root@testdb Server]# /etc/init.d/oracleasm createdisk disk4 /dev/sde1
Marking disk "/dev/sde1" as an ASM disk: [  OK  ]
[root@testdb Server]# /etc/init.d/oracleasm createdisk disk5 /dev/sdf1
Marking disk "/dev/sdf1" as an ASM disk: [  OK  ]
[root@testdb Server]# /etc/init.d/oracleasm createdisk disk6 /dev/sdg1
Marking disk "/dev/sdg1" as an ASM disk: [  OK  ]
[root@testdb Server]#

Listing the Created Disks:
[root@testdb Server]# /etc/init.d/oracleasm listdisks
DISK1
DISK2
DISK3
DISK4
DISK5
DISK6
[root@testdb Server]#
Now Run GI SW to install GI and making DG






















Installing Oracle Software & Database Creation:
Login through oracle user:















Configuring Listener









Configuring DB


















Saturday, 27 January 2018

12cR2 Installation on Linux (Step by Step)

Hosts File

The "/etc/hosts" file must contain a fully qualified name for the server.

<IP-address>  <fully-qualified-machine-name>  <machine-name>
For example.

127.0.0.1       localhost localhost.localdomain
192.168.1.21  testdb.com    testdb

Set the correct hostname in the "/etc/hostname" file.

Manual Setup

If you have not used the "oracle-database-server-12cR2-preinstall" package to perform all

prerequisites, you will need to manually perform the following setup tasks.

Add the following lines to the "/etc/sysctl.conf" file, or in a file called

"/etc/sysctl.d/98-oracle.conf".

fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000

than in order to be activate/to take effects now run below command

/sbin/systcl -p



Add the following lines to a file called "/etc/security/limits.d/oracle-database-server-

12cR2-preinstall.conf" file.

oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
oracle   hard   memlock    134217728
oracle   soft   memlock    134217728

Install RPMS from /media/ENterpise/Server



 rpm -Uvh --force --nodeps gcc-4.4.7-3.el6.x86_64.rpm
 rpm -Uvh --force --nodeps gcc-c++-4.4.7-3.el6.x86_64.rpm
 rpm -Uvh --force --nodeps binutils*
 rpm -Uvh --force --nodeps compat-libcap1*
 rpm -Uvh --force --nodeps compat-libstdc++-33*
 rpm -Uvh --force --nodeps compat-libstdc++-33.i686*
 rpm -Uvh --force --nodeps glibc*
 rpm -Uvh --force --nodeps glibc.i686*
 rpm -Uvh --force --nodeps glibc-devel*
 rpm -Uvh --force --nodeps glibc-devel.i686*
 rpm -Uvh --force --nodeps ksh*
 rpm -Uvh --force --nodeps libaio*
 rpm -Uvh --force --nodeps libaio.i686*
 rpm -Uvh --force --nodeps libaio-devel*
 rpm -Uvh --force --nodeps libaio-devel.i686*
 rpm -Uvh --force --nodeps libX11*
 rpm -Uvh --force --nodeps libX11.i686*
 rpm -Uvh --force --nodeps libXau*
 rpm -Uvh --force --nodeps libXau.i686*
 rpm -Uvh --force --nodeps libXi*
 rpm -Uvh --force --nodeps libXi.i686*
 rpm -Uvh --force --nodeps libXtst*
 rpm -Uvh --force --nodeps libXtst.i686*
 rpm -Uvh --force --nodeps libgcc*
 rpm -Uvh --force --nodeps libgcc.i686*
 rpm -Uvh --force --nodeps libstdc++*
 rpm -Uvh --force --nodeps libstdc++.i686*
 rpm -Uvh --force --nodeps libstdc++-devel*
 rpm -Uvh --force --nodeps libstdc++-devel.i686*
 rpm -Uvh --force --nodeps libxcb*
 rpm -Uvh --force --nodeps libxcb.i686*
 rpm -Uvh --force --nodeps make*
 rpm -Uvh --force --nodeps nfs-utils*
 rpm -Uvh --force --nodeps net-tools*
 rpm -Uvh --force --nodeps smartmontools*
 rpm -Uvh --force --nodeps sysstat*
 rpm -Uvh --force --nodeps unixODBC*
 rpm -Uvh --force --nodeps unixODBC-devel*

Define different groups


groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
#groupadd -g 54324 backupdba
#groupadd -g 54325 dgdba
#groupadd -g 54326 kmdba
#groupadd -g 54327 asmdba
#groupadd -g 54328 asmoper
#groupadd -g 54329 asmadmin
#groupadd -g 54330 racdba

Creating Oracle User

useradd -u 54321 -g oinstall -G dba,oper oracle

passwd oracle

Creating Directories structure

mkdir -p /u01/app/oracle/product/12.2.0.1/dbhome
chown -R oracle:oinstall /u01
chmod -R 775 /u01


Setting Environment Variable



# Oracle Settings
    TMP=/tmp; export TMP
    TMPDIR=$TMP; export TMPDIR

    ORACLE_HOSTNAME=testdb.com; export ORACLE_HOSTNAME
    ORACLE_UNQNAME=cdb1; export ORACLE_UNQNAME
    ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
    ORACLE_HOME=$ORACLE_BASE/product/12.2.0.1/db_1; export ORACLE_HOME
    ORACLE_SID=cdb1; export ORACLE_SID
    PATH=/usr/sbin:$PATH; export PATH
    PATH=$ORACLE_HOME/bin:$PATH; export PATH

    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
    CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

Monday, 22 January 2018

Moving Files across Linux Servers without prompting for passwords

Transfer Files between 2 Linux Machine without prompt for the Password

Server A [192.168.1.20]
Server B [192.168.1.21]

You want to automate it that shell script run at any time and move file from Server A to Server B with out prompting for the passwords.

-- Ping Server B from Server A and and Server A from Server B.

ping -t 192.168.1.21
64 bytes from 192.168.1.21 icmp_seq=1 ttl=64 time=0.246

Let suppose that Oracle user should be used to transfer files a folder in Server A to Server B

Login through Oracle User to Server A and run from below command :

Oracle] $  ssh-keygen -t rsa
Just press enter

It will generate 2 files in /home/oracle/.ssh directory:
id_rsa.pub
id_rsa

-- File id_rsa.pub are your public keys copy this file to Server B to location /home/oracle/.ssh

.ssh] $scp id_rsa.pub oracle@192.168.1.21:/home/oracle/.ssh
password: *********

--Now Goto Server 2

oracle] $ cd .ssh
.ssh] $ cat id_rsa.pub >>~/.ssh/authorized_keys

It will be appended to authorized keys file.

chmod 600 authorized_keys  &

chmod -R 700 .ssh/


--Now move any file from Server A to Server B with prompting for passwords

scp any_directory/anyfiles oracle@serverB:/anydiretory


File will be copied without prompting for password.


Sunday, 21 January 2018

Logical Backup (Datapump Utility)

Oracle backup Logical Backup

About the backup, i've already give a bit clue in my previous blog (https://tauseefdba.blogspot.com/2018/01/backing-up-oracle-database-physical.html), Logical backup is one in which we didn't copy files but copy structure and the data with in that structure is copied. Logical backup means backing up the database objects like tables, views , indexes...etc using the datapump (EXPDP,IMDP) utility given by Oracle.
Datapump is a bit faster than export utility used in past, but its over all too slow as compared to physical/RMAN backup, but it is handy in moving objects or schemas in between the databases. Simple prcoess to take backup through Datapump is :

-- Getting started

create user testuser identified by test default tablespace users;

-- Create directory at location physically

$ cd /u01

u01$ mkdir backup

$ cd backup

$ pwd
/u01/backup

-- Creating directory in Oracle Database

$sqlplus / as sysdba

SQL> create directory backup as '/u01/backup';

-- Granting privileges

SQL> grant read,write ON DIRECTORY backup TO testuser;

--Full database backup

expdp system/oracle full=y dumpfile=testdb_full.dmp logfile=export_testdb_full.log directory=backup

Impdp system/oracle Full=y dumpfile=testdb_full.dmp logfile=import_testdb_full.log directory=backup

-- Specific Schemas

expdp system/oracle schemas=hr,scott dumpfile=testdb_hrscott.dmp logfile=export_hrscott_full.log directory=backup

Impdp system/oracle schemas=hr,scott dumpfile=testdb_hrscott.dmp logfile=import_hrscott_full.log directory=backup

--  Selective Tables

expdp hr/hr tables=EMPLOYEES,DEPARTMENT directory=backup dumpfile=EMP_DEPT.dmp logfile=expdpEMP_DEPT.log

impdp hr/hr tables=EMPLOYEES,DEPARTMENT directory=backup dumpfile=EMP_DEPT.dmp logfile=impdpEMP_DEPT.log

-- Backing meta data only

expdp  system/oracle directory=backup dumpfile=hr_metadata_content.dmp logfile=exp_content_hr.log schemas=hr content=METADATA_ONLY

impdp directory=backup dumpfile=hr_metadata_content.dmp logfile=imp_content_meta_hr.log remap_schema=hr:hr_new full=y


Wednesday, 17 January 2018

Backing Up Oracle Database (Physical Backup RMAN Utility)

Backup Oracle Database

There are 2 main types of backup in Oracle.
1- Physical Backup 
2- Logical Backup

But in this blog we will focus on physical Backup. In physical backup, all files such as datafiles, controlfile and archive redolog files are stored physically on other disk or some other medium like tape storages. Further we can take 2 types of physical backup. i.e cold backup and hot backup.

--Cold backup: It is type of backup when we stop the database server to perform any operations on database and we close the database, that is database is in mount stage, it is
the most safiest way of complete/full backup. It can be called as offline backup.

--Hot backup: It is type of backup when operations are being performed on database by the users and we take the backup, but for this type of backup to be full/completed we need database
to be in archive log mode (please read archive log mode blog), This type of backup is also called as hot backup.

Backup through RMAN:

--Cold backup:

Sqlplus / as sysdba

sql> alter database close; or

sql> shutdown immediate;

sql> startup mount;

this will take you to mount state, now you are ready to go offline or cold backup:

$ rman target /

rman> backup database;

exit

--Hot backup:

Full Datafiles backup:

$ rman target /
      or
$ rman target user/password

rman> backup database;

rman> exit;

Full Datafiles backup plus archivelog:

$rman target /

rman> backup database plus archivelog;

rman> exit;

Dropping ASM Disk Group in detail (Step by Step)

--check following parameter before dropping ASM DG:

Before dropping the ASM DiskGroup please check the below parameter as any one of them is pointing to the Disk group which you are going drop, if there are some parameter found point to that DG, we have to set new location for it.

Sqlplus / as sysdba

--Checking Oracle OMF Location

SQL> show parameter create

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
create_bitmap_area_size              integer     8388608
create_stored_outlines               string
db_create_file_dest                  string      +FRA_TESTDB/TESTDB
db_create_online_log_dest_1          string
db_create_online_log_dest_2          string
db_create_online_log_dest_3          string
db_create_online_log_dest_4          string
db_create_online_log_dest_5          string

we have to update the old DG name with new DG as:

alter system set db_create_file_dest='+FRA_TESTDB_01/TESTDB' scope=both;

SQL> show parameter create

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
create_bitmap_area_size              integer     8388608
create_stored_outlines               string
db_create_file_dest                  string      +FRA_TESTDB_01/TESTDB
db_create_online_log_dest_1          string
db_create_online_log_dest_2          string
db_create_online_log_dest_3          string
db_create_online_log_dest_4          string
db_create_online_log_dest_5          string

-- Now check the postion of Flash recovery Area

SQL> show parameter recovery

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      +FRA_TESTDB
db_recovery_file_dest_size           big integer 8016M
recovery_parallelism                 integer     0
remote_recovery_file_dest            string

This location should also be changed to new DG as:

alter system set db_recovery_file_dest='+FRA_TESTDB_01' scope=both;

Similarly check Controlfiles,log_archive_destination if you have set, change it to new disk group.

For controlfile movement (follow the blog moving data accross the disk groups)

-- Checking all the datafiles, there shouldn't exists any datafile on this DG:


select name from v$controlfile
union
select name from v$datafile
union
select name from v$tempfile
union
select member from v$logfile
union
select filename from v$block_change_tracking
union
select name from v$flashback_database_logfile;


-- Delete a directory and all its contents.

ALTER DISKGROUP disk_group_1 DROP DIRECTORY '+FRA_TESTDB/backup' FORCE;

When its all clear that there is no DB parameter pointing to the DG going to be dropped and no live data is there we can drop that disk group.

-- To check dependancy & Remove Dependacny


#./srvctl config database -d DBTESTQ

SQL> drop diskgroup PLAY force including contents;

Or we can do it by Srv utility

Stopping the FRA resources

[root@testdb bin]# ./srvctl stop diskgroup -g FRA

Dropping the Disk

[root@testdb bin]# ./srvctl remove diskgroup -g FRA

Checking the Status

[root@testdb bin]# ./srvctl config database -d testdb
Database unique name: testdb
Database name: testdb
Oracle home: /u01/app/oracle/product/11.2.0
Oracle user: grid
Spfile: +DATA/testdb/spfiletestdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DATA,ARCH
Services:
[root@testdb bin]# 

Installing Oracle 11g on Linux

Unpack Files Unzip the files. # 11.2.0.1 unzip linux.x64_11gR2_database_1of2.zip unzip linux.x64_11gR2_database_2of2.zip #11.2.0.2 u...