Tuesday 22 October 2013

How to configure OS for RAC :



Hardware requirment:

1.server
2.shared disk -das-san-nas
3.nodes-mininum-2
                nic -2
                microprocessor -pentium 4 or higher
                ram -2gb or higher


SOFTWARE REQUIRMENT.

1.OS -RHEL -5.4 ONWARDS
2.CLUSTERWARE SOFTWARE ORACLE 11G
3.DATABASE SOFTWARE ORACLE11G
4.REQUIRED -OCFS MODULES-ONLY FOR CLUSTERFILES
                          -ASM PACKAGES-TO STORE DATAFILES
                                                            OR CLUSTERWARE FILES


CONSIDERATION DURING OS INSTALLATION
1.NODE NAME
2.IP ADRESS CONFIGURATION
3.SELECT  "NO FIREWALL"
4.DISABLE "SECURITY LINUX"

CUSTOM PACKAGE SELECTION

1.ENABLED
2.GNOME DESKTOP ENVIRONMENT
3.EDITORS
4.GRAPHICAL INTERNET
5.TEXT BASED INTERNET
6.DEVELOPMENT LIBRARIES
7.DEVELOPMENT TOOLS
8.SERVER CONFIGURATION TOOOLS
9.ADMINISTRATION TOOLS
10.BASE
11.SYSTEM TOOLS
12.XWINDOWS SYSTEM

after sussesfull os installation install the individual software --it will be in the dvd-server folders
1# rpm -ivh libaio -devel-0.3.106-3.2.i386.rpm
2#rpm -ivh sysstat -7.0.2-3.els.i386.rpm
3#rpm -ivh unixodbc -2.2.11-7.1.i386.rpm
4#rpm -ivh unixodbc -devel-2.2.11-7.1.i386.rpm
5#rpm -ivh iscsi-initator-utils-6.2.0.871-0-10.els.i386.rpm


NOW INSTALLATION STARTS

#neat -gui tool
etho  inactive ,eth01 inactive

select edit -enter ip address subnet mask

after providing ip address and subnet mask
verifying
#service network restart
verify ip
#ifconfig
verify hostname
#hostname
configuring /etc/hosts file
#vim /etc/hosts
add the etho and eth1 ip adress for both the nodes
verify from node1
#ping node1
#ping node priv
verify from node 2
#ping node2
#ping node2 priv

configuring kernel parameters
#vim /etc/sysctl.conf

kernel.shmmax = 4294967275
kernel.sem =250 32000 100 128
net .core .rmem_default =262144
net . core .rmem_max =4194304
net .core .wmem_default =262144
net.core.wmem_max=1048586
net.ipv4.ip-local_port_range=9000 65500
fs.file-max =6815744
kernel . hostname =node1 name
kernel . domainname =yis.co.in(name for example)

verify the kernel parameters
#sysctl -p
#hostname
#domain name



configuring services

#/etc/rc.d/init.d/iptables status
#chkconfig sendmail off
#chkcondig cups off
#chkconfig xinetd on
#chkconfig telnet on
#chkconfig vsftpd on
#service xinetd restart
#service vsftpd restart

creating oracle user

*creating a group
#groupadd -g 800 dba

*creating  a oracle user
#useradd -u 555 -g 800 -md  /yis/yashu
#passwd yashu

*creating a directory
#mkdir /yis/cluster
#chown -R yashu:dba /yis/cluster

*configuring shell limits
#vim /etc/security/limits.conf

yashu  soft  nproc  2047

yashu  hard  nproc  16384

yashu  soft  nofile  1024

yashu  hard   nofile   65536

configuring date & time

node 1 time should be more than 20 sec for node 2

configuring hang check -timer
hang check timer

 *to find the package
#find /lib/modules  -name "hangcheck-timer.ko"
#vim /etc/modprobe.conf
options hangcheck-timer  hangcheck-tick=30 hangcheck-margin=180

#vim /etc/rc.local
/sbin/modprobe hangcheck-timer

*updating modprobe.conf file
#modprobe  hangcheck-timer

*to verify
#grep Hangcheck /var/log/messages/tail.2

*configuring remote shell
rsh
#rpm -qa rsh*
#chkconfig rsh on
#chkconfig rlogin on
#service xinetd restart

workaround
#which rsh
/usr/kerheros/bin/rsh

#mv /usr/kerheros/bin/rsh  /usr/kerheros/bin/rsh.original

