Script that works in 8.1.7 does not work in 9.2.0

I have a generic hot backup script that runs well in our 8i environment where I source the username and password for SYS from a secured txt file. However I could not get the script to work in our recently installed 9.2.0 environment.
Below is an extract of the hot backup script:
# Set environment
. ${HOME}/BACKUP/${DBNAME}.env
CONNECT_STRING=`${HOME}/admin/Util/syspass.sh sys $DBNAME`
export CONNECT_STRING
#Define some commands and files
SQLPLUS="${ORACLE_HOME}/bin/sqlplus -s ${CONNECT_STRING}"
TIME_STAMP=`date +"%d-%b-%Y"`
# Test for duplicate filenames
$SQLPLUS <<-EOF
var numfiles number;
BEGIN
SELECT count(*) into :numfiles
FROM dba_data_files a, dba_data_files b
WHERE a.file_name != b.file_name
AND SUBSTR(a.file_NAME, INSTR(a.file_name, '/', -1) + 1)
= SUBSTR(b.file_NAME, INSTR(b.file_name, '/', -1) + 1);
END;
exit :numfiles
EOF
FILE_ERROR=$?
echo "Number of duplicate files $FILE_ERROR"
if [ $FILE_ERROR -gt 0 ]; then
echo "Aborting, ... $FILE_ERROR duplicate filenames"
exit
fi
As per the extract above,
in our 8.1.7 environment,
(1) the command CONNECT_STRING=`${HOME}/admin/Util/syspass.sh sys $DBNAME`
will result in CONNECT_STRING=sys/xxxxxx@<sid>
(2) the command SQLPLUS="${ORACLE_HOME}/bin/sqlplus -s ${CONNECT_STRING}"
will result in SQLPLUS=/usr/oracle/product/8.1.7/bin/sqlplus -s sys/xxxxxx@<sid>
(3) and when issue $SQLPLUS <<-EOF
it connects fine and execute the procedure successfully.
in Oracle 9.2.0,
(1) the command CONNECT_STRING=`${HOME}/admin/Util/syspass.sh sys $DBNAME`
works fine with result same as in 8.1.7 - CONNECT_STRING=sys/xxxxxx@<sid>
(2) the command SQLPLUS="${ORACLE_HOME}/bin/sqlplus -s ${CONNECT_STRING}"
works fine with result SQLPLUS=/usr/oracle/product/9.2.0/bin/sqlplus -s sys/xxxxxx@<sid>
(3) However, when issue $SQLPLUS <<-EOF returns an error:
ERROR:
ORA-28009: connection to sys should be as sysdba or sysoper
How can I fix that??
Is it because of the username/password structure (sys/xxxxxx@<sid>)??
I would like to keep such username/password format if possible.
I have also tried to hard coded the username/password for variable SQLPLUS as:
SQLPLUS="/usr/oracle/product/9.2.0/bin/sqlplus -S '/ as sysdba'"
But it still doesn't work when issue $SQLPLUS, it returns the following:
Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ]
where <option> ::= -H | -V | [ [-L] [-M <o>] [-R <n>] [-S] ]
<logon> ::= <username>[<password>][@<connect_string>] | / | /NOLOG
<start> ::= @<URI>|<filename>[.<ext>] [<parameter> ...]
"-H" displays the SQL*Plus version banner and usage syntax
"-V" displays the SQL*Plus version banner
"-L" attempts log on just once
"-M <o>" uses HTML markup options <o>
"-R <n>" uses restricted mode <n>
"-S" uses silent mode
Any ideas as to how to have the script run in 9.2.0??
Your help is much appreciated.

