Search Results

Search found 131 results on 6 pages for 'sqlplus'.

Page 1/6 | 1 2 3 4 5 6  | Next Page >

  • Executing Oracle SQLPlus in a Powershell Invoke-Command statement against a remote machine

    - by Scott Muc
    We have a basic powershell script that attempts to execute SQLPlus.exe on a remote machine. The remote does not have Oracle Instant client installed, but we have bundled all the necesary dlls in a remote folder. For example we have sqlplus.exe and dependencies in the directory C:\temp\oracle. If I navigate to that path on the remote server and execute sqlplus.exe it runs just fine. I get the prompt for username. If I go: Invoke-Command -comp remote.machine.host -ScriptBlock { C:\temp\oracle\sqplus.exe } I get the following: Error 57 initializing SQL*Plus + CategoryInfo : NotSpecified: (Error 57 initializing SQL*Plus:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError Error loading message shared library Thinking that it's potentially a PATH issue I tried the following: Invoke-Command -comp remote.machine.host -ScriptBlock { $env:ORACLE_HOME= "C:\temp\oracle"; $env:PATH = "$env:ORACLE_HOME; C:\temp\oracle\sqlplus.exe } This had the same result. The error code is not very helpful and is extremely frustrating since it does work when I log on to the machine. What is powershell remoting doing that's making this not work?

    Read the article

  • Executing Oracle SQLPlus in a Powershell Invoke-Command statement against a remote machine

    - by Scott Muc
    We have a basic powershell script that attempts to execute SQLPlus.exe on a remote machine. The remote does not have Oracle Instant client installed, but we have bundled all the necesary dlls in a remote folder. For example we have sqlplus.exe and dependencies in the directory C:\temp\oracle. If I navigate to that path on the remote server and execute sqlplus.exe it runs just fine. I get the prompt for username. If I go: Invoke-Command -comp remote.machine.host -ScriptBlock { C:\temp\oracle\sqplus.exe } I get the following: Error 57 initializing SQL*Plus + CategoryInfo : NotSpecified: (Error 57 initializing SQL*Plus:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError Error loading message shared library Thinking that it's potentially a PATH issue I tried the following: Invoke-Command -comp remote.machine.host -ScriptBlock { $env:ORACLE_HOME= "C:\temp\oracle"; $env:PATH = "$env:ORACLE_HOME; C:\temp\oracle\sqlplus.exe } This had the same result. The error code is not very helpful and is extremely frustrating since it does work when I log on to the machine. What is powershell remoting doing that's making this not work?

    Read the article

  • Using the full tty real estate with sqlplus

    - by katsumii
    I believe 'rlwrap' is widely used for adding 'sqlplus' the history function and command line editing. 'rlwrap' has other functions and here's my kludgy alias to force sqlplus to use the full real estate of yourtty. Be it PuTTy session from Windows or Linux gnome terminal. $ declare -f sqlplus sqlplus () { PRE_TEXT=$(resize |sed -n "1s/COLUMNS=/set linesize /p;2s/LINES=/set pagesize /p"|while read line; do printf "%s \ " "$line";done); if [ -z "$1" ]; then rlwrap -m -P "$PRE_TEXT" sqlplus /nolog; else if ! echo $1 | grep '^-' > /dev/null; then rlwrap -m -P "$PRE_TEXT connect $*" sqlplus /nolog; else command sqlplus $*; fi; fi }

    Read the article

  • Oracle SQLPlus: How to display the output of a sqlplus command without having to first issue the spo

    - by ziggy
    Is there a way to display the output of a sqlplus command without having to first issue the spool off command? I am spooling the results of a sqlplus session to a file while at the same time tailing the file. The reason for this is that for table with very long rows the format is easier to look at from a file. The problem is to see the output i have to issue the spool off command everytime i run a command in sqlplus. Can i configure sqlplus so that after i have issued the spool command all the output is viewable straight away on the file. (Formating the way the rows are displayed on the screen is not an option. ) THanks

    Read the article

  • bash-like features in sqlplus, rman and other Oracle command line tools

    - by Gilles Haro
    As far as I can remember, I have always been complaining about the lack of “recall last command” from within sqlplus. Such a basic thing, available in any bash shell or windows cmd terminal, remains missing with Oracle command lines tools. Thanks to davidw who published a post in the french blog EASYTEAM, it is now possible to use a simple rpm package rlwrap to enhance sqlplus, dgmgrl, rman, … tools and give them bash “recall/completion” capabilities. I installed it in a few minutes and I am already wondering how can people work without it. The steps are here : Get the rpm file from sites like RPM PBone. AS root, install the package rpm -ivh rlwrap-0.37-1.el5.x86_64.rpm As Oracle, create a dictionnary file (for autocompletion) . This file is made of a series of words to be used for autocompletion. Put in it the list of dictionary tables, the list of sql commands, the list of sqlplus commands… whatever your like. And use the <tab> key as you would in a bash shell. $HOME/.oracle_keywords Create an alias for sqlplus alias sqlplus='/usr/bin/rlwrap -if $HOME/.oracle_keywords $ORACLE_HOME/bin/sqlplus' And enjoy it !!! Thank you DavidW. Gilles Haro Technical Expert - Core Technology, Oracle Consulting  Technorati Tags: rlwrap bash sqlplus

    Read the article

  • Windows: starting sqlplus in new window from cygwin bash

    - by katsumii
    When I start sqlplus, more often than not, I want it to start in new window,whether it be on Linux/Solaris GNOME or Windows.I seldom use GNOME so I never bothered to figure out how.On Windows, one can use Windows menu or Win+R "Run" dialog but I prefer usingbash. Because, this way, I can keep the history in ~/.bash_history file.There are 2 ways. Using cmd.exe or cygstart.For example, to start default sqlplus.exe to connect to default local instance. $ cmd /c "start sqlplus sys/oracle as sysdba" 2nd example. To start sqlplus in 2nd Oracle home and to connect to non-default local instance. $ ORACLE_SID=orcl cygstart /cygdrive/g/app/product/11.2.0.3/dbhome_1/BIN/sqlplus scott I hope this tip helps reducing your DBA time.

    Read the article

  • sqlplus and Ruby

    - by Niklas
    Hi, Anybody knows how to use sqlplus in ruby? I need to do something like this: system("sqlplus username/pwd@database filename.sql" Thx /Niklas

    Read the article

  • sqlplus: Running "set lines" and "set pagesize" automatially

    - by katsumii
    This is a followup to my previous entry. Using the full tty real estate with sqlplus (INOUE Katsumi @ Tokyo) 'rlwrap' is widely used for adding 'sqlplus' the history function and command line editing. Here's another but again kludgy implementation. First this is the alias. alias sqlplus="rlwrap -z ~/sqlplus.filter sqlplus" And this is the file content. #!/usr/bin/env perl use lib ($ENV{RLWRAP_FILTERDIR} or "."); use RlwrapFilter; use POSIX qw(:signal_h); use strict; my $filter = new RlwrapFilter; $filter -> prompt_handler(\&prompt); sigprocmask(SIG_UNBLOCK, POSIX::SigSet->new(28)); $SIG{WINCH} = 'winchHandler'; $filter -> run; sub winchHandler { $filter -> input_handler(\&input); sigprocmask(SIG_UNBLOCK, POSIX::SigSet->new(28)); $SIG{WINCH} = 'winchHandler'; $filter -> run; } sub input { $filter -> input_handler(undef); return `resize |sed -n "1s/COLUMNS=/set linesize /p;2s/LINES=/set pagesize /p"` . $_; } sub prompt { if ($_ =~ "SQL> ") { $filter -> input_handler(\&input); $filter -> prompt_handler(undef); } return $_; } I hope I can compare these 2 implementations after testing more and getting some feedbacks.

    Read the article

  • Problem running oracle script from command line using sqlplus

    - by Charlie
    I'm having a problem trying to run my sql script into oracle using sqlplus. The script just populates some dummy data: DECLARE role1Id NUMBER; user1Id NUMBER; role2Id NUMBER; user2Id NUMBER; role3Id NUMBER; user3Id NUMBER; perm1Id NUMBER; perm2Id NUMBER; perm3Id NUMBER; perm4Id NUMBER; perm5Id NUMBER; BEGIN INSERT INTO PB_USER(USER_ID,USER_NAME, USER_EMAIL, USER_ACTIVEYN) VALUES(PB_USER_ID_SEQ.nextval, 'RoleDataManagerTests_Username', '[email protected]',' '); INSERT INTO ROLES(ROLE_ID, ROLE_NAME) VALUES(PB_ROLE_ID_SEQ.nextval, 'Test role 1'); INSERT INTO ROLES(ROLE_ID, ROLE_NAME) VALUES(PB_ROLE_ID_SEQ.nextval, 'Test role 2'); INSERT INTO ROLES(ROLE_ID, ROLE_NAME) VALUES(PB_ROLE_ID_SEQ.nextval, 'Test role 3'); SELECT ROLE_ID INTO role1Id FROM ROLES WHERE ROLE_NAME = 'Test role 1'; SELECT USER_ID INTO user1Id FROM PB_USER WHERE USER_NAME = 'RoleDataManagerTests_Username'; INSERT INTO USERS_ROLES(USER_ID, ROLE_ID) VALUES(user1Id, role1Id); SELECT ROLE_ID INTO role2Id FROM ROLES WHERE ROLE_NAME = 'Test role 2'; SELECT USER_ID INTO user2Id FROM PB_USER WHERE USER_NAME = 'RoleDataManagerTests_Username'; INSERT INTO USERS_ROLES(USER_ID, ROLE_ID) VALUES(user2Id, role2Id); SELECT ROLE_ID INTO role3Id FROM ROLES WHERE ROLE_NAME = 'Test role 3'; SELECT USER_ID INTO user3Id FROM PB_USER WHERE USER_NAME = 'RoleDataManagerTests_Username'; INSERT INTO USERS_ROLES(USER_ID, ROLE_ID) VALUES(user3Id, role3Id); INSERT INTO PERMISSIONS(PERMISSION_ID, KEY, DESCRIPTION) VALUES (PB_PERMISSION_ID_SEQ.nextval, 'perm1', 'permission 1'); INSERT INTO PERMISSIONS(PERMISSION_ID, KEY, DESCRIPTION) VALUES (PB_PERMISSION_ID_SEQ.nextval, 'perm2', 'permission 2'); INSERT INTO PERMISSIONS(PERMISSION_ID, KEY, DESCRIPTION) VALUES (PB_PERMISSION_ID_SEQ.nextval, 'perm3', 'permission 3'); INSERT INTO PERMISSIONS(PERMISSION_ID, KEY, DESCRIPTION) VALUES (PB_PERMISSION_ID_SEQ.nextval, 'perm4', 'permission 4'); INSERT INTO PERMISSIONS(PERMISSION_ID, KEY, DESCRIPTION) VALUES (PB_PERMISSION_ID_SEQ.nextval, 'perm5', 'permission 5'); SELECT PERMISSION_ID INTO perm1Id FROM PERMISSIONS WHERE KEY = 'perm1'; SELECT PERMISSION_ID INTO perm2Id FROM PERMISSIONS WHERE KEY = 'perm2'; SELECT PERMISSION_ID INTO perm3Id FROM PERMISSIONS WHERE KEY = 'perm3'; SELECT PERMISSION_ID INTO perm4Id FROM PERMISSIONS WHERE KEY = 'perm4'; SELECT PERMISSION_ID INTO perm5Id FROM PERMISSIONS WHERE KEY = 'perm5'; INSERT INTO ROLES_PERMISSIONS(ROLE_ID, PERMISSION_ID) VALUES(role1Id, perm1Id); INSERT INTO ROLES_PERMISSIONS(ROLE_ID, PERMISSION_ID) VALUES(role1Id, perm2Id); INSERT INTO ROLES_PERMISSIONS(ROLE_ID, PERMISSION_ID) VALUES(role1Id, perm3Id); INSERT INTO ROLES_PERMISSIONS(ROLE_ID, PERMISSION_ID) VALUES(role2Id, perm3Id); INSERT INTO ROLES_PERMISSIONS(ROLE_ID, PERMISSION_ID) VALUES(role3Id, perm4Id); INSERT INTO ROLES_PERMISSIONS(ROLE_ID, PERMISSION_ID) VALUES(role3Id, perm5Id); END; / My script works fine when I run it using Oracle SQL Developer but when I use the sqlplus command line tool this is what's outputted and then it just hangs: SQL*Plus: Release 11.1.0.7.0 - Production on Tue May 11 09:49:34 2010 Copyright (c) 1982, 2008, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine and Real Application Testing options I'm running the tool using this command line, which works fine for other scripts: sqlplus username/password@server/dbname @Setup.sql Any ideas? Thanks.

    Read the article

  • SQLPlus - spooling to multiple files from PL/SQL blocks

    - by FrustratedWithFormsDesigner
    I have a query that returns a lot of data into a CSV file. So much, in fact, that Excel can't open it - there are too many rows. Is there a way to control spool to spool to a new file everytime 65000 rows have been processed? Ideally, I'd like to have my output in files named in sequence, such as large_data_1.csv, large_data_2.csv, large_data_3.csv, etc... I could use dbms_output in a PL/SQL block to control how many rows are output, but then how would I switch files, as spool does not seem to be accessible from PL/SQL blocks? (Oracle 10g)

    Read the article

  • sqlplus remove \r \n \t from spool

    - by Tom
    Hi all, Is there any sql*plus command to remove \r \n and\t from the result set that's going out to the spool file? That is, "trim" every record? We've used set trim on in the past, but it doesn't seem to bue what we need right now. I'm trying to avoid calling oracle's translate, chr functions in the sql query. For example, If my query returns this |DATA| |\n \t\t\t\t\t thisistheactualdata \t\t\t\t\t\t\n| I'd like to keep this |DATA| |thisistheactualdata| Thanks in advance.

    Read the article

  • How can I return the number of rows affected in sqlplus to a shell script?

    - by jessica
    Here is my shell script: # Deletes data from the 'sample' table starting August 30, 2011. # This is done in stages with a 7 second break every # 2 seconds or so to free up the database for other users. # The message "Done." will be printed when there are # no database entries left to delete. user="*****" pass="*****" while(true); do starttime=`date +%s` while [[ $((`date +%s` - $starttime)) -lt 2 ]]; do sqlplus $user/$pass@//blabla <<EOF whenever sqlerror exit 1 delete from sample where sampletime >= to_date('08-30-2011','mm-dd-yyyy') and rownum <= 2; commit; EOF rows = ??? if [ $rows -eq 0 ] ; then echo "Done." exit 0; fi done sleep 7 done If there is no way to get the number of rows, maybe I can use an error code returned by sqlplus to figure out when to end the script? Any thoughts? Thank you!

    Read the article

  • Display query results like \G in MySQL when using Oracle / sqlplus?

    - by jed79
    In MySQL, you can use \G to run a query: select * from mytable\G And your results will be displayed in an inverted table, kinda like this: *************************** 1. row *************************** column1: 12345 another_colum: another value yet_another: ABCD *************************** 2. row *************************** column1: 238479 another_colum: another value again yet_another: WXYZ Is there any way to get a similar format using Oracle / sqlplus?

    Read the article

  • display sql syntax in Oracle's sqlplus?

    - by user1375963
    What is in Oracle's sqlplus equivalent of Linux's man or --help ? When I'm in sqlplus and type help index, I get some commands displayed, but there is no way to get specific sql syntax. For example if I type 'help select' I get: SP2-0172 No HELP matching this tiopic was found. Of course, I would like to get all available options for select command. How can I get info or sql syntax while I'm at sql prompt ? Thanks

    Read the article

  • Oracle SqlPlus Command Line: There's a way to concatenate set options?

    - by Lex
    Heya, I need to set up some SET options in Oracle SQLplus command line program each time I use it, such as SET HEADING OFF and the likes to beautify my results. I found that I always have to input each line separately so Set different options and this is becoming annoying since I need to access it many times a day. I found that there's no way to separate different SET commands with semicolumns because it doesn't accept it: SET HEADING OFF; SET LINESIZE 100; returns an error A solution could be adding them to a control script and create a shell alias, but I know control scripts execute and then exit and don't return you control over the command line. So, anybody knows another solution? Or am I missing something?

    Read the article

  • Running pl/sql in Korn Shell(AIX)

    - by learner135
    I have a file to execute in Ksh written by someone. It has a set of commands to execute in sqlplus. It starts with, sqlplus -s $UP <<- END followed by a set of ddl commands such as create,drop,etc., When I execute the file in the shell, I get the error in the starting line quoted above. I understand "-s" starts the sqlplus in silent mode and $UP is the connection string with username/password. But I couldn't make heads or tails of "<<- END" part(Many sites from google says input redirection is "<<" not "<<-"). So I presumed the error must be in that part and removed it from the file. Now it reads, sqlplus -s $UP But once I execute the file, It waits for input from the shell, instead of reading the rest of the lines from the file. How would I make sqlplus to execute the ddl commands in the rest of the file?. Thanks in advance.

    Read the article

  • Connect using sqlplus to db server through multiple tunnels

    - by Samuel Lindblom
    I would like to create an SQL Developer connection to a database through a couple of tunnels. The steps right now are: Connect to server A - connect to server B - run sqlplus against tnsname on a server that I do not have ssh access to. Is there an easy way of using SQL Developer instead of sqlplus? I have read through 20 articles on the subject and still have no idea how to actually make the connection. I understand that you can chain ssh -L commands to get the server connection, but I don't know how to use that connection in SQL Developer.

    Read the article

  • passing value of sqlplus variable from one script to another.

    - by FrustratedWithFormsDesigner
    I have a script that gets the current time, and must pass it to another script. variable v_s_time varchar2(30); exec :v_s_time := to_char(sysdate,'YYYY-MM-DD HH:MI:SS AM'); --Lots of unrelated code here variable v_e_time varchar2(30); exec :v_e_time := to_char(sysdate,'YYYY-MM-DD HH:MI:SS AM'); @"test report script.sql" :v_s_time :v_e_time; --yes, I also tried ":v_s_time", didn't seem to do anything. This does not work, it seems that the literal :v_s_time is passed to the script, instead of what I want: "2010-04-14 05:50:01 PM". To execute this manually, I could enter: @"test report script.sql" "2010-04-14 05:50:01 PM" "2010-04-14 05:57:34 PM" I found that what does work is this: define v_s_time = "2010-04-14 05:50:01 PM" --Lots of unrelated code here define v_e_time = "2010-04-14 05:57:34 PM" @"test report script.sql" "&&v_s_time" "&&v_e_time"; But it is unrealistic to hardcode the datetimes. Anyone know how to handle this? (Oracle 10g)

    Read the article

  • SqlPlus on mac osx 10.6 doesn't work

    - by lesce
    When i try to run this #sqlplus system@orcl it gives me this error SQL*Plus: Release 10.1.0.3.0 - Production on Tue Apr 20 02:24:41 2010 Copyright (c) 1982, 2004, Oracle. All rights reserved. Enter password: ERROR: ORA-12154: TNS:could not resolve the connect identifier specified the oracle server is working , I can connect through SQLDeveloper My .profile looks like this export PATH=/opt/local/bin:/opt/local/sbin:$PATH # Setting PATH for Python 3.1 # The orginal version is saved in .profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/3.1/bin:${PATH}" DYLD_LIBRARY_PATH=/Users/lesce/instantclient export TNS_ADMIN=/Users/lesce/instantclient export ORACLE_SID="orcl" export DYLD_LIBRARY_PATH export PATH=$PATH:/Users/lesce/instantclient tnsnames.ora ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) listener.ora SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /Users/oracle/oracle/product/10.2.0/db_1) (PROGRAM = extproc) ) (SID_DESC = (SID_NAME = orcl) (ORACLE_HOME = /Users/oracle/oracle/product/10.2.0/db_1) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)) ) ) My SqlDeveloper configuration username : sys role : sysdba connection type : basic hostname : localhost port : 1521 sid : orcl

    Read the article

  • I can't create a view in oracle database using sqlplus (insufficient privileges)

    - by Nubkadiya
    I'm running this SQL: CREATE VIEW showMembersInfo(MemberID,Fname,Lname,Address,DOB,Telephone,NIC,Email,WorkplaceID,WorkName,WorkAddress,WorkTelephone,StartingDate,ExpiryDate,Amount,WitnessID,WitName,WitAddress,WitNIC,WitEmail,WitTelephone) AS SELECT mem.MemberID,mem.FirstName,mem.LastName,mem.Address,mem.DOB,mem.Telephone,mem.NIC,mem.Email, wrk.WorkPlaceID,wrk.Name,wrk.Address,wrk.Telephone, anl.StartingDate,anl.ExpiryDate,anl.Amount, wit.WitnessID,wit.Name,wit.Address,wit.NIC,wit.Email,wit.Telephone FROM Member mem, WorkPlace wrk, AnnualFees anl, Witness wit WHERE mem.MemberID = anl.MemberID AND mem.WorkPlaceID = work.WorkPlaceID AND mem.WitnessID = wit.WitnessID When I try to create the view I get this error: ERROR at line 1: ORA-01031: insufficient privileges Why is that? I'm logged in to sqlplus using sysman

    Read the article

1 2 3 4 5 6  | Next Page >