#mv /usr/kerherous/bin/rcp /usr/kerherous/bin/rcp.original

#mv /usr/kerherous/bin/rlogin  /usr/kerherous/bin/rlogin.original

#which rsh
/usr/bin/rsh

configuring user equipvalency
#vim /etc/hosts.equiv
 + node1  yashu
 + node1priv  yashu

 + node2   yashu
 + node2priv yashu

#chmod 600 /etc/hosts.equiv

*testing the configuration(not in terminal mode  login as oracle user from node1)
$rsh node2 ls-l /yis/cluster
$rsh node2 touch manju

*configuring shared storage device ocfs2 in root user  from node
*download ocfs2 packages(with respective  os version)
*install ocfs2 packages
*ensure selinux is disabled

to verify:
#/usr/bin/system-config-securitylevel &
#ocfs2 console &    ------its a gui

cluster->clusternodes->add->information of node1 & node2
name-
address-
portno-7777 default
apply -quit in file

verify
#cat /etc/ocfs2/cluster.conf
it should show at last -node -count:2

configuring o2cb service
 step1...reconfigure o2cb
#chkconfig --del o2cb
#chkconfig --add o2cb
#chkconfig --list o2cb

step2…
unload o2cb modules
#/etc/init.d/o2cb  offline  ocfs2
#/etc/init.d/o2cb  unload
#/etc/init.d/o2cb status

step3…..
configuring  o2cb on boot

#/etc/init.d/o2cb configure
load o2cb driver on boot :y
cluster to start on boot :ocfs2
specify heartbeat dead threshold :600

step4…..
configuring ocfs2 file system
#fdisk -l

formatting /dev/sdb1 with ocfs2 filesystem
*gui -using ocfs2 console
*cli-using mkfs command

**in formatting and mounting do from one node1
#mkfs.ocfs2 -b 4k -c 32k -N 4 -l "oradatafiles"/dev/sdb1  …..in cli mode

****in gui mode

using ocfs2 console &->tasks->edit->ok

mounting ocfs2 file system:

from one mode only:

#mount -t ocfs2 -o datavolume,nointr/dev/sdb1  /yis/cluster

verify
#df -h

will show…>/dev/sdb1……./yis/cluster

to make permanent mounting:

#vim /etc/fsstab
LABEL=oradatafiles /yis/cluster ocfs2 _netdev,datavolume,nointr 0 0

reboot
#init 6

to verify
#df -h

changing ownership:


#chown -R yashu:dba /yis/cluster
#chmod -R 775  /yis/cluster

reboot all the nodes:

cosideration;

*server should be on
*start node1
*start node 2

configuring shared storage device ASM

*DOWNLOAD ASM packages with respective os version
*install asm packages (wrt rhel 5.4)
 oracle asm-support -2.7.3-1
 oracle asm -2.6.18-164
oracle asmlib -2.0.4-1


/etc/init.d/oracleasm………>>>>>this file will be created

CREATING ASM DISK: NODE1

*done from only one node
#/etc/init.d/oracleasm  create disk VOL1 /dev/sdc1

CONFIGURING ASM DISK

*done from only one mode ……>node1
#/etc/init.d/oracleasm configure
default user to own the driver interface :yashu
default group to own the driver interface :dba

start oracleasm library driver on boot:y
fix permissions of oracle ams disks on boot:y

SCAN ASM DISKS
#/etc/init.d/oracleasm  scandisks

LISTING ASM DISKS

#/etc/init.d/oracleasm  list disks
will show vol1&vol2

OUERY ASM DISKS

#/etc/init.d/oracleasm  querydisk  /dev/sdc1
                        OR
#/etc/init.d/oracleasm  querydisk  VOL1………>SUGGESTED BY ORACLE


CREATING ASM DISK IN NODE2.


*DONT PERFORM 1 &2 STEPS FROM NODE1
*PERFORM STEP 3 TO STEP 5
*SCAN DISKS,LISTDISKS,QUERY DISK…….PERFORM  SUGGESTED QUERY.


How to take TKPROF for the sql query in oracle:


 
Open sqlplus session with database, login to db user.

 1. Select distinct sid from v$mystat.

 2. alter session set tracefile_identifier = 'Module_name';

 3. ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT FOREVER, LEVEL 12';

 4. Execute the procedure or sql.

 5.  ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT OFF';

 6. Disconnect from session and  repeat above steps for other modules/sql's.

 Then to check the TRACE FILES use this query