My first comment is that even though you are using a secure encrypted text file, putting the SYS password on the command line can make the password available to anyone on the server who can perform a ps command:
shvec320 ECD2 /u01/home/oracle/cronscripts $ sqlplus mark/mark4s@dbnm
SQL*Plus: Release 8.1.7.0.0 - Production on Wed Mar 24 16:47:17 2004
(c) Copyright 2000 Oracle Corporation. All rights reserved.
Connected to:
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
With the Partitioning option
JServer Release 8.1.7.4.0 - Production
SQL> !ps -ef | grep mark
oracle 25494 25078 0 16:47:17 pts/4 0:00 sqlplus mark/mark4s@dbnm
oracle 25497 25494 0 16:47:23 pts/4 0:00 grep mark
Consider putting the connect string in the SQL script:
sqlplus /nolog <<-EOF
connect ${CONNECT_STRING}
var numfiles number;
BEGIN
SELECT count(*) into :numfiles
FROM dba_data_files a, dba_data_files b
WHERE a.file_name != b.file_name
AND SUBSTR(a.file_NAME, INSTR(a.file_name, '/', -1) + 1)
= SUBSTR(b.file_NAME, INSTR(b.file_name, '/', -1) + 1);
END;
exit :numfiles
EOF
Starting in Oracle 9 (others will correct me if I am wrong) you cannot connect to the sys account without specifying as SYSDBA or SYSOPER.
My testing (9.2.0.3) resulted in your ORA-1013 using "sys/password@dbname as sysdba". Using "sys/password as sysdba" works just fine. I seem to remember if you want to use @dbname, you will need to use password file authentication instead of OS authentication.
My suggestion -if possible - is to use plain "connect / as sysdba" in your SQL Script and have ORACLE_HOME and ORACLE_SID set correctly in your environment (do it in ${HOME}/BACKUP/${DBNAME}.env) :
sqlplus /nolog <<-EOF
connect / as sysdba;
var numfiles number;
BEGIN
SELECT count(*) into :numfiles
FROM dba_data_files a, dba_data_files b
WHERE a.file_name != b.file_name
AND SUBSTR(a.file_NAME, INSTR(a.file_name, '/', -1) + 1)
= SUBSTR(b.file_NAME, INSTR(b.file_name, '/', -1) + 1);
END;
exit :numfiles
EOF
HTH

