473,473 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How execute the shutdown immediate on oracle using perl

2 New Member
hai guys..
I have a problem..I need to shutdown the database from perl script. I was trying through connect(), execute(), prepare()..But some how I am getting error as Invalid sql statement..
I will give my code..help me..
use DBI;

$ENV{ORACLE_SID} = "orcl"; # set ORACLE_SID as needed
$sid = "pacs";
$host = "192.188.136.30"; #<hostname>
$user ="sys";
$password = "production";

$dbh = DBI->connect("dbi:Oracle:host=$host;sid=$sid", $user, $password,{ ora_session_mode => SYSDBA });
print "connect db";
$query = "shutdown immediate";
$sth = $dbh->prepare($query);
$sth->execute();
..
thanks in advance..
regards & thanks..
vijay :confused:
Aug 8 '06 #1
1 3812
mikek
2 New Member
Vijay,
I would think:

$query->finish;
## Ends the execute
and
$dbh->disconnect;
## disconnects the DB

SHOULD handle it.
Is that what you mean ??

Regards,
MikeK




hai guys..
I have a problem..I need to shutdown the database from perl script. I was trying through connect(), execute(), prepare()..But some how I am getting error as Invalid sql statement..
I will give my code..help me..
use DBI;

$ENV{ORACLE_SID} = "orcl"; # set ORACLE_SID as needed
$sid = "pacs";
$host = "192.188.136.30"; #<hostname>
$user ="sys";
$password = "production";

$dbh = DBI->connect("dbi:Oracle:host=$host;sid=$sid", $user, $password,{ ora_session_mode => SYSDBA });
print "connect db";
$query = "shutdown immediate";
$sth = $dbh->prepare($query);
$sth->execute();
..
thanks in advance..
regards & thanks..
vijay :confused:
Oct 24 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: KULJEET | last post by:
i face problem in oracle backup. i take oracle logical backup after 3-4 days. but now the database is run 24*7 days so i set the oracle on archive mode at last night i take the hot backup by...
2
by: michi | last post by:
Hello there... Can anybody tell me what is the difference when I excecute a sql statement within pl sql with/without "execute immediate" statement Thanks Michi :)
7
by: Lynn | last post by:
I'm running Oracle 8.1.7.4.1 on W2K and have the services for my oracle instances set to automatically startup and shutdown with the W2K server. Unfortunately, neither is working. Nothing gets...
1
by: Allen Guan | last post by:
I installed mysql-4.1.7 on solaris 8. I can start it using mysqld_safe. But when I tried to shutdown using 'mysqladmin -p shutdown' and type in the root password, it gave: mysqladmin -p shutdown...
5
by: Gustavo Randich | last post by:
Hello, I'm writing an automatic SQL parser and translator from Informix to DB2. Now I'm faced with one of the most difficult things to translate, the "foreach execute procedure" functionality...
0
by: vijay | last post by:
hai every bady.. this is vijay from india. I want execute "shutdown immediate" command on oracle database from perl script. I was trying to execute through connect(), prepare() & execute()..But It's...
5
by: umesh049 | last post by:
Hello, I want to delete all the date of all the table in a scheman. but i got error at execute immediate statement. can any body help me. thanks
3
by: Rahul Babbar | last post by:
Hi, I have the following doubt. Suppose I use the execute immediate statement and the statement to be executed is a Select statement from the sysibm.sysdummy1 table which will always return...
1
by: srikantvm | last post by:
Hi All, I am using perl, v5.8.8 built for MSWin32-x86-multi-thread and i tried installing the DBD-Oracle module but unable to install. Please find below the steps followed by me: 1) I first...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.