SQL> select value from v$parameter where name = 'user_dump_dest';

logout sqlplus

in os prompt cd /tracefile destination "output of  "select value from v$parameter where name = 'user_dump_dest'; "


then in trace file check the module_name which was given in 2nd step.

in os prompt
typo

1. tkprof  orcl_ora_10589_BHU.trc translated.txt

 2.cat translated.txt

 or
1.tkprof orcl_ora_27714_SOM.trc orcl_ora_27714_SOM.trf

2 cat orcl_ora_27714_SOM.trf

 This output we can check in terminal itself no need todo scp or bbedit.



 

RMAN Point-In-Time Recovery Example



There are many ways to restore a database using an RMAN backup - this example assumes you are running RMAN without a Catalog and are performing a Restore & Point-In-Time Recovery of all data back to a particular date/time in the past.

If you are running in Archive log mode and recover without specifying a date/time then RMAN will apply all Archived logs it can find, ofter recovering the database right back to the time when you started the restore operation!

If you are running in Archive log mode (and you should be), point-in time is probably the most common recovery scenario.
You will need the following information:

Database SID: ________
Database SYS password: ________
The Date and Time to restore to : ________

There are 5 steps to recover the database:

1) Restore backup files from tape

2) Mount the instance
3) Restore the datafiles

4) Recover the database

5) Reset the logs

Restore backup files from tape

If you are looking to restore the database to a time of (say 09:00) you will need the most recent RMAN backup files prior to the date (say 23:00 from the previous day) plus all the archive logs from the backup time until the restore time, in this case from 23:00 until 09:00.
If any of these files have been moved (e.g. archived to tape) restore them to the default locations on the oracle database server.

Set the environment variable NLS_LANG for your character set - 
NLS_LANG=American_America.WE8ISO8859P1

Mount the instance
C:\> Set ORACLE_SID=Live
C:\> rman TARGET SYS/Password NOCATALOG

RMAN:> shutdown immediate;

RMAN:> startup mount;

Restore and recover the datafiles

RMAN> run
{
allocate channel dev1 type disk;
set until time "to_date('2011-12-30:00:00:00', 'yyyy-mm-dd:hh24:mi:ss')";

restore database;

recover database; }

For a large database it can take a long time to restore each tablespace - for better performance during a restore place the RMAN backup files on a separate disk to the Oracle datafiles to reduce disk contention.

Open the database and reset logs
RMAN> alter database open resetlogs;

This will update all current datafiles and online redo logs and all subsequent archived redo logs with a new RESETLOGS SCN and time stamp.

As soon as you have done a resetlogs run a full backup, this is important as should you suffer a second failure you will not be able to perform a second recovery because after resetting the logs the SCN numbers will no longer match any older backup files.


Archivelog List Commands and Archivelog Delete Commands

Archivelog List Commands

RMAN>list archivelog all;

RMAN>list copy of archivelog until time ‘SYSDATE-10′;

RMAN>list copy of archivelog from time ‘SYSDATE-10′;

RMAN>list copy of archivelog from time ‘SYSDATE-10′ until time ‘SYSDATE-2′;

RMAN>list copy of archivelog from sequence 1000;

RMAN>list copy of archivelog until sequence 1500;

RMAN>list copy of archivelog from sequence 1000 until sequence 1500;

Archivelog Delete Commands

RMAN>delete archivelog all;

RMAN>delete archivelog until time ‘SYSDATE-10′;

RMAN>delete archivelog from time ‘SYSDATE-10′
;
RMAN>delete archivelog from time ‘SYSDATE-10′ until time ‘SYSDATE-2′;

RMAN>delete archivelog from sequence 1000;

RMAN>delete archivelog until sequence 1500;

RMAN>delete archivelog from sequence 1000 until sequence 1500;

Note : Also, you can use noprompt statement for do not yes-no question.
RMAN>delete noprompt archivelog until time ‘SYSDATE-10′;

Useful info on oracle



1.Format to backup in other location

RMAN> run
2> {
3> allocate channel d1 type disk;
4> backup full tag full_online_bkup
5> format '/home/backup/db_t%t_s%s_p%p'
6> database plus archivelog;
7> release channel d1;
8> }