Similar Messages

  • My back and forward buttons do not work also the refreash button does not work, I have reloaded the latest version of fire fox and that did not help. HELP please.

    My back and forward buttons do not work also the refresh button does not work, I have reloaded the latest version of fire fox and that did not help. All of navigation tool bar worked until I updated Fire Fox, now if I click on a link in yahoo, for instance, I can not get back to my yahoo home page without reloading Fire Fox. HELP please.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    *https://support.mozilla.com/kb/Bookmarks+not+saved#w_places-database-file

  • [svn:fx-trunk] 5019: ASDoc updates to indicate that some Halo containers do not work with the Spark equiv (ControlBar does not work with Spark Panel/ AppControlBar does not work with Spark Application), and indicate that Canvas, Box, Tile, Panel have Spa

    Revision: 5019
    Author: [email protected]
    Date: 2009-02-19 13:17:21 -0800 (Thu, 19 Feb 2009)
    Log Message:
    ASDoc updates to indicate that some Halo containers do not work with the Spark equiv (ControlBar does not work with Spark Panel/AppControlBar does not work with Spark Application), and indicate that Canvas, Box, Tile, Panel have Spark equivs
    QE Notes: None
    Doc Notes: None
    Bugs: -
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ApplicationControlBar.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Box.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Canvas.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ControlBar.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/HBox.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/TabNavigator.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Tile.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/VBox.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ViewStack.as

    Hi DST
    This is a great effort and gesture. thank you on behalf of all the newbies.
    PJ

  • Java bean, works in Integration Engine but does not work in Adapter Engine.

    In connection to the following thread:
    PayloadZipBean - variable filename inside the archive
    I am trying to use the same bean.
    However I can see, that the bean is working correctly when I use Integration Engine.
    But if I am using ICo (AAE) and using the same bean in the receiver, I can see, that the bean gets called but does not work correctly.
    The audit log added to my bean shows, that the bean could read the filename correctly from the Dyanic Config in the message, but it cannot write the same into the message.
    Could you please help on this?

    Your above posted system details show multiple Java Console extensions.
    You can uninstall (remove) the Java Console extensions and disable the Java Quick Starter extension, you do not need them to run Java applets.
    See http://kb.mozillazine.org/Java#Multiple_Java_Console_extensions
    See also http://www.java.com/en/download/help/quickstarter.xml - What is Java Quick Starter (JQS)? What is the benefit of running JQS? - 6.0
    Disable the Java Quick Starter extension: Tools -> Addons -> Extensions
    Control Panel -> Java -> Advanced tab -> Miscellaneous -> Java Quick Starter (disable)
    You can try a direct connection: <br />
    Control Panel > Java > General tab > "Network Settings...": "Direct Connection" (enable)

  • HP Pavilion Entertainment PC: WiFi works, however, hard wired connection does not work.

    Internet via WiFi works, however, hard wired connection does not work.
    My software indicates my hardware is working properly.
    However, if I connect another computer to the cable I am using, it connects to the internet without a problem.
    And, if I connect my comupter to another cable that works with another computer, my computer still does not connect to the internet.
    HP Pavilion dv9700 Notebook PC
    32-bit Operating System
    Windows Vista Home Premium Service Pack 2

    It could be that the touch pad is broken on the inside and the contact area for the one button is either broken, blocked with an object or the cable going to the mother board is not inserted correctly into the mother board connector. I think in any case the case will have to come off and someone look for physical/connection problems.  It doesn't sound like a software problem but there is always a chance.
    Reminder: Please select the "Accept as Solution" button on the post that best answers your question. Also, you may click on the white star in the "Kudos" button for any helpful post to give that person a quick thanks. These feedback tools help keep our community active, so you receive better answers faster.

  • I own the 4s and my BT Planttronics Pro works fine with calls but does not work to listen to music? Any ideas on how to correct this?

    I own the 4s and my BT Planttronics Pro works fine with calls but does not work to listen to music?
    Any ideas on how to correct this?
    Thanks-Vitaleyes

    I don't know what they call it, but my plantronics voyager pro, and my wifes plantronics voyager pro+ will not let you hear music through the headset.  My Blueant T1 does support it and plays the music through the deadset.

  • I have an event in my calendar that was sent by someone who does not work for the company anymore and I am reminded 2 times a week. How can I remove it?

    I have an event in my calendar that was sent by someone that does not work for the company anymore and I am reminded 2 times a week. How do I delete it?

    Tap on the event to open the event. Click the 'Edit' button in the event bubble, then press the 'Delete Event' button at the bottom of the Edit pop-up. It's a little different for events that come through Microsoft Exchange, you tap the event to bring up bubble and click the 'Details' button, and then press 'Decline' to remove the event.

  • The button on the side that turns my phone to silent does not work and niether does the up volume button.  I have tried restarting my phone, I did a soft reset, I checked all my settings, but nothing has worked.  Does anybody have any suggestions?

    Hello,
    I have an iPhone 4 and recently started to have some problems.  First, the button on the side of my phone, that puts the phone on silent is not working. I can move the switch, but my phone stays in silent. However, If I plug my headphones in, Then I can hear everything like I am supposed too.   Also, my up volume button does not work.  This is with the headphones also. 
    I have tried doing a soft reset, I reset all of my settings, I updated my software, I restored everything back to factory settings, and nothing has fixed it.  I bought it from best buy and can send it in for service, but the last time I sent a phone in, it took them 3 months!  and I really don't want to go without my phone that long. 
    Does anybody have any suggestions? 
    Thanks so much!!

    Sounds like it either believes that there are headphones plugged in, or the switch is broken.
    Why in the world would you take it to Best Buy for service? Take it to an Apple Store. They can replace it on the spot if it's defective.

  • Reading message from MQ- works in WSAD (IDE) but does not work outside WSAD

    Read from MQ:
    Same code works within WASD but does not work outside WSAD.

    PDL - thanks for the suggestions - here are the results:
    A button on the form that executes "this.print();" works fine.
    Changing "this" to "event.target" results in the same error.
    document.getElementById("PDFObj").Print(); works fine.
    However, the reason that I'm using ".postMessage([message])" instead of ".Print()" is because I actually have a toolbar that has save, print, zoom in, zoom out, page up, page down, etc.... I simplified the switch statement in the post above to only include print, but in reality has a case for each of the functions above. The postMessage call is triggering the error, since the catch statement is printing out the error message above. Any idea why this would work with Professional but not Reader.

  • HT4623 My iPad 2 audio only works with headphones and orientation does not work at all

    My iPad 2 volume button does not work with the integrated speakers of my iPad, once a headphone is connected to the jack output of my iPad the OSD volume displays fine and works to the external headphone but once the headphone jack is removed, there is no more a volume bar and the side volume buttons don't work at all, this has affected the screen orientation as well, screen does not orientate  as well,
    Please help

    If you deleted files from the operating system, you wrecked your installation and the first thing you need to do is either restore those files from a backup or reinstall the OS. Doing that is never the solution to any problem. Back up all data before making any changes.

  • Phone 4 home button does not work, iPhone 4 home button does not work

    Phone 4 home button does not work. I tried to put it off and on, but to no avail. Tried updating, still nothing.

    No magic solutions for a hardware problem.  You'll need to bring your phone to Apple for replacement ($149), or find a 3rd party to fix your phone (which will forfeit all future support on that phone, warranty or otherwise, from Apple)

  • My FaceTime works on my iPhone but does not work on my Ipad air ?

    FaceTime does not work on my ipad is great on my iPhone help ?

    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    iOS: FaceTime is 'Unable to verify email because it is in use'
    http://support.apple.com/kb/TS3510
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    iOS 6 and OS X Mountain Lion: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    How to Set Up & Use iMessage on iPhone, iPad, & iPod touch with iOS
    http://osxdaily.com/2011/10/18/set-up-imessage-on-iphone-ipad-ipod-touch-with-io s-5/
    Extra FaceTime IDs
    http://tinyurl.com/k683gr4
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Troubleshooting iMessage Issues: Some Useful Tips You Should Try
    http://www.igeeksblog.com/troubleshooting-imessage-issues/
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    Fix Can’t Sign Into FaceTime or iMessage iOS 7
    http://ipadtutr.com/fix-login-facetime-imessage-ios-7/
    FaceTime, Game Center, Messages: Troubleshooting sign in issues
    http://support.apple.com/kb/TS3970
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
    How to Block Someone on FaceTime
    http://www.ehow.com/how_10033185_block-someone-facetime.html
    My Facetime Doesn't Ring
    https://discussions.apple.com/message/19087457
    Send an iMessage as a Text Message Instead with a Quick Tap & Hold
    http://osxdaily.com/2012/11/18/send-imessage-as-text-message/
    To send messages to non-Apple devices, check out the TextFree app https://itunes.apple.com/us/app/text-free-textfree-sms-real/id399355755?mt=8
    How to Send SMS from iPad
    http://www.iskysoft.com/apple-ipad/send-sms-from-ipad.html
    You can check the status of the FaceTime/iMessage servers at this link.
    http://www.apple.com/support/systemstatus/
     Cheers, Tom

  • My cannon printer worked with snow leopard but does not work with Lion

    My Mf 4350d printer does not work with lion Mac OS X Lion 10.7.2., it worked with Snow leopard no problem. I am a novice with apple so can you tell me how to do any changes carefully.

    Have you downloaded and installed the latest Canon printer drivers?
    http://support.apple.com/kb/DL899

  • How can I recover my information if my iphone just works when plugged? (it does not work if it is connnected to the PC, just to the grid...)

    Hello!!
    my iphone does not work as it was wet, I can just switch it on whe it is plugged to the grid, no the PC
    So, is there any possibility to recover all the information I have? I don't have the last photos I did in the last backup...
    Please let me know!!!
    Thanks a lot in advance!!!!

    In the list view, try double clicking on the e-mail to see if you can open it and see if you can scroll there.

  • Past from 1year am using 4s in India...if we carry this phone to Australia does this phone work...If its does not work Then what is the procedure..???

    Past from 1year am using 4s in India...if we carry this phone to Australia does this phone work...
    If its does not work Then what is the procedure..???

    Call AppleCare and tell them you just want to know if your iPhone is unlocked and if not, who is it locked with. If it is locked contact the cell provider and ask them what their unlock process is and complete it if you qualify.

  • Debug version works well, but release version does not work with simulator

    Hi,
    I use iOS 7.0.3 and Xcode 5.0.2.
    I developped one application and I tested with simulator-ipad retina. The debug version works well and release version did not work at all.
    The basic configuraton is like this:
    cocos2d: cocos2d-iphone v2.1
    cocos2d: compiled with Profiling Support: NO
    cocos2d: OS version: 7.0.3 (0x07000300)
    cocos2d: GL_VENDOR:   Apple Computer, Inc.
    cocos2d: GL_RENDERER: Apple Software Renderer
    cocos2d: GL_VERSION:  OpenGL ES 2.0 APPLE-9.2.1
    cocos2d: GL_MAX_TEXTURE_SIZE: 4096
    cocos2d: GL_MAX_TEXTURE_UNITS: 8
    cocos2d: GL_MAX_SAMPLES: 4
    cocos2d: GL supports PVRTC: YES
    cocos2d: GL supports BGRA8888 textures: YES
    cocos2d: GL supports NPOT textures: YES
    cocos2d: GL supports discard_framebuffer: YES
    cocos2d: GL supports shareable VAO: NO
    What is the reason and how to fix it?

    Well, yes...you need to upgrade to OS X Server 4.0 ($19.99)...I already did it also!

