- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to force oracle to hang
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
Forums
Discussions
Discussions
Discussions
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
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
04-14-2003 04:11 AM
04-14-2003 04:11 AM
I'm testing some MC/ServiceGuard monitoring scripts, and I'm looking for a reliable way to make Oracle 'hang' (as opposed to 'crash').
I have a script that connects to oracle, and updates a row in a table with the current date. The script is timed, and if it doesn't respond after X seconds then the monitor can cause a failover/restart of oracle. Now I want to test this out, but to do this I need to force oracle to 'hang'.
My first thought was that
alter system archive log stop;
followed by
alter system switch logfile;
several times until all redo log groups were used would work. This has indeed hung the session that issued the switch logfile command, but my monitor script is still happily chugging away updating the database every few seconds... I'm guessing that its still using the last redo log, and the whole database won't hang completely until this log is 'full' (which with the tiny updates I'm doing, and the size of the redo logs could take a while).
Does anyone know a quicker/easier way of making the database 'hang' in this realistic manner ( I know I could send SIGSTOP to all the server processes, but thats not really a 'realistic' test)
10 points for the perfect answer.
Cheers
Duncan
I am an HPE Employee

Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2003 04:28 AM
04-14-2003 04:28 AM
Re: How to force oracle to hang
The Advanced SG class taught by HP has an OPS lab which tests for oracle failovers. I can provide you with what I have since it uses the oracle1.sh monitoring script.
Verify cluster and both instances are running:
SVRMGR>connect internal
SVRMGR>select * from s$active_instanaces
SVRMGR>shutdown
SVRMGR>exit
$exit
#vgchange -a n vg_ops (* vg defined in oracle_package_cntl. *)
Add the packages and check that they continue running:
# cmrunpkg -n node1 ora_pkg
# cmviewcl
etc.
Test reformation:
Power off node1. Repeat for node2.
Test reformation after internal failure:
TOC on node1. Repeat node2.
Check instances:
kill lmon on node1. Repeat node2.
Check instances:
Run 'ins_rows_1' on node1 and kill lmon. Repeat node 2.
NOTE: This last test will be a little different for non OPS servers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2003 04:32 AM
04-14-2003 04:32 AM
Re: How to force oracle to hang
thanks,
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2003 04:41 AM
04-14-2003 04:41 AM
Re: How to force oracle to hang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2003 04:43 AM
04-14-2003 04:43 AM
Re: How to force oracle to hang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2003 04:44 AM
04-14-2003 04:44 AM
Re: How to force oracle to hang
Thanks
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2003 04:50 AM
04-14-2003 04:50 AM
Solutionto fill the redologs the best way is to inesrt and delete data.
create table redofill_test (col1 char(2000)) tablespace
begin
for i in 1 .. 10000
loop
insert into redofill_test values ('a');
commit;
delete from redofill_test;
commit;
end loop;
end;
/
drop table redofill_test;
char is a good choice for the datatype because oracle allocates 2000 bytes for each row.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2003 04:50 AM
04-14-2003 04:50 AM
Re: How to force oracle to hang
And I get this from my insert script:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
So not a hang, but a crash.
Keep em coming!
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2003 04:53 AM
04-14-2003 04:53 AM
Re: How to force oracle to hang
# kill -STOP
...
# kill -CONT
Best regards...
Dietmar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2003 05:01 AM
04-14-2003 05:01 AM
Re: How to force oracle to hang
I'll give these a try...
Thanks
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2003 05:08 AM
04-14-2003 05:08 AM
Re: How to force oracle to hang
how about locking a table in one session or keeping a session active.
and issuing a "shutdown normal" (instead of shutdown immediate)
haven't tried it though..
hth
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2003 05:23 AM
04-14-2003 05:23 AM
Re: How to force oracle to hang
That did the trick - when the redo log filled everything started to hang... and my script did detect the problem.
Dietmar,
Sending a SIGSTOP to pmon didn't seem to have any effect - perhaps I needed to leave it for longer.
Yogeeraj,
I suspect that this will just produce a different error from my monitor script... it logs into the database as a seperate session every time it polls the database, so once a shutdown command has been issued, rather than a hang I'll just get a "ORA-01090: shutdown in progress - connection is not permitted" message from sqlplus.
Any other ideas will also score points. The more different methods I have to test this the better.
Cheers
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2003 05:32 AM
04-14-2003 05:32 AM
Re: How to force oracle to hang
are you running 9i?
If yes, here's the good news!
In 9i, we have an alter database quiesce available with the resource manager.
This'll let you "pause" the system (put people on hold in effect).
Good luck
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2003 05:40 AM
04-14-2003 05:40 AM
Re: How to force oracle to hang
Note that you can find more info in the Oracle9i Data Guard Concepts and Administration Release 2 Chapter 4.
You would do something like:
Ensure that Resource Manager is configured. (Resource Manager is a requirement when putting the database into a quiesced state.)
then
alter system quiesce restricted;
then Unquiesce the system and and switch logfiles:
alter system unquiesce;
alter system switch logfile;
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2003 06:04 AM
04-14-2003 06:04 AM
Re: How to force oracle to hang
unfortunately I'm on 8i...
but i'll take note for when I have a 9i DB to cluster.
Cheers
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2003 04:57 AM
04-15-2003 04:57 AM
Re: How to force oracle to hang
If you stop archiving as you said on your initial submittal, Oracle may not care if you do a switchlog unless it feels that it has to have dbwriter write the changes before it can re-use the log, it won't hang.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2003 08:34 PM
04-15-2003 08:34 PM
Re: How to force oracle to hang
Here is another test method to test your MC/ServiceGuard monitoring scripts.
I have picked this one form another client who accidently caused their database to hang, but seems to be a good test case.
Database will hang after a while (2 hours) if listener is started by root with "su -"
Eg:- "su - oracle -c "lsnrtl start LISTENER_name.world"
We know that the listener needs to be started by the oracle user, not root. It is started as root with the above command, so in fact it should be as if it was started by oracle. This will work fine at the command line. But if it is started in the serviceguard script, with the same command as above everything works fine for about 2 hours. Then every session will start to hang.
Another way to cause your database to hang will be to issue the suspend command.
Database will be suspended by an ALTER SYSTEM SUSPEND statement
The other ways is to fill your archivelog destination directory which others mentioned.