Home » Infrastructure » Unix » connecting to sqlplus (HP-UX)
connecting to sqlplus [message #484596] Wed, 01 December 2010 18:41 Go to next message
ramesh55.sse
Messages: 262
Registered: December 2008
Location: Hyderabad
Senior Member
Hi Experts,

Hi All,

This following is the job is schedule to refresh materialized views.
which is written in unix.

#!/bin/ksh
. $HOME/.jobmanrc

. $pjc_bin_path/PJCEFUNCS

JOBNAME mvrefreshj APPLICATION=$wedb_app_name MAXCOND=01 AUTOSTART
export WEDB_EOM=N
LOADAPPVARIABLES $wedb_env_file

JOB_PATH $wedb_path_file

# ============================================================================
# ============================== JOB BEGIN ===================================
# ============================================================================
#
# ============================ STEP 010 BEGIN ================================
#
#

# STEP_EXECUTE STEP010 sqlplus / @$WEDB_SQL/mvrefresh.sql

STEP_END
#
# ============================================================================
# ============================================================================
# ============================================================================
JOB_END
# =============================== JOB END ====================================
# ENDJOB mvrefreshj
# ============================================================================

The following is the sql file this job is callling.

WHENEVER SQLERROR EXIT SQL.SQLCODE
WHENEVER OSERROR EXIT SQL.OSCODE

set echo on
set serveroutput on

DECLARE

/*****************************
PROCEDURE: refresh snapshots
This procedure is called to refresh the mviews
*****************************/

procedure refresh_mviews IS

begin

DBMS_MVIEW.REFRESH('emp_mvw', 'C' );

commit;

end refresh_snapshots ;

/***** Main block *****/

BEGIN

refresh_snapshots;

End;
/
EXIT;


If I ran that job by default it is connect to user1 ,but i want to connect to user2.
Where should I give the connect statement and to write that code pleae help me.

I tried this

sqlplus user2/12345/@$WEDB_SQL after pressing again it's asking for username and passord.

Thanks.
Re: connecting to sqlplus [message #484603 is a reply to message #484596] Wed, 01 December 2010 22:23 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>If I ran that job by default it is connect to user1
Why "user1"? Nothing posted corroborates this statement.

>sqlplus user2/12345/@$WEDB_SQL after pressing again it's asking for username and passord.
Forgive me but I do not believe you for a couple of reasons
1. "user2/12345/@$WEDB_SQL" is invalid syntax
2. >@$WEDB_SQL/mvrefresh.sql it appears $WEBD_SQL contains a directory specification

I suspect that you did a MAJOR effort of selective editing before post.
Since when does JOB start with STEP 010

>JOBNAME mvrefreshj APPLICATION=$wedb_app_name MAXCOND=01 AUTOSTART
Line above is NOT conventional script syntax.
Re: connecting to sqlplus [message #487096 is a reply to message #484603] Wed, 22 December 2010 12:28 Go to previous messageGo to next message
ramesh55.sse
Messages: 262
Registered: December 2008
Location: Hyderabad
Senior Member
Hi All,
Can anybody explain me what is JOB_END.

Thanks
Re: connecting to sqlplus [message #487101 is a reply to message #487096] Wed, 22 December 2010 12:40 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This seems to be a script not be executed directly at OS prompt but within a scheduler and JOB_END is a keyword.

Regards
Michel
Re: connecting to sqlplus [message #487144 is a reply to message #487101] Thu, 23 December 2010 03:06 Go to previous messageGo to next message
ThomasG
Messages: 3211
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Or JOB_END is a function defined in PJCEFUNCS.
Re: connecting to sqlplus [message #487153 is a reply to message #487144] Thu, 23 December 2010 03:50 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes, didn't see this include/source.

Regards
Michel
Re: connecting to sqlplus [message #487179 is a reply to message #487153] Thu, 23 December 2010 08:58 Go to previous messageGo to next message
ramesh55.sse
Messages: 262
Registered: December 2008
Location: Hyderabad
Senior Member
Thanks for your reply

This job is scheduled using TIDAL scheduler.

How can we check for JOB_END is in PJCEFUNCS.


Please help me.

Re: connecting to sqlplus [message #487180 is a reply to message #487179] Thu, 23 December 2010 09:25 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Using grep or vi?

Regards
Michel

[Updated on: Thu, 23 December 2010 09:25]

Report message to a moderator

Previous Topic: Unix coding
Next Topic: Help!Oracle 8.1.7 Installation- Make Error on Solaris 8
Goto Forum:
  


Current Time: Fri Mar 29 10:45:59 CDT 2024