Running the same sql script in multiple databases
Hello,
What is the method to run the same sql script in multiple databases? I want to write a unix script that would select from different databases and run a sql/plsql script in those different databases. What are the ways to write such a unix script? Thank you in advance.
Just have a parameter which takes in the oracle connection parameters and use it in your sqlplus script with your shell script.
Your sqlplus script can have a procedure/function call or an anonymous block;
Then have a wrapper script to call the original script with different connection parameters. Hope this helps.
Similar Messages
-
i am using sql server 2005. our company has many branches. each branch is located in different country. so when i update database in any country over the VPN connection then i need to update db in another country one by one over the vpn connection. it
is very tire some job....so i was think that there could be any easy trick to update multiple db in different country easily. so am developing a store procedure which will connect each DB in different database one after one over the vpn and read script from
sql file and execute the script in remote db over vpn. so please have look at my script and tell me how to do it. please do not advise me to use any 3rd party.
here is a table structure where i will put all my remote db details.
CREATE TABLE [dbo].[DBDetails]
[ServerName] [varchar](max) NULL,
[DBName] [varchar](max) NULL,
[UserID] [varchar](max) NULL,
[Password] [varchar](max) NULL,
[CountryCode] [varchar](2) NULL
SET NOCOUNT ON
DECLARE DB CURSOR FOR SELECT ServerName,DBName,UserID,Password,CountryCode FROM DBDetails
OPEN DB
DECLARE @ServerName varchar(MAX)
DECLARE @DBName varchar(MAX)
DECLARE @UserID varchar(MAX)
DECLARE @Password varchar(MAX)
DECLARE @CountryCode varchar(2)
FETCH NEXT FROM DB INTO @ServerName,@DBName,@UserID,@Password,@CountryCode
WHILE @@FETCH_STATUS = 0
BEGIN
-- here i need some help for opening db connection and read sql file and execute the statement
-- Please help here
FETCH NEXT FROM DB INTO @ServerName,@DBName,@UserID,@Password,@CountryCode
END
CLOSE DB
DEALLOCATE DB
thanksOne way: set them as jobs and assign the same schedule or start them from a stored procedure:
http://www.sqlusa.com/bestpractices2005/startjobfromstoredproc/
Note: when you start a job from a stored procedure, control proceeds to the next statement, there is no wait for the job to finish.
Kalman Toth SQL SERVER 2012 & BI TRAINING
New Book: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2012 -
Same sql query with multiple database links
Hi All,
i want to execute an sql query for a SELECT LIST Item. which should use database links in it's query.
i'm having a list of database links in the region. say :LOC which is having 10 items each linking to different databases.
i want to use following query for another item in same page.
select customer_name from working_lines@:LOC where
phone_no:phone_no
can i do this.
Thank you All.What we have done before is to create a report based on a PL/SQL procedure that returns a SQL statement.
The PL/SQL code grabs the "selected" database link from :LOC and parses the SQL QUERY you want to execute replacing some token (like [LINK]) with '@DBNAME'.
Lets say your SQL statement is coded like this:
mySQL := 'SELECT cust_name FROM working_lines[LINK] where phone_no = :Phone;'
Then all you would have to do to replace '[LINK]' with the proper DB alias would be:
mySQL := REPLACE(mySQL, '[LINK]', '@'||:LOC);
and then return the new SQL ...
if :LOC has something like 'V10GPROD' your SQL would look like :
SELECT cust_name FROM working_lines@V10GPROD where phone_no = :Phone;
The beauty of this is that you can also include a "null" option that means the select statement will be executed on THIS database...
Doug -
Why does do shell work differntly from running the same bash script in terminal?
i have the following a/s:
set scriptPath to quoted form of ((POSIX path of (path to me)) & lnThumb) set ftn to "" repeat try do shell script scriptPath & " " & ppath & " " & ftn exit repeat on error error_message number error_number if error_number is not -128 then set ftn to (choose file with prompt "select folder thumbnail" default location dir without invisibles) set ftn to quoted form of the POSIX path of ftn end if end try end repeat
calling this bash script:
#!/bin/bash -f cd "$1" rm ./folderthumb.jpg if [ $# -gt 1 ] then ft=${2/#"$1"\//} else ft=$(awk '/folderIcon=/{printf("%s",$1)}' meta.properties | sed s/folderIcon=// ) if [ 0$ft -eq 0 ] then exit 1 fi ft="thumbs/"$ft fi ln -s $ft ./folderthumb.jpg exit 0
which works as expected when run from the cli:
tomw> /Applications/imageProc/fixJAlbum.app/Contents/Resources/Scripts/lnThumb.sh `pwd` `pwd`/thumbs/P1040161.JPG tomw> ls -l folderthumb.jpg lrwxr-xr-x 1 tomw admin 19 Oct 22 10:36 folderthumb.jpg -> thumbs/P1040161.JPG
but fails to strip the common directory when called from do shell:
tomw> ls -l folderthumb.jpg lrwxr-xr-x 1 tomw admin 89 Oct 22 10:36 folderthumb.jpg -> /Users/tomw/Desktop/trip2albequerque/albequerque/oldRailyards2nobHill/thumbs/P1 040133.JPG
w-t-f???Click on the "Use Advanced editor" on the upper Right of the edit box.
Select the text you want preserved
Click on the >> icon then select "Syntax Highlighting" -> "Plain"
And you will get this
kind of
output when you post -
Error when running the apxldimg.sql to update the images direct from rel3.0
Hi everyone,
I'm new to APEX. I'm upgrading from v3.0 to v3.1. I'm on the post-installation, section on "Updating the Images Directory When Upgrading from Release 3.0", I ran into error below when running the apxldimg.sql script. Has anyone run into the is error before. If yes, how did you fix it?
Directory created.
filelist_xml xmltype := xmltype(bfilename(upload_directory_name,file_list),nls_charset_id('AL32UTF8'));
ERROR at line 15:
ORA-06550: line 15, column 36:
PLS-00306: wrong number or types of arguments in call to 'XMLTYPE'
ORA-06550: line 15, column 25:
PL/SQL: Item ignored
ORA-06550: line 38, column 15:
PLS-00302: component 'EXISTSRESOURCE' must be declared
ORA-06550: line 38, column 3:
PL/SQL: Statement ignored
ORA-06550: line 52, column 46:
PLS-00320: the declaration of the type of this expression is incomplete or
malformed
ORA-06550: line 52, column 3:
PL/SQL: Statement ignoredMy team member found another post that ran into the same problem and the section is for 11g only. My db is 9.2.0.5.
-
Multiple Executions Plans for the same SQL statement
Dear experts,
awrsqrpt.sql is showing multiple executions plans for a single SQL statement. How is it possible that one SQL statement will have multiple Executions Plans within the same AWR report.
Below is the awrsqrpt's output for your reference.
WORKLOAD REPOSITORY SQL Report
Snapshot Period Summary
DB Name DB Id Instance Inst Num Release RAC Host
TESTDB 2157605839 TESTDB1 1 10.2.0.3.0 YES testhost1
Snap Id Snap Time Sessions Curs/Sess
Begin Snap: 32541 11-Oct-08 21:00:13 248 141.1
End Snap: 32542 11-Oct-08 21:15:06 245 143.4
Elapsed: 14.88 (mins)
DB Time: 12.18 (mins)
SQL Summary DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542
Elapsed
SQL Id Time (ms)
51szt7b736bmg 25,131
Module: SQL*Plus
UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(ACCT_DR_BAL,
0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND TEST_ACC_NB = ACCT_ACC_NB(+)) WHERE
TEST_BATCH_DT = (:B1 )
SQL ID: 51szt7b736bmg DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542
-> 1st Capture and Last Capture Snap IDs
refer to Snapshot IDs witin the snapshot range
-> UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(AC...
Plan Hash Total Elapsed 1st Capture Last Capture
# Value Time(ms) Executions Snap ID Snap ID
1 2960830398 25,131 1 32542 32542
2 3834848140 0 0 32542 32542
Plan 1(PHV: 2960830398)
Plan Statistics DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542
-> % Total DB Time is the Elapsed Time of the SQL statement divided
into the Total Database Time multiplied by 100
Stat Name Statement Per Execution % Snap
Elapsed Time (ms) 25,131 25,130.7 3.4
CPU Time (ms) 23,270 23,270.2 3.9
Executions 1 N/A N/A
Buffer Gets 2,626,166 2,626,166.0 14.6
Disk Reads 305 305.0 0.3
Parse Calls 1 1.0 0.0
Rows 371,735 371,735.0 N/A
User I/O Wait Time (ms) 564 N/A N/A
Cluster Wait Time (ms) 0 N/A N/A
Application Wait Time (ms) 0 N/A N/A
Concurrency Wait Time (ms) 0 N/A N/A
Invalidations 0 N/A N/A
Version Count 2 N/A N/A
Sharable Mem(KB) 26 N/A N/A
Execution Plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | UPDATE STATEMENT | | | | 1110 (100)| |
| 1 | UPDATE | TEST | | | | |
| 2 | TABLE ACCESS FULL | TEST | 116K| 2740K| 1110 (2)| 00:00:14 |
| 3 | TABLE ACCESS BY INDEX ROWID| ACCT | 1 | 26 | 5 (0)| 00:00:01 |
| 4 | INDEX RANGE SCAN | ACCT_DT_ACC_IDX | 1 | | 4 (0)| 00:00:01 |
Plan 2(PHV: 3834848140)
Plan Statistics DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542
-> % Total DB Time is the Elapsed Time of the SQL statement divided
into the Total Database Time multiplied by 100
Stat Name Statement Per Execution % Snap
Elapsed Time (ms) 0 N/A 0.0
CPU Time (ms) 0 N/A 0.0
Executions 0 N/A N/A
Buffer Gets 0 N/A 0.0
Disk Reads 0 N/A 0.0
Parse Calls 0 N/A 0.0
Rows 0 N/A N/A
User I/O Wait Time (ms) 0 N/A N/A
Cluster Wait Time (ms) 0 N/A N/A
Application Wait Time (ms) 0 N/A N/A
Concurrency Wait Time (ms) 0 N/A N/A
Invalidations 0 N/A N/A
Version Count 2 N/A N/A
Sharable Mem(KB) 26 N/A N/A
Execution Plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | UPDATE STATEMENT | | | | 2 (100)| |
| 1 | UPDATE | TEST | | | | |
| 2 | TABLE ACCESS BY INDEX ROWID| TEST | 1 | 28 | 2 (0)| 00:00:01 |
| 3 | INDEX RANGE SCAN | TEST_DT_IND | 1 | | 1 (0)| 00:00:01 |
| 4 | TABLE ACCESS BY INDEX ROWID| ACCT | 1 | 26 | 4 (0)| 00:00:01 |
| 5 | INDEX RANGE SCAN | INDX_ACCT_DT | 1 | | 3 (0)| 00:00:01 |
Full SQL Text
SQL ID SQL Text
51szt7b736bm UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL, 0) +
NVL(ACCT_DR_BAL, 0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND PB
RN_ACC_NB = ACCT_ACC_NB(+)) WHERE TEST_BATCH_DT = (:B1 )Your input is highly appreciated.
Thanks for taking your time in answering my question.
RegardsOracle Lover3 wrote:
Dear experts,
awrsqrpt.sql is showing multiple executions plans for a single SQL statement. How is it possible that one SQL statement will have multiple Executions Plans within the same AWR report.If you're using bind variables and you've histograms on your columns which can be created by default in 10g due to the "SIZE AUTO" default "method_opt" parameter of DBMS_STATS.GATHER__STATS it is quite normal that you get different execution plans for the same SQL statement. Depending on the values passed when the statement is hard parsed (this feature is called "bind variable peeking" and enabled by default since 9i) an execution plan is determined and re-used for all further executions of the same "shared" SQL statement.
If now your statement ages out of the shared pool or is invalidated due to some DDL or statistics gathering activity it will be re-parsed and again the values passed in that particular moment will determine the execution plan. If you have skewed data distribution and a histogram in place that reflects that skewness you might get different execution plans depending on the actual values used.
Since this "flip-flop" behaviour can sometimes be counter-productive if you're unlucky and the values used to hard parse the statement leading to a plan that is unsuitable for the majority of values used afterwards, 11g introduced the "adaptive" cursor sharing that attempts to detect such a situation and can automatically re-evaluate the execution plan of the statement.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
Need to run the same query on different databases with the same argument
Hi folks,
I've a script: obj, which has simple stuff, when I execute @obj
this asked me for the object_name
and in return gives me object/s if it exists in this (connected) db.
Now to check in 2 other dbs, I've to disconnect from here and then connect to those dbs and run the same @obj there and give the same argument, e.g., EMP and it'll return the answer.
What is desired ... if not very hard on you :-(
Some thing like @objAll
asked only once object_name ... e.g., I gave EMP
now go to all the 3 dbs and give me the result in ONE spool file only.
What do you think, is this tough, I did something, but it was not involved connecting to different dbs, within the same script, but here we cannot create db links and have to disconnect and connect to the db to get some information.
Please do reply, if my question is not understandable or any ...
Thanks in advance.
Best regards.
Edited by: user8604530 on Jun 27, 2012 1:51 PMAs far as i understand from your question : you cannot create db links ? right..
well another option is to create a shell script , something like this :
vi check.sh
export ORACLE_SID=db1
sqlplus / as sysdba <<EOF
select query comes here;
exit;
EOF
export ORACLE_SID=db2
sqlplus / as sysdba <<EOF
select query comes here;
exit;
EOFchmod 777 check.sh
This does the job for you.. I am unsure how to pass the parameters in sql while running through a sheel script.. but if thats possible you will be able to achieve what you want.
Regards
Kk
Edited by: Kk on Jun 27, 2012 2:44 PM -
Hi Oracle Experts,
I am trying to setup a new GRID Standalone Infrastructure on a previously installed Oracle 11g database.
It runs all fine but when prompts to run the root.sh script it does not allow to proceed as it prompts to overwrite the existing path for /usr/bin/local
well, I google'd and tried with overwrite : Y . It prompted to run the script but it failed ...
Could you please help me on this ..
[root@asm ~]# /u01/app/11.2.0/grid/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/11.2.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/crs/install/roothas.pl
[root@asm ~]# /u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/ crs/install/roothas.pl
2015-03-18 01:42:25: Checking for super user privileges
2015-03-18 01:42:25: User has super user privileges
2015-03-18 01:42:25: Parsing the host name
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
CRS-4664: Node asm successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
acfsroot: ACFS-9320: Missing advmutil.
acfsroot: ACFS-9320: Missing advmutil.bin.
acfsroot: ACFS-9320: Missing fsck.acfs.
acfsroot: ACFS-9320: Missing fsck.acfs.bin.
acfsroot: ACFS-9320: Missing mkfs.acfs.
acfsroot: ACFS-9320: Missing mkfs.acfs.bin.
acfsroot: ACFS-9320: Missing mount.acfs.
acfsroot: ACFS-9320: Missing mount.acfs.bin.
acfsroot: ACFS-9320: Missing acfsdbg.
acfsroot: ACFS-9320: Missing acfsdbg.bin.
acfsroot: ACFS-9320: Missing acfsutil.
acfsroot: ACFS-9320: Missing acfsutil.bin.
acfsroot: ACFS-9301: ADVM/ACFS installation can not proceed:
acfsroot: ACFS-9302: No installation files found at /u01/app/11.2.0/grid/install/usm/EL5/x86_64/2.6.18-8/2.6.18-8.el5xen-x86_64/bin.
asm 2015/03/18 01:43:06 /u01/app/11.2.0/grid/cdata/asm/backup_20150318_014306.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
when I checked for ASM instance its not running ... but just ohasd service and nothing else ..
[root@asm grid]# ps -ef | grep pmon
oracle 5831 1 0 01:15 ? 00:00:01 ora_pmon_db11g1
root 12625 8794 0 02:30 pts/2 00:00:00 grep pmon
[root@asm grid]#
[root@asm grid]#
[root@asm grid]# ps -ef | grep d.bin
oracle 12643 1 5 02:30 ? 00:00:00 /u01/app/11.2.0/grid/bin/ohasd.bin reboot
root 12715 8794 0 02:30 pts/2 00:00:00 grep d.bin
[root@asm grid]#
Could you please help .hi,
The issue not with /usr/bin/local. When you excute root.sh, it will try configure the ASM with New GRID HOME. Issue started, whent tried to start
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting <<=================================================================
acfsroot: ACFS-9320: Missing advmutil.
Please let us know the below details
==> Acfs is configured the servers??
==>acfsutil registry
acfsutil info fs output.
==> With out ASM instance , How the database, CRS STarted ???
==> Please try stop and start the crs.
==> crsctl query crs activeversion output
Regards
Krishnan -
Re: Running the same (Forte) application multiple times -for different
Hi
We had the same problem - how to deploy a number of identical applications, using each their own db.
(for training).
The solution we used is to wrap the entire application into different applications by using a very small
module called KURSUS01, KURSUS02 etc, that did nothing but call the start procedure of the main app.
Then in the dbsession connect, we made a call appname to get the application name, and appended the
first 8 chars to the dbname. Thus our dbnames now points to logicals name: rdbdataKURSUS01, rdbdataKURSUS02 etc.
All this allows us to deploy the identical apps in the same env, or change one version, and run both the old
and new program on the same pc and server at the same time (eg. KURSUS01 and KURSUS02).
I also think this is a kludge - but it works nicely!
Jens Chr
KAD/Denmark
-----Original Message-----
From: Haben, Dirk <[email protected]>
To: 'Soapbox Forte Users' <[email protected]>
Date: 15. januar 1999 09:41
Subject: Running the same (Forte) application multiple times - for different business clients.
Hi All
We have a number of different business clients all willing to use our
application.
The (forte) application is to run on our machines etc for these (business)
clients.
All (business) clients will have their data kept in separate Oracle DBs
(instance).
The problem now is that the entire (forte) application is written using
DBSessions.
Now, depending on what business client needs to be serviced (so to speak) we
need to attach to the right DB - or use the "right" SO.
The two options we can think of are:
Option1:
Programatic change to somehow "know" what (business) client (DB) I'm talking
about and then use the right DB.
Pro:
Only one forte environment to maintain
Can run multiple (business) clients on same PC at the same time
Con:
Requires many program changes
bending O-O rules(?)
can't dynamically name SOs so can it be done at all? (ResourceMGRs maybe?)
Option2:
Use separate environments! One for each business client.
Pro:
More defined separation of app and data,
SLA-easy
Con:
Maintain "n" number of environments
Can only run the application for one environment (business client) at a time
on one PC - Big Negative here!
Not knowing any feasible solution to option 1 (without much code changes and
developer moaning) I would go for option two; as I have already worked on
multi-environment setups on VMS back at the Hydro (hi guys).
I would appreciate any comments from anyone who has solved this problem.
How, Why Pro Con etc.
TIA,
Dirk Haben
Perth, WA
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>Hi
We had the same problem - how to deploy a number of identical applications, using each their own db.
(for training).
The solution we used is to wrap the entire application into different applications by using a very small
module called KURSUS01, KURSUS02 etc, that did nothing but call the start procedure of the main app.
Then in the dbsession connect, we made a call appname to get the application name, and appended the
first 8 chars to the dbname. Thus our dbnames now points to logicals name: rdbdataKURSUS01, rdbdataKURSUS02 etc.
All this allows us to deploy the identical apps in the same env, or change one version, and run both the old
and new program on the same pc and server at the same time (eg. KURSUS01 and KURSUS02).
I also think this is a kludge - but it works nicely!
Jens Chr
KAD/Denmark
-----Original Message-----
From: Haben, Dirk <[email protected]>
To: 'Soapbox Forte Users' <[email protected]>
Date: 15. januar 1999 09:41
Subject: Running the same (Forte) application multiple times - for different business clients.
Hi All
We have a number of different business clients all willing to use our
application.
The (forte) application is to run on our machines etc for these (business)
clients.
All (business) clients will have their data kept in separate Oracle DBs
(instance).
The problem now is that the entire (forte) application is written using
DBSessions.
Now, depending on what business client needs to be serviced (so to speak) we
need to attach to the right DB - or use the "right" SO.
The two options we can think of are:
Option1:
Programatic change to somehow "know" what (business) client (DB) I'm talking
about and then use the right DB.
Pro:
Only one forte environment to maintain
Can run multiple (business) clients on same PC at the same time
Con:
Requires many program changes
bending O-O rules(?)
can't dynamically name SOs so can it be done at all? (ResourceMGRs maybe?)
Option2:
Use separate environments! One for each business client.
Pro:
More defined separation of app and data,
SLA-easy
Con:
Maintain "n" number of environments
Can only run the application for one environment (business client) at a time
on one PC - Big Negative here!
Not knowing any feasible solution to option 1 (without much code changes and
developer moaning) I would go for option two; as I have already worked on
multi-environment setups on VMS back at the Hydro (hi guys).
I would appreciate any comments from anyone who has solved this problem.
How, Why Pro Con etc.
TIA,
Dirk Haben
Perth, WA
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/> -
Oracle dblink to sql server, accessing multiple database on same sql server under one dblink
Hi, we have successfully managed to set up an Oracle dblink over to sql server and retrieve data.
The sql server user were using via the dblink has access to more than one database on the same sql server
But the question is how in oracle (if at all possible) do you prefix the sql statement to access this ?
Eg:
Sqlserver_prod has user sqlserver_user which appears to be set up as default database on sqlserver_db1
But we have select access to sqlserver_db2
all work fine as sqlserver_user
select * from table_fromdb1
select * from dbo.table_fromdb1
select * from sqlserver_db1.dbo.table_fromdb1
as does
select * from sqlserver_db2.dbo.table_fromdb2
over in Oracle
Oracle_db has dblink sqlserver_prod.world connecting as sqlserver_user
all working fine
select * from "table_fromdb1"@sqlserver_prod
select * from "dbo"."table_fromdb1"@sqlserver_prod
but how (if at all possible) do I access from oracle
sqlserver_db2.dbo.table_fromdb2
without having to create a new sqlserver_db2_user referenced in a new dblink
if oracle to oracle would be
select * from remote_oracle_schema.table@remote_oracle_dbHi, ok cheers, I see, original gateway was connecting purely at host_name level
HS_FDS_CONNECT_INFO=sqlserver_host
Planning to amend this to be
HS_FDS_CONNECT_INFO=sqlserver_host//sqlserver_db1
With exisiting dblink
And to create new gateway
HS_FDS_CONNECT_INFO=sqlserver_host//sqlserver_db2
With new exisitng dblink,will see how we get on
Cheers again -
Combine multiple web services with the same SQL query into one
Hello,
I would like to ask a question regarding combine multiple similar web services into one. Can you please tell me if it is possible to combine 4-5 web services into one since they built on the same SQL query with 5 different criterias or condition so that the user can enter any of the 5 criterias to populate the data on the form instead of having 5 different web services?
e.g Query: Select appName, permit#, address, phone, description, type, section, from table where appName = can be 'appName, permit#, address, phone, or description' to populate the rest of the data to the form.
Does any one have ever done some thing like this in Workbench ES? If so please assist. I know it can be easier to build it in Visual Basic, C#, or dot.net but the requirement is to build it in workbench ES.
Thanks in advance,
Han DaoIf you are querying for Name, PhoneNumber, and SSN, and you queried for all people with a phone number that started with 867, you would have a potentially long list of people. So to keep track of all of the people, we store each record in XML complex elements. The root node is just any name you want, and the repeating element is the complex element name.
So using the example from above, I'm going to specify the following:
Root Node: Result
Repeating Element: Person
So now when I do a query, my resultXML will look like:
<Result>
<Person>
<Name>Alex</Name>
<PhoneNumber>867-5309</PhoneNumber>
<SSN>111-11-1111</SSN>
</Person>
</Result>
If your query returned multiple results (like ours would probably), it would look like:
<Result>
<Person>
<Name>Alex</Name>
<PhoneNumber>867-5309</PhoneNumber>
<SSN>111-11-1111</SSN>
</Person>
<Person>
<Name>Han</Name>
<PhoneNumber>867-2169</PhoneNumber>
<SSN>222-22-2222</SSN>
</Person>
</Result>
So Result and Person is just to give a little bit of structure to the xml result (containers really). So you can name them whatever is helpful for you.
The column name mappings map the query columns (Name, PhoneNumber, SSN) to some node in the XML (Name, PhoneNumber, SSN). So you don't need to specify which field maps to what in the form. Just copy the column names to the element name so you have a 1-to-1 naming. If you want to manipulate the XML a bit though, you could do:
Column Name Element
Name YourName
PhoneNumber Phone
SSN Secret
which would then make your xml look like:
<Result>
<Person>
<YourName>Alex</YourName>
<Phone>867-5309</Phone>
<Secret>111-11-1111</Secret>
</Person>
</Result>
It lets you change the XML element names to whatever you want. Otherwise by default they take on their column names.
In your form, you could bind to the WSDL through the Data Connections pane and point it to your web service. This will then create form elements that you can just drag and drop allowing you to have the information available when the service gets ran. Once the service is called, you can modify the field's data to get whatever information you need in order to populate other form fields.
If that is too confusing, feel free to send me your form (e-mail is on profile page) and I'll add comments to it to show you how to set up the form for the web service call (and also give me the link to your webservice) -
Running the same code multiple times with different paramters automatica​lly
Hi guys,
I want to run the same code multiple times with different paramters automatically. Actually, I am doing some sample scans which takes around 2 hours n then I have to be there to change the paramters and run it again. Mostly I do use folowing paramters only
X_Intial, X_Final, X-StepSize
Y_Intial, Y_Final, Y-StepSize
Thanks,
DushyantAll you have to di is put all of the parameters for each run into a cluster array. Surround your main program with a for loop and wire the cluster array through the for loop. A for loop will autoindex an input array so inside the for loop you just have to unbundle the cluster to get the parameters for each run.
Message Edited by Dennis Knutson on 07-13-2006 07:50 AM
Attachments:
Cluster Array.JPG 9 KB -
How do I run the same process on multiple CPUs of a processor set?
Hi,
I am working on UltraSPARC T1 Processor. My development environment is SunStudio 12 running on Sun Solaris 10 OS.
I want to run the same process concurrently on 4 hardware threads that belong to one core.
I used pset_create() for creation of the processor set.
Later I assigned 4 processors (that belong to one core) using pset_assign().
I used fork() to create a child process and used execv() to assign a new process.
I used pset_bind() to bind this new process to processor set created earlier.
When we are executing the program we observe that the process is running in only the first processor (hardware thread) of the assigned processor set.
How do we make all the processors of the processor set run the same process?
Thanks in advance.
Nesa RaniHi Mark,
With this communication based on CAN whilst all of the data is available on the network arbitration IDs are still used to address the individual PCs so I believe you will need to explicitly send the data to each PC to get the data across all three. The other option would be to have one PC acting as a data server making the data available through a network interface such as shared variables. This may be simpler to implement and also easier should you need to scale it up.
Regards,
James Mc
========
CLA and cRIO Fanatic
wiresmithtech.com/blog -
DDLIMP utility is failing while running the DDL_OLTP.ctl script for Siebel
DDLIMP utility is failing while running the DDL_OLTP.ctl script for Siebel source on DB2.
Below is the the log details:
2021 2012-11-08 03:23:46 2012-11-08 03:25:56 -0700 0000002a 001 003f 0001 09 ddlimp 604 736 C:\OBIA\Upgrade\CTLFiles\DDL_.log
ContextInit ContextInit 0 0 2012-11-08 03:23:46 Message Facility failed to init. Siebel Root: C:\DAC\client\utilities
Trace Trace 3 0 2012-11-08 03:23:46 Siebel Enterprise Applications ODBC DDL Import Utility, Version 7.7 [18030] ENU
Trace Trace 3 0 2012-11-08 03:23:46 Copyright (c) 2001 Siebel Systems, Inc. All rights reserved.
Trace Trace 3 0 2012-11-08 03:23:46
This software is the property of Siebel Systems, Inc., 2207 Bridgepointe Parkway,
San Mateo, CA 94404.
User agrees that any use of this software is governed by: (1) the applicable
user limitations and other terms and conditions of the license agreement which
has been entered into with Siebel Systems or its authorized distributors; and
(2) the proprietary and restricted rights notices included in this software.
WARNING: THIS COMPUTER PROGRAM IS PROTECTED BY U.S. AND INTERNATIONAL LAW.
UNAUTHORIZED REPRODUCTION, DISTRIBUTION OR USE OF THIS PROGRAM, OR ANY PORTION
OF IT, MAY RESULT IN SEVERE CIVIL AND CRIMINAL PENALTIES, AND WILL BE
PROSECUTED TO THE MAXIMUM EXTENT POSSIBLE UNDER THE LAW.
If you have received this software in error, please notify Siebel Systems
immediately at (650) 295-5000.
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:23:46 ddlimp /U SIEBEL /P ***** /C siebel /G SSE_ROLE /F C:\OBIA\Upgrade\CTLFiles\DDL_OLTP.CTL /L C:\OBIA\Upgrade\CTLFiles\DDL_
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:23:46
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:23:46 Connecting to the database...
DBCLog DBCLogError 1 0 2012-11-08 03:23:52 SQL Warning, SQL State 01004, 0, [DataDirect][ODBC DB2 Wire Protocol driver]String data, right truncated.
DBCLog DBCLogError 1 0 2012-11-08 03:23:52 SQL Warning, SQL State , 40042692, CLog DBCLogError 1 0 2012-11-08 03:23:52 SQL Warning, SQL State 01004, 0, [DataDirect][ODBC DB2 Wire Protocol driver]String data, right truncated.
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:23:52 Connected.
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:23:52
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:23:52 Reading tables and indexes from DDL file...
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:23:52 Read 522 tables and 1084 indexes from DDL file...
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:23:52
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:23:52 Reading existing schema...
SARMLog SARMInformation 3 0 2012-11-08 03:23:52 SARM is OFF -change param SARMLevel to enable
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56 Read 0 tablespaces, 6137 tables and 24846 indexes from existing schema...
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56 Running SQL statements against the database...
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56 Merging table S_ETL_COSTLST ...
SQLError Statement 0 0 2012-11-08 03:25:56 SQL Statement:
alter table S_ETL_COSTLST modify
CONFLICT_ID varchar(15)
DBCLog DBCLogError 1 0 2012-11-08 03:25:56 [DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for Windows, UNIX, and Linux]ILLEGAL SYMBOL modify; VALID SYMBOLS ARE table S_ETL_COSTLST. ADD
SQLError Statement 0 0 2012-11-08 03:25:56 SQL Statement:
alter table S_ETL_COSTLST modify
CONFLICT_ID varchar(15)
DBCLog DBCLogError 1 0 2012-11-08 03:25:56 [DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for Windows, UNIX, and Linux]An error occurred during implicit system action type '2'. Information returned for the error includes SQLCODE '-104', SQLSTATE '42601' and message tokens 'modify|table S_ETL_COSTLST|ADD'.
SQLError Statement 0 0 2012-11-08 03:25:56 SQL Statement:
alter table S_ETL_COSTLST modify
CONFLICT_ID default '0'
DBCLog DBCLogError 1 0 2012-11-08 03:25:56 [DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for Windows, UNIX, and Linux]ILLEGAL SYMBOL modify; VALID SYMBOLS ARE table S_ETL_COSTLST. ADD
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56 37000: [DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for Windows, UNIX, and Linux]ILLEGAL SYMBOL modify; VALID SYMBOLS ARE table S_ETL_COSTLST. ADD
SQLError Statement 0 0 2012-11-08 03:25:56 SQL Statement:
alter table S_ETL_COSTLST modify
CONFLICT_ID default '0'
DBCLog DBCLogError 1 0 2012-11-08 03:25:56 [DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for Windows, UNIX, and Linux]An error occurred during implicit system action type '2'. Information returned for the error includes SQLCODE '-104', SQLSTATE '42601' and message tokens 'modify|table S_ETL_COSTLST|ADD'.
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56 56098: [DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for Windows, UNIX, and Linux]An error occurred during implicit system action type '2'. Information returned for the error includes SQLCODE '-104', SQLSTATE '42601' and message tokens 'modify|table S_ETL_COSTLST|ADD'.
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56 alter table S_ETL_COSTLST modify
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56 CONFLICT_ID default '0'
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56 ;
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56 writeExecDDL error (UTLOdbcExecDirectDDL pDDLSql).
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56 writeExecDDL error (UTLDbDdlColModify).
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56 Error in MainFunction (UTLDbDdlDbMerge).
SQLDBUtilityLog SQLDBUtilityLog 3 0 2012-11-08 03:25:56 Error in Main function...
GenericLog GenericError 1 0 2012-11-08 03:25:56 (logapi.cpp (167) err=1 sys=126) SBL-GEN-00001: (logapi.cpp: 167) error code = 1, system error = 126, msg1 = (null), msg2 = (null), msg3 = (null), msg4 = (null)If you run DAC on a 64-bit windows Operating System, you must create the ODBC data source using the ODBC Administrator tool in %windir%\SysWOW64\odbcad32.exe. for creating the data warehouse tables.
If helps pls mark -
Explain plan changing for the same sql
Hi All,
In a E Business suite application, we have the 10.2.0.4 Database.
One of the program is running a select stmt which is using different explain plan one in a month which is causing issue in the program running for longer time.
Ex : When it uses the index A, it is running fine. When it uses the index B, it is running for longer time.
Can you please advice on the possible reasons for the same sql to choose index B instead of index A some times.
Thanks,
RakeshIt could be that the SQL is question got aged out of the shared pool and when it came to be reparsed - the values in the bind variables were such that access via index b was more attractive than access via index a.
Could you please send the query and the good and bad plans and all other information that might help diagnose the problem..
Note: we had a similiar case where plans suddenly changed for no apperant reason (on 10.2.0.2) - we found that under certain circumstances the optimizer would not peek into the bind varaibles to derive the execution path.
Maybe you are looking for
-
Individual Account Creation in IC_AGENT business role.
Hi, After system got upgraded from 6.0 to EHP1, marketing attributes are not working as expected. When i create an Individual Account type in ZIC_AGENT business role, it gets created successfully but its marketing attributes are not getting set when
-
I'd like to know how I update my apple iphone 3G with ios 4.1.2 to ios 6? Thanks, LabRat1.(?!)
-
How do I restore "staff" access privileges?
Safari, mail, software update and backing up my ipad are not behaving properly. I think that's because I screwed up access privileges on some files, trying to allow access to two user logins. I'm trying to restore them, by copying the privileges I se
-
Setting Reason combo in crmd_order
Hi All, I am passing a parameter IT_SERVICE_OS to function module 'CRM_ORDER_MAINTAIN' in order to set the reason for status i.e. the result combo. While creating the order I have set mode as A, that works. But, while changing the order I have s
-
Problem with FCP with my new Betacam SP
HI, ill try to make this as simple as possible.. I have a new (used) SONY betacam SP UV 1800 and im having issues with the input true my KONA LHI Capture card and FCP. Using component and XLR outputs of the beta in my KONA with 525 29.97 10 Bit setti