ORACLE_HOME=/oracle/ora10gR2

export ORACLE_HOME

PATH=PATH=/oracle/ora10gR2/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/oracle/bin:/usr/bin/X11:/sbin:.

export PATH

USER=oracle

export USER

NLS_LANG='SIMPLIFIED CHINESE_CHINA.ZHS16GBK'

export NLS_LAN

alias sqlplus='/oracle/ora10gR2/bin/sqlplus'

alias rman='/oracle/ora10gR2/bin/rman'

alias nid='/oracle/ora10gR2/bin/nid

export ORACLE_SID=GISDBSP2

wait

sqlplus / as sysdba << EOF

set echo on

shutdown abort

exit;

EO

more

export ORACLE_SID=GISDBSP

wait

sqlplus / as sysdba << EOF

set echo on

shutdown abort

startup nomount

exit;

EO

rm /redo_1/GISDBSP/*

rm /data_1/GISDBSP/*

rm /redo_1/GISDBSP/*

wai

export ORACLE_SID=GISDBSP

wait

rman target / catalog rman/rman@RCAT << EOF

resync catalog;

exit;

EO

export ORACLE_SID=GISDBSP

rman target / catalog rman/rman@RCAT << EOF

run {

allocate channel ch00 device type 'sbt_tape';

send 'NB_ORA_CLIENT=GISDBSP';

SET UNTIL TIME "to_date('2012/09/03 06:00:00','YYYY/MM/DD HH24:MI:SS')";

restore controlfile;

release channel ch00;

}

exit;

EOF

wai

export ORACLE_SID=GISDBSP

sqlplus / as sysdba << EOF

alter database mount;

exit;

EO

export ORACLE_SID=GISDBSP

rman target / catalog rman/rman@RCAT << EOF

run {

allocate channel ch00 device type 'sbt_tape';

send 'NB_ORA_CLIENT=GISDBSP';

SET UNTIL TIME "to_date('2012/09/03 06:00:00','YYYY/MM/DD HH24:MI:SS')";

restore database;

recover database;

release channel ch00;

}

exit;

EOF

wai

export ORACLE_SID=GISDBSP

sqlplus / as sysdba << EOF

alter database open resetlogs;

exit;

EO

export ORACLE_SID=GISDBSP

sqlplus / as sysdba << EOF

set echo on

shutdown immediate

startup mount

exit;

EOF

wait

echo 'Y' | nid target=/ dbname=GISDBSP2

wai

export ORACLE_SID=GISDBSP2

sqlplus / as sysdba << EOF

set echo on

startup mount

exit;

EO

sqlplus / as sysdba << EOF

alter database open resetlogs;

exit;

EO

wait

sqlplus / as sysdba << EOF

shutdown immediate

startup restrict

exit;

EO

wait

export ORACLE_SID=GISDBSP2

sqlplus / as sysdba << EOF

ALTER USER ebs IDENTIFIED BY "fbixmn#2012";

ALTER USER ywuser2 IDENTIFIED BY "fbixmn#2012";

ALTER USER quote IDENTIFIED BY "fbixmn#2012";

ALTER USER quote3 IDENTIFIED BY "fbixmn#2012";

ALTER USER reserve IDENTIFIED BY "fbixmn#2012";

ALTER USER sales2 IDENTIFIED BY "fbixmn#2012";

ALTER USER query2 IDENTIFIED BY "fbixmn#2012";

ALTER USER jihe IDENTIFIED BY "fbixmn#2012";

exit;

EO

sqlplus / as sysdba << EOF

alter system disable restricted session;

exit;

EO

cd /oracle/p2d/bin

sqlplus -S /nolog @extaction.sql

Tag links generated by Zoundry Raven. Do not manually edit. http://www.zoundryraven.com Technorati : Oracle

Del.icio.us : Oracle

Zooomr : Oracle

Flickr : Oracle