[Spacewalk-list] oracle error on logmode
Colin Coe
colin.coe at gmail.com
Thu Nov 26 22:10:08 UTC 2009
>From memory if you put the "EOF" in quotes you won;t need to escape $DATABASE.
CC
On Thu, Nov 26, 2009 at 9:40 PM, rob morrien <rmorrien at xs4all.nl> wrote:
> hello
>
> the solution is working
> i made the next script >
> which i attatched
>
> #!/bin/sh
> #
> # The script assumes that user can connect using "/ as sysdba" and Flash
> # Recovery Area is enabled.
> #
> # =================
> # Presettings for setting up archivelog for online backup
> # =================
> #
> # For database in NoArchiveLog mode, database is shutdown and an offline
> # backup is done;
> # For database in Archive log mode, online backup is done.
> #
> # During the backup procedure, the script stores flash recovery area
> # location by saving complete initialization parameter to
> # ?/dbs/spfile2init.ora file. This will be used during restore operation
> # to find Flash Recovery Area location. If this file is lost, then user
> must
> # enter Flash Recovery Area location during restore operation.
> #
> # Two backups are maintained in Flash Recovery Area and the corresponding
> # log files for last two backup job are saved in
> # $HOME/oxe_backup_current.log and $HOME/oxe_backup_previous.log
> #
> user=`/usr/bin/whoami`
> group=`/usr/bin/groups $user | grep dba`
> if test -z "$group"; then
> echo Operation failed. $user is not a member of \'dba\' group.
>
> #Wait for user to press any key
> echo -n "Press any key to exit"
> read userinp
> exit 0
> fi
>
> ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
> export ORACLE_HOME
>
> ORACLE_SID=XE
> export ORACLE_SID
>
> PATH=$ORACLE_HOME/bin:$PATH
> export PATH
>
> PATH=$ORACLE_HOME/bin:$PATH
> export PATH
>
> LD_LIBRARY_PATH=$ORACLE_HOME/lib:$PATH
> export LD_LIBRARY_PATH
>
> TMPDIR=/tmp
> test_normlog=${TMPDIR}/test_normlog$$.log
>
> #Fix a logfile for current
> sqlplus /nolog > $test_normlog << EOF
> connect / as sysdba;
> shutdown immediate
> startup mount
> alter database archivelog;
> alter database open;
> SELECT LOG_MODE FROM SYS.V\$DATABASE;
> /
> quit
> EOF
>
>
>
>
>
>
> Well, you've typed:
>>
>> SELECT LOG_MODE FROM SYS.V$DATABASE;
>>
>> and have an error message of:
>>
>> SELECT LOG_MODE FROM SYS.V
>>
>> Now, I freely admit I know little of Oracle but from the error output
>> it looks as if the $DATABASE has been interpreted as a shell variable.
>> My suggestion is to replace
>>
>> SELECT LOG_MODE FROM SYS.V$DATABASE;
>>
>> with
>>
>> SELECT LOG_MODE FROM SYS.V\$DATABASE;
>>
>> This is referred to as 'escaping'. What it essentially does is
>> instruct the shell to ignore $'s normal special meaning.
>>
>> HTH
>>
>> CC
>>
>>
>>
>> On Thu, Nov 26, 2009 at 7:40 PM, rob morrien <rmorrien at xs4all.nl> wrote:
>>> sorry what do you mean
>>>
>>> sqlplus is new for me
>>>
>>>
>>>
>>> Looks like the $ is causing you problems. Does it work if you escape
>>> the
>>>> $?
>>>>
>>>> CC
>>>>
>>>> On Thu, Nov 26, 2009 at 6:08 AM, rob morrien <rmorrien at xs4all.nl>
>>>> wrote:
>>>>>
>>>>> hello
>>>>>
>>>>> i try to run
>>>>>
>>>>> sqlplus /nolog
>>>>> connect / as sysdba;
>>>>> shutdown immediate;
>>>>> startup mount
>>>>> alter database archivelog;
>>>>> alter database open;
>>>>> SELECT LOG_MODE FROM SYS.V$DATABASE;
>>>>> quit
>>>>>
>>>>> i get an error on the next line
>>>>> SQL> SELECT LOG_MODE FROM SYS.V
>>>>> *
>>>>>
>>>>> who can help me
>>>>>
>>>>> _______________________________________________
>>>>> Spacewalk-list mailing list
>>>>> Spacewalk-list at redhat.com
>>>>> https://www.redhat.com/mailman/listinfo/spacewalk-list
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> RHCE#805007969328369
>>>>
>>>> _______________________________________________
>>>> Spacewalk-list mailing list
>>>> Spacewalk-list at redhat.com
>>>> https://www.redhat.com/mailman/listinfo/spacewalk-list
>>>>
>>>
>>>
>>> _______________________________________________
>>> Spacewalk-list mailing list
>>> Spacewalk-list at redhat.com
>>> https://www.redhat.com/mailman/listinfo/spacewalk-list
>>>
>>
>>
>>
>> --
>> RHCE#805007969328369
>>
>> _______________________________________________
>> Spacewalk-lis
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
>
--
RHCE#805007969328369
More information about the Spacewalk-list
mailing list