Maybe you are looking for

  • My friend blocked my iphone and now i can not unblock it .. what do i do to get if fixed ??

    my friend was playing with my iphone .. it waz blocked by an password , she ranodomly started to click numbers and inventualy she blocked it cause she didnt know what the password was .. now my iphone woun't work and i don't have a clue how to unbloc

  • Final CUt Studio 2 will not run on my Mac Pro & Macbook Pros simultaneously

    I was under the impression that the licensing contract for FCPS2 allowed for the software to be installed and run on a desktop and a portable machine simultaneously. Am I wrong? I purchased Final Cut Studio 2 legally, and have installed it on my Mac

  • Next FLV won't ever load

    Ok...I have 2 flv files that come from my database that tell the player where the 2 FLV"s are that it needs to play. (videos/geeksquad.flv and videos/geeksquadoffer.flv). The first one is loaded and plays upon result from the database like so... vPla

  • Date picker wont work in oxo template

    The date picker when using the oxo template does not work for forms or web apps making my site suffer, i need a fix ASAP. PLEASE HELP

  • Front Panel values lost upon save

    I am just taking my first steps with Labview. I have created a couple of VIs and have managed to get I2C communication happening through a third party DAQ box. The problem I am having is fairly simple, I am trying to save VIs but they are not retaini