Received: (qmail 23025 invoked from network); 12 Dec 2011 10:49:56 -0600
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by static-ip-85-25-126-90.inaddr.ip-pool.com with SMTP; 12 Dec 2011 10:49:47 -0600
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 1C331E68B20;
 Mon, 12 Dec 2011 11:49:24 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org;
 s=turing; t=1323708564; bh=A+KH8FmpkNOhgl8bb02AjJWZAqqRXLW8TfkehPRr
 DRw=; h=From:To:CC:Date:Subject:Message-ID:References:In-Reply-To:
	 Content-type:Content-Transfer-Encoding:MIME-Version:Sender:
	 Reply-To:List-help:List-unsubscribe:List-Id:List-subscribe:
	 List-owner:List-post:List-archive; b=m/kj1nx90JSyN43RUgALvLqJlM/PN
 NRPQfjpI3ubgT15GFLO1cZ8qplTlAojFZFD6/xMnoMmzrMHGUlNweQBKUZJSng3Lt0x
 Gvzg2yMKd5hBPlisMOpJ3FaJ+OYyM0L6FjvRIda1VomBq4IxNEiZSY6Rp8VGIXBBxqB
 mIPFN6EY=
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 7yeAIffd5noq; Mon, 12 Dec 2011 11:49:23 -0500 (EST)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 6D5DEE68AC4;
 Mon, 12 Dec 2011 11:48:41 -0500 (EST)
Received: with ECARTIS (v1.0.0; list oracle-l); Mon, 12 Dec 2011 11:47:58 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 96B8EE68AA1
 for <oracle-l@freelists.org>; Mon, 12 Dec 2011 11:47:58 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id kvHfI1CBzPCG for <oracle-l@freelists.org>;
 Mon, 12 Dec 2011 11:47:58 -0500 (EST)
Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe006.messaging.microsoft.com [216.32.181.186])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 4312DE676FF
 for <oracle-l@freelists.org>; Mon, 12 Dec 2011 11:47:57 -0500 (EST)
Received: from mail188-ch1-R.bigfish.com (10.43.68.243) by
 CH1EHSOBE004.bigfish.com (10.43.70.54) with Microsoft SMTP Server id
 14.1.225.23; Mon, 12 Dec 2011 16:47:54 +0000
Received: from mail188-ch1 (localhost [127.0.0.1])	by
 mail188-ch1-R.bigfish.com (Postfix) with ESMTP id B97201003D1;	Mon, 12 Dec
 2011 16:47:54 +0000 (UTC)
X-SpamScore: -50
X-BigFish: VPS-50(zb3fPzbb2dI9371I2de7MfcbW542M1432N98dK14ffOzz1202hz31iz8275bh8275dhz2dh2a8h668h839h944ha12h)
X-Forefront-Antispam-Report: CIP:12.23.250.36;KIP:(null);UIP:(null);IPV:NLI;H:SPOBMEXC06.adprod.directory;RD:none;EFVD:NLI
X-FB-SS: 13,
Received: from mail188-ch1 (localhost.localdomain [127.0.0.1]) by mail188-ch1
 (MessageSwitch) id 1323708474580021_22863; Mon, 12 Dec 2011 16:47:54 +0000
 (UTC)
Received: from CH1EHSMHS030.bigfish.com (snatpool1.int.messaging.microsoft.com
 [10.43.68.254])	by mail188-ch1.bigfish.com (Postfix) with ESMTP id
 7EF2F6C0047;	Mon, 12 Dec 2011 16:47:54 +0000 (UTC)
Received: from SPOBMEXC06.adprod.directory (12.23.250.36) by
 CH1EHSMHS030.bigfish.com (10.43.70.30) with Microsoft SMTP Server (TLS) id
 14.1.225.23; Mon, 12 Dec 2011 16:47:51 +0000
From: "Taylor, Chris David" <ChrisDavid.Taylor@ingrambarge.com>
To: "'sundarmahadevan82@gmail.com'" <sundarmahadevan82@gmail.com>, 'De DBA'
 <dedba@tpg.com.au>
CC: "'oracle-l@freelists.org'" <oracle-l@freelists.org>
Date: Mon, 12 Dec 2011 10:47:49 -0600
Subject: RE: Automate rman login with shell script
Thread-Topic: Automate rman login with shell script
Message-ID: <C5533BD628A9524496D63801704AE56D6A34135844@SPOBMEXC14.adprod.directory>
References: <CADmQEr7Fixwd4A8MSiVV5MVSg7DizD9ZLHRwd1WfW6SiSc9kzg@mail.gmail.com>
 <20111210125114.GA8239@app01.bos>	<4EE57140.70805@tpg.com.au>
 <CADmQEr7td30-WBfhXprXEJW1+CZd30dXAkn_Op7XtaB3r8=+zQ@mail.gmail.com>
In-Reply-To: <CADmQEr7td30-WBfhXprXEJW1+CZd30dXAkn_Op7XtaB3r8=+zQ@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US
Content-type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
X-OriginatorOrg: ingrambarge.com
X-archive-position: 40593
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: ChrisDavid.Taylor@ingrambarge.com
Precedence: normal
Reply-To: ChrisDavid.Taylor@ingrambarge.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l

