- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script help oracle
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2007 04:32 PM
тАО02-06-2007 04:32 PM
script help oracle
#!/usr/bin/ksh
${ORACLE_HOME}/bin/sqlplus / as sysdba << EOF > /dev/null
alter tablespace ${TABLESPACE_NAME} begin backup;
exit
this script is supposed to login oracle and
tablespace is altered , when i run the script, it is connected but
dose not know sql command alter..
Beginning backup of tablespace MAITM010_IDX
SQL*Plus: Release 10.2.0.2.0 - Production on Wed Feb 7 14:18:10 2007
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> SP2-0734: unknown command beginning "MAITM010_T..." - rest of line ignored.
SQL> SP2-0042: unknown command "SYSAUX" - rest of line ignored.
SQL> SP2-0042: unknown command "SYSTEM" - rest of line ignored.
SQL> SP2-0042: unknown command "UNDOTBS1" - rest of line ignored.
SP2-0044: For a list of known commands enter HELP
and to leave enter EXIT.
how can I run the script to run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2007 06:44 PM
тАО02-06-2007 06:44 PM
Re: script help oracle
to be able to troubleshoot this script better, add the following to the commands:
spool /tmp/log.txt
...
...
spool off;
and then upload the log.txt so that we can have a better look.
In the meanwhile, I have tried this simple script here and it works fine:
#!/usr/bin/ksh
$ORACLE_HOME/bin/sqlplus / as sysdba << EOF >> /dev/null
spool /tmp/log.txt
select sysdate from dual;
exit;
EOF
revert.
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2007 06:50 PM
тАО02-06-2007 06:50 PM
Re: script help oracle
since you are using Oracle 10g, it is much better and easy to do RMAN backup.
please refer to my post in your previous thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1097393
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2007 07:32 PM
тАО02-06-2007 07:32 PM
Re: script help oracle
I assume you have set the value for ${TABLESPACE_NAME} somewehere else, but have assigned the list of tablespaces, rather the
individual value.
If your do a
echo ${TABLESPACE_NAME}
just before your call to sqlplus, you should find the list includes SYSAUX SYSTEM UNDOTBS1.
You have to call the alter statement in a loop, or have multiple alter statement with a different tablespace_name value.
You are also missing a EOF in the line following the exit statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2007 09:14 PM
тАО02-07-2007 09:14 PM
Re: script help oracle
try:
#!/usr/bin/ksh
TABLESPACE_NAME=MAITM010_IDX
${ORACLE_HOME}/bin/sqlplus / as sysdba << EOF > /dev/null
alter tablespace ${TABLESPACE_NAME} begin backup;
exit
EOF
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-08-2007 01:11 AM
тАО02-08-2007 01:11 AM
Re: script help oracle
Next, use the SET SPOOL as requested and share the exact commands as given to Oracle and the result.
We see where MAITM010_IDX might come from.
But where does the SYSAUX, SYSTEM,... come from. Understanding that may explain a problem. Maybe the command shown works, but the next command suggests a problem?
Finally... If the MAITM010_IDX is what it's name implies: just indexes, then be sure to carefully weigh the cost of backup + restore all versus just re-indexing and analyzing selected indexes.
Regards,
Hein van den Heuvel
HvdH Performance Consulting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-08-2007 12:57 PM
тАО02-08-2007 12:57 PM
Re: script help oracle
I think that maybe the shell environment is the cause of error
I changed ${ORACLE_HOME}/bin/sqlplus / as sysdba << EOF > /dev/null to ${ORACLE_HOME}/bin/sqlplus / as sysdba <
this works fine.
but your helps are available to me.
I really appreciate that.
and I will backup of oracle using RMAN next time to your advice. thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2007 11:33 AM
тАО02-12-2007 11:33 AM
Re: script help oracle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2007 04:47 AM
тАО02-21-2007 04:47 AM
Re: script help oracle
with 10g you simply can do
alter database begin backup;
Very charming and very speedy compared to 9i.
Volker