Sponsored Content
Top Forums Shell Programming and Scripting Switching user to oracle to connect Oracle 11g DB with 'sysdba' Post 302628233 by cero on Monday 23rd of April 2012 06:56:40 AM
Old 04-23-2012
Hi,
there are some syntactical errors with quoting and the here-documents. Try this:
Code:
su - oracle -c 'sqlpus -s / as sysdba <<EOF
        whenever sqlerror exit sql.sqlcode;
        set echo off 
        set heading off
    
        shutdown immediate
        startup mount
        alter database archivelog;
        alter database open;
        
        exit;
EOF
'

The terminating delimiter of there here-doc has to be the only string in its line and not indented (unless you use <<-).
 

3 More Discussions You Might Find Interesting

1. Programming

Help on a perl script to connect to oracle ASM as sysdba

I am novice to perl. Can someone guide me on the below query. We have an existing perl script which connects to database to check the disk group status which i wanted to retieve directly from ASM rather than database. This is because, a cluster has more than 4 databases running and a check on... (0 Replies)
Discussion started by: sai_rsk
0 Replies

2. Shell Programming and Scripting

Use perl to connect to Oracle ASM as sysdba

I am novice to perl. Can someone guide me on the below query. We have an existing perl script which connects to database to check the disk group status which i wanted to retieve directly from ASM rather than database. This is because, a cluster has more than 4 databases running and a check on... (1 Reply)
Discussion started by: sai_rsk
1 Replies

3. UNIX and Linux Applications

Identify a specific environment Oracle variable to connect a remote Oracle database ?

Good evening I nned your help pls, In an unix server i want to connect to a remote oracle databse server by sqlplus. I tried to find out the user/passwd and service name by env variable and all Ive got is this: ORACLE_SID_REPCOL=SCL_REPCOL ORACLE_SID=xmeta ORACLE_SID_TOL=SCL_PROTOLCOL... (2 Replies)
Discussion started by: alexcol
2 Replies
aft(1)							      General Commands Manual							    aft(1)

NAME
aft - "free form" document preparation system SYNOPSIS
aft [--verbose] [--autonumber] [--output=file | --output=-] [--type=output-type] infile .. DESCRIPTION
AFT is a nearly free format documentation system which can be typed in using any editor or wordprocessor that supports tabs or hard spaces (column-based spaces whose number doesn't shrink or grow based on formatting). By using AFT, you are no longer constrained to one wordpro- cessing file standard (such as Microsoft Word), nor do you have to enter a plethora of weird syntactical incantations of an embedded mark up language (such as LaTeX or HTML). Unlike other mark up languages, AFT is designed to parse and recognize patterns rather than formal commands. That is why there is no single escape or command sequence that tells AFT what to do. In this regard, AFT will process almost anything you throw at it. An AFT document is easily converted into such popular formats as HTML, RTF and LaTeX. Because there are few commands, learning to write a document in AFT requires little effort. This doesn't mean that AFT is not powerful. In fact, this very document was conceived and written using AFT. USAGE
Running AFT is as simple as typing: aft NAME_OF_YOUR_FILE.aft OPTIONS
--verbose Generate a lot of commentary. By default, AFT will just silently process files (unless errors occur). Using this option causes AFT to keep you informed about what it is doing. --autonumber This switch tells AFT to automatically number your sections.--output=file | --output=- This tells AFT where to send its processed output. You can supply a filename (file) or - which tells AFT to write to your standard output (your display or stdout). --type=output_type This tells AFT what type of output to do. For example HTML output is used for html and DocBook output is used for docbook. As a side effect, this will also specify the file name extension for the output file if the --output option isn't specified. infile .. One or more AFT documents to be processed. Almost Free Text 22. April 2003 aft(1)
All times are GMT -4. The time now is 08:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy