Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> ALTER DATABASE RENAME FILE errors when executed from inside a shell script

ALTER DATABASE RENAME FILE errors when executed from inside a shell script

From: Subrahmanyam Arya <avsrk_at_mailcity.com>
Date: 15 Aug 2003 09:05:40 -0700
Message-ID: <25c1993e.0308150805.104aeb99@posting.google.com>


Dear oracle gurus,

Bang me question might be silly and simple. I am trying to relocate the datafiles from location to other and i am trying to do this from inside a shell script named rename-datafiles.sh. i paste below this simple script

#!/bin/ksh

ORACLE_SID=plxdb3
export ORACLE_SID

ORACLE_HOME=/opt/PlexView/Oracle/ora01/app/oracle/product/8.1.7 export ORACLE_HOME

export ECHO='/usr/ucb/echo'

usage () {

    /usr/ucb/echo "

        Wrong number of parameters

        Usage: $0 <[SYSTEM][TOOLS][RBS][TEMP][USERS][INDX][TEST]> <OldDataFileNameAndPath> <NewDataFileNameAndPath>

    /usr/ucb/echo ""
    return 1
}

#######
# (0.0) Check args.
#

if [ $# -ne 3 ]
then

    usage || return 1
fi

/opt/PlexView/Oracle/ora01/app/oracle/product/8.1.7/bin/svrmgrl << EOSQL
   connect internal
   startup mount plxdb3;
   alter database rename file $2 TO $3;
   alter database open;

   exit
EOSQL I get the following error and dont have any clue about the message. This is the way i executed the script

./rename-datafiles.sh TEST
'/opt/PlexView/Oracle/ora03/oradata/plxdb3/test01.dbf'
'/opt/PlexView/Oracle/ora02/oradata/plxdb3/test01.dbf'
Relocating datafiles for TEST tablespace

Oracle Server Manager Release 3.1.7.0.0 - Production

Message 4505 not found; No message file for product=SVRMGR, facility=MGR

Error while trying to retrieve text for error ORA-12545 SVRMGR> Message 701 not found; No message file for product=SVRMGR, facility=MGR
Message 701 not found; No message file for product=SVRMGR, facility=MGR
Error while trying to retrieve text for error ORA-12545 SVRMGR> MGR-00310: Message 310 not found; No message file for product=SVRMGR, facility=MGR
SVRMGR> alter database rename file
'/opt/PlexView/Oracle/ora03/oradata/plxdb3/test01.dbf' TO '/opt/PlexView/Oracle/ora02/oradata/plxdb3/test01.dbf' *
Error while trying to retrieve text for error ORA-03114 SVRMGR> alter database open
*
Error while trying to retrieve text for error ORA-03114 SVRMGR> SVRMGR> Message 37 not found; No message file for product=SVRMGR, facility=MGR

How to overcme this error and how exactly to pass the command line args from shell script to an SQL script or to the SQL commands inside th script ???

-thx,
avsrk Received on Fri Aug 15 2003 - 11:05:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US