I may be mistaken (probably am) but doesn't the password HAVE to go on the next line below the "<< EOF"

$ORACLE_HOME/bin/rman target sys@cricprod_prim <<EOF
syspassword
show all; 
EOF

That's the way I always wrote them, otherwise how does it know where the password ends?  (Notice there is no space, after syspassword)


Chris Taylor
Sr. Oracle DBA
Ingram Barge Company
Nashville, TN 37205

"Quality is never an accident; it is always the result of intelligent effort."
-- John Ruskin (English Writer 1819-1900)

CONFIDENTIALITY NOTICE: This e-mail and any attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender immediately and delete the contents of this message without disclosing the contents to anyone, using them for any purpose, or storing or copying the information on any medium.


-----Original Message-----
From: oracle-l-bounce@freelists.org [mailto:oracle-l-bounce@freelists.org] On Behalf Of sundar mahadevan
Sent: Monday, December 12, 2011 10:43 AM
To: De DBA
Cc: oracle-l@freelists.org
Subject: Re: Automate rman login with shell script

Hi All,
thanks for your  replies. i still cant get it to work. My script and output has been attached below. I tried the same with bash shell as well and i get the same error.
cat test.sh
#!/bin/ksh

. /u01/app/oracle/.profile1
cmd="
$ORACLE_HOME/bin/rman target sys@cricprod_prim <<EOF syspassword show all; EOF "
echo "$cmd"
eval "$cmd"

----------------------------------------------------------------

./test.sh
/u01/app/oracle/product/11.2.0/ee_db1/bin/rman target sys@cricprod_prim<<EOF syspassword show all; EOF


Recovery Manager: Release 11.2.0.2.0 - Production on Mon Dec 12 11:38:17
2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

target database Password:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04005: error from target database:
ORA-01017: invalid username/password; logon denied



On Sun, Dec 11, 2011 at 10:13 PM, De DBA <dedba@tpg.com.au> wrote:

> Test confirms Martijn's hunch. It's the \n at the end of each line - 
> it's not interpreted but incorporated in the string:
>
> $ cmd="rman target sys@home1 <<EOF
> pwd
> EOF
> "
>
> $ eval "$cmd"
>
> Recovery Manager: Release 11.2.0.1.0 - Production on Mon Dec 12 
> 13:02:15
> 2011
>
> Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights 
> reserved.
>
> target database Password:
> connected to target database: HOME1 (DBID=999999999)
>
> RMAN>
>
> Recovery Manager complete.
>
> $ cmd="rman target sys@home1 <<EOF
> pwd\n
> EOF
> "
>
> $ eval "$cmd"
>
> Recovery Manager: Release 11.2.0.1.0 - Production on Mon Dec 12 
> 13:02:24
> 2011
>
> Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights 
> reserved.
>
> target database Password:
> RMAN-00571: 
> ==============================**=============================
> RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS 
> ===============
> RMAN-00571: 
> ==============================**=============================
> RMAN-00554: initialization of internal recovery manager package failed
> RMAN-04005: error from target database:
> ORA-01017: invalid username/password; logon denied
>
> $
>
>
> Cheers,
> Tony
>
>
> On 10/12/11 22:51, Martijn Bos wrote:
>
>> Is this all of your script?
>> I'm missing something like the following at one of the first lines:
>> #!/bin/bash
>>
>> Also it's my experience that you do not need the \n's after every line.
>> And the EOF" should read EOF I guess.
>>
>> Can you please include some more (the whole) of the script you are 
>> editing?
>> And maybe some results or the errors.
>>
>> Oh...and rman changed a little over versions so maybe you should 
>> include some details concerning OS and oracle versions.
>>
>> Best Regards,
>> Martijn Bos
>>
>> On Fri, Dec 09, 2011 at 03:38:09PM -0500, sundar mahadevan wrote:
>>
>>> Hi All,
>>> I have done the following similar with sqlplus -s but cant get this 
>>> for rman. Not sure what i am doing wrong. i tried it with "echo -e" 
>>> as well but cant get it to work. Has anyone got this to work? Thanks 
>>> in advance.
>>> cmd="rman target 
>>> sys@cricprod_prim.**theglobeandmail.com<sys@cricprod_prim.theglobean
>>> dmail.com>auxiliary
>>> sys@cricprod_logstdby.**theglobeandmail.com@/u01/app/**
>>> oracle/sm/build_cricprodls.rcv
>>> <<EOF\n
>>> PasswordOfPrim\n
>>> PasswordOfLogstdby\n
>>> EOF"
>>>
>>> eval "$cmd"
>>>
>>>
>>> --
>>> http://www.freelists.org/**webpage/oracle-l<http://www.freelists.org
>>> /webpage/oracle-l>
>>>
>>>
>>>
>> --
>> http://www.freelists.org/**webpage/oracle-l<http://www.freelists.org/
>> webpage/oracle-l>
>>
>>
>>
>>
>>
>


--
http://www.freelists.org/webpage/oracle-l




--
http://www.freelists.org/webpage/oracle-l