>   run {
2>   set until time =’ sysdate  –  1’;


RMAN> duplicate database to ‘testdb’ backup location ‘/u03/backup’;

2.Stop the rac database

kasarla01[kittu1]_oracle> srvctl stop database -d kittu
kasarla01[kittu1]_oracle> srvctl status database -d kittu
Instance kittu1 is not running on node kasarla01
Instance kittu2 is not running on node kasarla02
kasarla01[kittu1]_oracle>



3.Restore missing archives using below command
run
{
set archivelog destination to '/backup/oracle/kittu/oracle/kittu1/arch';
ALLOCATE CHANNEL CH1 DEVICE TYPE SBT;
ALLOCATE CHANNEL CH2 DEVICE TYPE SBT;
ALLOCATE CHANNEL CH3 DEVICE TYPE SBT;
ALLOCATE CHANNEL CH4 DEVICE TYPE DISK;
ALLOCATE CHANNEL CH5 DEVICE TYPE DISK;
ALLOCATE CHANNEL CH6 DEVICE TYPE DISK;
RESTORE ARCHIVELOG FROM SEQUENCE 36377 UNTIL SEQUENCE 36382 thread=1;
}

4.Delete archivelog

BACKUP ARCHIVELOG UNTIL TIME 'SYSDATE-7';
DELETE COPY OF ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-14';


RMAN> backup archivelog all delete input;



RUN {
SET ARCHIVELOG DESTINATION to '/oracle/PRD/saparch';
RESTORE ARCHIVELOG FROM SEQUENCE 52939 UNTIL SEQUENCE 53333;
}

OR
RESTORE DATABASE UNTIL TIME "TO_DATE('2011-09-06:15:00:00','YYYY-MM-DD:HH24:MI:SS')";
RECOVER DATABASE UNTIL TIME "TO_DATE('2011-09-06:12:00:00','YYYY-MM-DD:HH24:MI:SS')";

OR
RUN
{
SET ARCHIVELOG DESTINATION TO '/oracle/PRD/saparch';
RESTORE ARCHIVELOG



5.To install oracle developer days


http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html



SQL> select distinct fhscn scn from x$kcvfh;

SCN
----------------
1050262485

SQL>  select current_scn from v$database;

CURRENT_SCN
-----------
 1050288354

SQL>

6.Important links:

http://www.nettech.in/course/Basic%20Commands.pdf
http://www.it.iitb.ac.in/~srihari_kalgi/workshop.pdf
http://marketo.confio.com/rs/confio/images/SQLServer_12%20Steps_Infographic.pdf --Performance tuning related
http://www.thesitewizard.com/general/set-cron-job.shtml ---cronjobs
To check all the ora-errors issue:
www.dbametrix.net 
Important for sql /dba techniques
http://www.rocket99.com/techref/oracle8429.html

7.On cron jobs scheduling:

vi fullbackup.sh
chmod +x fullbackup.sh
crontab -e

 
 [oracle@adcp ~]$ crontab -l
10 10 * * * /fullbackup/fullbackup.sh
10 9 * * * /fullbackup/fulldeletion.sh
10 9 * * * /fullbackup/archivelogdeletion.sh
[oracle@adcp ~]$ crontab -e
crontab: installing new crontab
[oracle@adcp ~]$ cd /fullbackup/
[oracle@adcp fullbackup]$ cat fullbackup.sh
######################################################################
################# Logical full DB backup  ############################
#################### Manjunath.savanth ###############################

PATH=$PATH:$HOME/bin

export PATH

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

ORACLE_HOSTNAME=adcp.ads.exilant.in; export ORACLE_HOSTNAME
ORACLE_BASE=/oracle_data/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_2; export ORACLE_HOME
ORACLE_SID=adcp; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH


exp_file_tag=`date +'%b%d%y%H-%M'`

exp manjit/manjit full=y compress=y file=/fullbackup/oracel/full/bkp_$exp_file_tag.dmp log=/fullbackup/oracel/full/bkp_$exp_file_tag.log statistics=none direct=y
[oracle@adcp fullbackup]$ cat fulldeletion.sh
######################################################################
#################  old file deletion  ############################
#################### Manjunath.savanth ###############################

PATH=$PATH:$HOME/bin

export PATH

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

ORACLE_HOSTNAME=adcp.ads.exilant.in; export ORACLE_HOSTNAME
ORACLE_BASE=/oracle_data/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_2; export ORACLE_HOME
ORACLE_SID=adcp; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH


find /fullbackup/oracel/full/ -name '*.dmp*' -mtime +2 -exec rm {} \;
find /fullbackup/oracel/full/ -name '*.log*' -mtime +2 -exec rm {} \;

[oracle@adcp fullbackup]$ cat archivelogdeletion.sh
rchivelog deletion   ############################
#################### Manjunath.savanth ###############################

PATH=$PATH:$HOME/bin

export PATH

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

ORACLE_HOSTNAME=adcp.ads.exilant.in; export ORACLE_HOSTNAME
ORACLE_BASE=/oracle_data/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_2; export ORACLE_HOME
ORACLE_SID=adcp; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH


cd $oracle_home/bin
./rman target sys/sys no catalog<<EOF
run {
allocate channel for device type disk;
change archive log untill time 'SYSDATE-2'delete;
yes
)

[oracle@adcp fullbackup]$ 


Rman backup schedule:

cat backup.sh
PATH=$PATH:$HOME/bin
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=LAXTES
X11LIB=/usr/X11R6/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/lib:/usr/lib
PATH=$ORACLE_HOME/bin:$PATH:/usr/X11R6/bin
TNS_ADMIN=$ORACLE_HOME/network/admin


export PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SID
export LD_LIBRARY_PATH
export X11LIB
export TNS_ADMIN
JRE_HOME="/home/oracle/Desktop/jre1.6.0_02"
export JRE_HOME

cd $ORACLE_HOME/bin
./rman target sys/sys  nocatalog<<EOF
run
{
backup device type disk tag 'full_database'
format='/home/oracle/rman_backup/LAXTES_%d_%T_%s.bak' database plus archivelog;
backup device type disk archivelog all not backed up;
delete noprompt obsolete device type disk;
}
exit;
EOF

sqlplus "/ as sysdba"<<EOF
alter database backup controlfile to '/home/oracle/rman_backup/control01.ctl';
exit;
EOF


Using datapump backup schedule:
cat pump.sh
#!/bin/bash

clear
######################################################################
############ Logical full DB backup  #########
#####################Manjunath.Savanth#####################################

PATH=$PATH:$HOME/bin

ORACLE_HOME=/home/oracle/oracle/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_OWNER=oracle; export ORACLE_OWNER
ORACLE_SID=test; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH

exp_file_tag=`date +'%b%d%y%H-%M'`

expdp manjit/manjit directory=manju_dir full=y dumpfile=bkp_$exp_file_tag.dmp logfile=bkp_$exp_file_tag.log
[oracle@localhost ~]$ 

SQL...

sql>select file_name,tablespace_name from dba_data_files;
 sql>select username,default_tablespace from dba_users;

DATAPUMP IMP:
impdp manjit/manjit directory=name dumpfile=name.dmp logfile=name.log remap_schema=sourceschemaname:targetschemaname remap_tablespace=sourcetablespacename:targettablespacename

How to automate installation script for Oracle Database on Linux :



#########———— Installing Rpm files —–########

#Change directory to /tmp/install
cd /tmp/install
#Install all packages that are not installed during OS installation and that are required packages for Oracle Database 10gR2
echo “Installing rpm packages …”

rpm -Uvh “$(find /media/ -name compat-db*)”
rpm -Uvh “$(find /media/ -name sysstat*)”
rpm -Uvh “$(find /media/ -name libaio-devel*)”
rpm -Uvh “$(find /media/ -name libXp-1*)”

echo “Rpm packages installed


#Add lines to limits.conf file
echo “Changing limits.conf file”
cat >> /etc/security/limits.conf <<EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF
echo “limits.conf file changed successfully


#Add lines to profile to give maximum limit for Oracle user
echo “Changing /etc/profile file ….”
cat >> /etc/profile <<EOF
if [ \$USER = "oracle" ]; then
                                                  if [ \$SHELL = "bin/ksh" ]; then
                                                                ulimit -p 16384
                                                                ulimit -n 65536
                                                  else
                                                                ulimit -u 16384 -n 65536
                                                  fi
                                                  umask 022
fi
EOF
echo “/etc/profile file changed successfully


#Add line to /etc/pam.d/login file
echo “Changing /etc/pam.d/login file …”
cat >> /etc/pam.d/login <<EOF
session required /lib/security/pam_limits.so
EOF
echo “/etc/pam.d/login file changed successfuly


#Add some kernel parameters to /etc/sysctl.conf file
echo “Changing kernel parameters … “

cat >> /etc/sysctl.conf <<EOF
kernel.shmmax = 2147483648
kernel.shmall = 2097152
kernel.shmmni=4096
kernel.sem=250 32000 100 128
fs.file-max=65536
net.ipv4.ip_local_port_range=1024 65000
net.core.rmem_default=1048576
net.core.rmem_max=1048576
net.core.wmem_default=262144
net.core.wmem_max=262144
EOF

echo “Kernel parameters changed successfully

#Save all new kernel parameters

/sbin/sysctl -p

#Add “redhat-4″ line to /etc/redhat-release file

echo “Changing /etc/redhat-release file …”
cp /etc/redhat-release /etc/redhat-release.original
echo “redhat-4″ > /etc/redhat-release
echo “/etc/redhat-release file changed successfully


#Create new groups and “oracle” user and add this user to group
echo “Creating new groups and ‘oracle’ user …”
groupadd oinstall
groupadd dba
useradd -m -g oinstall -G dba -d /home/oracle -s /bin/bash -c “Oracle Software Owner” oracle
passwd oracle
echo “Groups and user created successfully

#Adding Environment Variables
#Adding Environment Variables
cat >> /home/oracle/.bashrc <<EOF
export ORACLE_HOME=/home/oracle/oracle/product/10.2.0/db_1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
alias mydb=’export ORACLE_SID=mydb;sqlplus “/ as sysdba”‘
export ORACLE_SID=mydb
EOF
EOF


#Unzip setup of Oracle
echo “Unzipping setup of Oracle 10g Release 2…. “
unzip 10201_database_linux32.zip
echo “Setup file successfully unzipped

#Enter to installation directory and run the installation …
echo “Installation begins …”
cd /tmp/install/database
chmod 755 runInstaller
chmod 755 install/.oui
chmod 755 install/unzip
xhost +
sudo -u oracle /tmp/install/database/runInstaller

Procedure to give read only privileges in oracle

This is script for table :

set serveroutput on
DECLARE
sql_txt VARCHAR2(300);
CURSOR tables_cur IS
SELECT table_name
FROM dba_tables
 where owner='ERECON14'
  and table_name in ('WF_USERTYPE', 'WF_WORKFLOWTESTING') ;
BEGIN
dbms_output.enable(10000000);
FOR tables IN tables_cur LOOP
sql_txt:='GRANT SELECT ON '||tables.table_name|| TO GPS;
execute immediate sql_txt;
END LOOP;
END;
/

OR


SQL> create user b identified by b;

User created.

SQL> grant select any table,create session to b;


FROM SOURCE SCHEMA


GRANT SELECT ON AUDITTRAIL TO GPS

GRANT SELECT ON  TO GPS ;

SQL>  select * from recon14.WF_WORKFLOWTESTING;




SELECT table_name
FROM dba_tables
 where owner='ERECON14'
  and table_name in ('WF_USERTYPE', 'WF_WORKFLOWTESTING')


select * from tab where tname = 'AUDITTRAIL';

List Commands Examples in RMAN:



RMAN> LIST ARCHIVELOG ALL;

RMAN> LIST BACKUP OF ARCHIVELOG ALL;

RMAN> LIST BACKUP;

RMAN> LIST BACKUP OF DATABASE;

RMAN> LIST BACKUP OF DATAFILE 1;

RMAN> LIST BACKUP SUMMARY;

RMAN> LIST INCARNATION;

RMAN> LIST BACKUP BY FILE;

RMAN> LIST COPY OF DATABASE ARCHIVELOG ALL;

RMAN> LIST COPY OF DATAFILE 1, 2, 3;

RMAN> LIST BACKUP OF DATAFILE 11 SUMMARY;

RMAN> LIST expired Backup of archivelog all summary;

RMAN> LIST Backup of tablespace Test summary;

RMAN> LIST BACKUP OF ARCHIVELOG FROM SEQUENCE 1437;

RMAN> LIST CONTROLFILECOPY “/tmp/cntrlfile.copy”;

RMAN> LIST BACKUPSET OF DATAFILE 1;

RMAN> LIST FAILURE;

RMAN> LIST FAILURE 641231 detail;

RMAN> LIST Backup of Controlfile;

RMAN> LIST Backup of Spfile;

RMAN> LIST Backup of Tablespace Test;

RMAN> LIST expired Backup;

RMAN> LIST expired Backup summary;

RMAN> LIST expired Backup of Archivelog all;

RMAN> LIST expired Backup of datafile 10;

RMAN> LIST recoverable backup;