How to recover or delete corrupted blocks

For corrupted blocks, we can use block media recovery to recover corrupt datablocks with remain the datafile online. If we don’t have backup available, we can recreate the table by skip the corrupted blocks.
Here are steps for block media recover.
Step1. Find out the bad blocks file# and block#
SQL> select * from V$DATABASE_BLOCK_CORRUPTION;
will show all recorded [...]

How to install oracle9i on Linux(RHEL AS 3)

Here I show a simplified steps for installation oracle9i in Linux (Red Hat Enterprise Linux Advanced Server 3)
–set system environment
su – root
echo `expr 512 \* 1024 \* 1024` > /proc/sys/kernel/shmmax
groupadd dba
useradd -c “Oracle software owner” -g dba oracle
passwd oracle
oracle (input twice)
mkdir -p /opt/oracle/product/9.2.0
chown -R oracle.dba /opt/oracle
mkdir -p /var/opt/oracle
chown oracle.dba /var/opt/oracle
chmod 755 /var/opt/oracle
add content below to [...]

How to use standby backup to restore primary db

–Propose: Backup db from physical standby db by using RMAN, recove datafile of primary standby db.
–enviroment:
Three machines:
Machine A: 172.16.100.29 Linux ES3
Machine B: 172.16.100.21 Linux ES3
Machine C: 172.16.100.31 Linux ES3
–step1. build Machine A as primary db and Machine B as standby db
–create another db on Machine C
Machine DB_TNSNAME
A STD1.29
B STD1.21
C STD1.31
–step2. create recovery [...]

How to install oracle10gr2 on Linux

Here are our installation environment and steps:
Hardware:
  CPU: 1Unit Intel(R) Pentium(R) 4 CPU 2.80GHz
  Memory: 2G recommend, 1G at least
  Disk: two disks recommend, total volume 150G – 200G
  Oracle installation path: /opt/oracle10g
Sofeware:
  OS: Red Hat Enterprise Linux ES release 3 (Taroon Update 5)
  Linux 2.4.21-32.ELsmp (kernal version)
  Oracle: Oracle Database 10g Release 10.2.0.1.0 – Production
Step1. Download oracle package
Download Oracle10.2.0.1 for Linux [...]

How to build physical standby db in 10gr2

–Here are the test enviroment and steps:
– Two machine:
– Machine A: 172.16.100.29 primiary db, Red Hat Enterprise Linux ES release 3 (Taroon Update 5)
– Machine B: 172.16.100.21 standby db, Red Hat Enterprise Linux ES release 3 (Taroon Update 5)
–1.install primiary db on machine A oracle_sid=std1
 
–2.Machine A:
SQL> conn / as sysdba
Connected to an idle instance.
SQL> [...]

how to build logical standby db

–Here are the enviroment and steps:
– Two machine:
– Machine A: 172.16.100.21 RedHat ES3 primiary db, oracle9.2
– Machine B: 172.16.100.29 RedHat ES3 standby db, oracle9.2
Note: These only apply to oracle9i. In oracle10g, it will need to build a physical standby database and then convert it to a logical standby database.
–1.install primiary db on machine A [...]

How to use “/ as sysdba” to exp and imp

Sometimes we need to user “/ as sysdba” to do export and import in command line of operating systems. There is a little trick.
1. OS:Window 2000 Server
DB:Oracle9.2.0.1
exp userid=”””/ as sysdba””” tables=(t.t) file=t.dmp
imp userid=”””/ as sysdba””” file=t.dmp fromuser=t touser=system
Here three double quotation marks are used.
2.OS:SunOS 5.9
DB:Oracle9.2.0.5
exp userid=\’/ as sysdba\’ tables=(query_user.aaa) file=t.dmp rows=n
imp userid=\’/ as sysdba\’ fromuser=query_user [...]