SQLPlus command line history
Hello!Is it possible to have a history of orders (navigated by keyboard keys cursor UP/DOWN) in SQLPlus?
On Linux/Unix, install the package rlwrap and launch sqlplus as: rlwrap sqlplus user@your_database
Tags: Database
Similar Questions
-
PL/SQL in Sql Developer 4 script, works not sqlplus command line.
Hello guys, Xev here.
I hope I meet new people there into that in this space. I hope this is the appropriate space to ask this, I see that others have asked about sqlplus and they where permitted to post...
I have a pl/sql script that runs in sql developer 4, but the exact same script will not run in the sqlplus command line?
When I run the script, it gives me this, but as you can see with this script that works fine with sql developer, he is not running sqlplus command line.
ERROR at line 3:
ORA-06550: line 3, column 28:
PLS-00201: identifier 'DYNAMIC_COUNTS' must be declared.
ORA-06550: line 3, column 4:
PL/SQL: Ignored Element
ORA-06550: line 39, column 17:
PLS-00487: Invalid reference to variable 'DYNAMIC_COUNTS % ROWTYPE.
ORA-06550: line 39, column 1:
PL/SQL: Statement ignored
ORA-06550: line 41, column 17:
PLS-00487: Invalid reference to variable 'DYNAMIC_COUNTS % ROWTYPE.
ORA-06550: line 41, column 1:
PL/SQL: Statement ignored
ORA-06550: line 43, column 17:
PLS-00487: Invalid reference to variable 'DYNAMIC_COUNTS % ROWTYPE.
ORA-06550: line 43, column 1:
PL/SQL: Statement ignored
ORA-06550: line 45, column 17:
PLS-00487: Invalid reference to variable 'DYNAMIC_COUNTS % ROWTYPE.
ORA-06550: line 45, column 1:
PL/SQL: Statement ignored
ORA-06550: line 82, column 15:
PL/SQL: ORA-00942: table or view does not exist
ORA-06550: line 82, column 3:
PL/SQL: SQL statement ignored
Here is the script I use... You define a type of thing in the sqlplus command line?
Set serveroutput size unlimited
run the DBMS_OUTPUT. ACTIVATE (buffer_size = > NULL);
DECLARE
TYPE nt_tab IS TABLE OF dynamic_counts % ROWTYPE;
v_nttab nt_tab: = nt_tab();
FND_LOOK INTEGER.
v_incr NUMBER: = 0;
------------------------------------------------------------------------------------------------------------------------
BEGIN
FOR t IN (SELECT master, table_name, column_name
From all_tab_columns
Owner WHERE = UPPER ('& SCHEMA_NAME'))
------------------------------------------------------------------------------------------------------------------------
LOOP
BEGIN
EXECUTE IMMEDIATE ' with an ACE (select case when REGEXP_LIKE (' | t.column_name |))
-This search 1 letter and 12 figures-
', "^ ([[: alpha:]] |) [[: alpha:]] ({3}) [0-9] {12} $")
then "match"
another "no matches found" end up as output of ' | t.Owner | '.' || t.table_name | ')
Select count (*) in a where a.output = "Match Found" clause '
IN FND_LOOK;
------------------------------------------------------------------------------------------------------------------------
IF FND_LOOK > 0 THEN
v_incr: = v_incr + 1;
v_nttab. EXTEND;
v_nttab (v_incr) .t_owner: = t.owner;
v_nttab (v_incr) .t_table_name: = t.table_name;
v_nttab (v_incr) .t_column_name: = t.column_name;
v_nttab (v_incr) .fnd_govids: = FND_LOOK;
END IF;
------------------------------------------------------------------------------------------------------------------------
/ * This is for DBMS output, thus we have 2 different ways, one can see the results in the table dynamic_counts
and in the dbms_output
*/
IF FND_LOOK > 0 THEN
Dbms_output.put_line (t.owner |) '.' || t.table_name | ' ' || t.column_name | ' ' || FND_LOOK);
END IF;
------------------------------------------------------------------------------------------------------------------------
/ * Exception Handeling * /.
EXCEPTION
WHILE OTHERS
THEN
Dbms_output.put_line)
"Generic error".
|| t.column_name
|| "from".
|| t.Owner
|| '.'
|| t.table_name);
END;
END LOOP;
------------------------------------------------------------------------------------------------------------------------
FORALL i IN 1.v_nttab. COUNTY
INSERT INTO dynamic_counts (t_owner,
t_table_name,
t_column_name,
fnd_govids)
VALUES (v_nttab (i) .t_owner,
v_nttab (i) .t_table_name,
v_nttab (i) .t_column_name,
v_nttab (i) .fnd_govids);
COMMIT;
END;
/
Are you sure that you are connected to the database to the same user with both clients?
-
Not able to access sqlplus command-line linux for the new user added
Hi all
We have a strange problem with a new user of linux Redhat , trying to to connect to Oracle 10 g from the command line and would like any suggestions you have.
-other users are able to connect via sqlplus fine to their respective Oracle accounts, both for the new user account.
-I know the user and the password works because we can connect through Oracle SQL Developer from a terminal Windows.
-----
The monitoring of symptoms:
Since terminal linux+:
[user@server]$ sqlplus
Error Initializing SQL 6 * more
SP1 file < lang > .msb not found message
SP2-0750: you may need to set ORACLE_HOME in your Oracle software directory
[user@server]$ echo $ORACLE_HOME
/ opt/oracle/10 g
[user@server]$ echo $ORACLE_SID
~ also define as in other users without db connection problems
[user@server]$ pico * .bash_profile]
~ the value as in other users without db connection problems
[user@server]$ testconnection.pl perl
Series of tests in connection...
ORA_HOME: "/ opt/oracle / 10g.
AMERICAN
DBI connect('local.domain.name','db_username',...) failed: ERROR OCIEnvNlsCreate (check ORACLE_HOME and NLS parameters etc.) to the line /www/testconnection.pl 21
has failed: ERROR OCIEnvNlsCreate (check the ORACLE_HOME and NLS parameters etc).
[user@server]$ pico testconnection.pl
! / usr/bin/perl
Use DBI;
$this_var [0] = "dbi:Oracle:local.domain.name";
$this_var [1] = 'db_username ';
$this_var [2] = 'db_password ';
print 'Test Run of connection...\n\n';
print ' ORA_HOME: '$ENV {ORACLE_HOME}' \n ";
print ' NLS_LANG: '$ENV {NLS_LANG}' \n ";
Print "ORA_NLS: '$ENV {ORA_NLS}' \n ';"
Print "\n\n";
#connect DB
$dbh = DBI-> connect ($this_var [0], $this_var [1] $this_var [2]);
{if ($DBH)}
Print "OK \n";
$dbh-> disconnect;
}
else {}
Print "failed: $DBI: errstr\n";
}
Thanks for your help!>
[user@server]$ ls - lt /opt/oracle/10g/sqlplus/mesg/sp*.msb
-rw - r - 1 oracle oinstall 31744 Sep 2005 1 /opt/oracle/10g/sqlplus/mesg/sp2us.msb
-rw - r - 1 oracle oinstall 11776 Sep 2005 1 /opt/oracle/10g/sqlplus/mesg/sp1us.msb
>It seems that if you have a permissions problem. If your username is not a member of the oinstall group, he or she has no access to the necessary sql * more files. I recommend you read MOS 420083.1 Note for a more in-depth discussion to set the file permissions on the Oracle home.
-
How to specify the instance in SQL * more command line?
Hello
I'm learning to Oracle. I currently have 2 instances of database running. I wanted to connect to one of the bodies and used the following command from the command line:
When I run the command above, SQL * more ask me the password. I do not understand why he asks me the password because I provided on the command line.sqlplus system as sysdba/abc123@ocp11gsid where 1234 is the password for the system user in the ocp11gsys instance.
What is the correct command line, so he asks me the password? (without defining the variable ORACLE_SID of environment - basically, I want to know how to specify the user, his password and sid, all in the sqlplus command line, without being prompted to enter the password that I mentioned.)
Thank you for your help,
John.John,
This is how it works.
E:\Documents and Settings\aristadba>sqlplus system/oracle as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Mon Aug 2 22:49:25 2010 Copyright (c) 1982, 2010, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL>
And now it ask the password,
E:\Documents and Settings\aristadba>sqlplus system as sysdba/oracle SQL*Plus: Release 11.2.0.1.0 Production on Mon Aug 2 22:50:42 2010 Copyright (c) 1982, 2010, Oracle. All rights reserved. Enter password: Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL>
Spot the difference?
The user name and password must unite. What you are to provide the password with the role where it will not be considered.
Update
I missed that part,What is the correct command line, so he asks me the password? (without defining the variable ORACLE_SID of environment - basically, I want to know how to specify the user, his password and sid, all in the sqlplus command line, without being prompted to enter the password that I mentioned.)
The only thing that you can specify is the user name and password. The SID must be defined by you, either explicitly using the export or oraenv command if you are on the local system and do not use the TNS to connect to the instance. If you use the TNS, then an appropriate entry should be there which would connect to the required database.
HTH
Aman...Published by: Aman... on August 2, 2010 22:54
-
Hello, is there a way to run a SQL directly from the sqlplus command line? For example:
sqlplus usr1/usr1@srv1 select sysdate double
Thank you
~ DavidAnother way in Windows:
c:\>echo select * from dual; | sqlplus scott/tiger@test_db SQL*Plus: Release 10.2.0.3.0 - Production on Wed Mar 25 14:41:17 2009 Copyright (c) 1982, 2006, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options SQL> D - X SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options c:\>
-
My command line is no longer present when I connect on Firefox. Only the most top line (Firefox, file, editing, etc.). The only way to get to my start page is by going into the history and press Home.
This has happened
Each time Firefox opened
== When I upgraded to the latest version, I think
* Make sure that you have the Navigation Toolbar and other toolbars visible: View > Toolbars . * If items are missing then see if you can find them in the View > Toolbars > Customize window. * If you see the item in the Customize window then drag it back from the Customize window to the Navigation toolbar. * If you do not see that item then click the Restore Default Set button in the View > Toolbars > Customize window.
See also back and front toolbar buttons or others are absent and controls, buttons and Toolbars Customize Firefox
---
http://KB.mozillazine.org/Toolbar_customization -
Hello
To inaugurate this forum I was play multitenant/pluggable has 12 c and I have a general question about connections to the database of the container - it is clear from what I've tried so far (and what I've read) there is no way to connect to a database from the container without using a sqlnet connection. For example:
Export ORACLE_HOME, ORACLE_SID etc.
sqlplus username/password - it can only connect to the database of the container? (once you are in you can alter the session to switch to the plugable database but cannot do so directly to the connection)
to connect to a database that is connected is always through sqlnet
sqlpus username/password@pluggable
There is no option to say something like:
export ORACLE_SID = container
Export ORACLE_CONTAINER = pluggable
and then do sqlplus username/password?
additional command line switch or as
export ORACLE_SID = container
sqlplus-container = name of user and password pluggable
This understanding is correct or have I missed something in the documentation?
Kind regards
Harry
http://dbaharrison.blogspot.com
Hello Richard,.
In Oracle Multitenant, the only way to connect to a PDB file is by specifying a service.
However, there's a shortcut you can use - TWO_TASK, you will find described elsewhere.
This allows you to specify the default service to serve--think of it as being silently added to your specification by name of user and password. I hope this helps.
Best regards, Patrick
-
sqlplus connects well with SID on the command line, but not with setora
I can connect to my database using sqlplus if I specify the SID on the command line; However, I get an error if I try to connect after using setora to set the SID. Any ideas on why this is happening?
Oracle version is 10.2.4.0
OS is SunOS 5.9 Generic_122300-46 sun4u sparc SUNW, Sun-Fire-V490
MYDB resides on a host machine that is different from the one where I'm under sqlplus. We'll call this REMOTEHOST machine.
I am sure that MYDB is running on REMOTEHOST
Oracle environment variables:MYUSER@MYHOST% setora MYDB MYUSER@MYHOST% sqlplus MYUSER SQL*Plus: Release 10.2.0.4.0 - Production on Mon Mar 8 09:38:58 2010 Copyright (c) 1982, 2007, Oracle. All Rights Reserved. Enter password: ERROR: ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist SVR4 Error: 2: No such file or directory Enter user-name: ^C^C MYUSER@MYHOST% sqlplus MYUSER@MYDB SQL*Plus: Release 10.2.0.4.0 - Production on Mon Mar 8 09:39:10 2010 Copyright (c) 1982, 2007, Oracle. All Rights Reserved. Enter password: Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> quit Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
TNSNAMES entry:MYUSER@MYHOST% env | grep -i ora PATH=/u01/home/bin:/u01/app/oracle/product/10.2.0/OPatch:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/lib/cobol/bin:/usr/ccs/bin:/opt/SUNWspro/bin:/banvol/uncg/bin:/etc:/usr/openwin/bin:/opt/hsqr/ora/bin:/opt/hsqr/jre/jre141/bin:/u01/app/oracle/product/10.2.0/bin SQRDIR=/opt/hsqr/ora/bin LD_LIBRARY_PATH=/usr/ccs/lib:/opt/lib/cobol/lib:/opt/SUNWspro/lib/v9:/opt/SUNWspro/lib/v9:/opt/SUNWspro/lib:/u01/app/oracle/product/10.2.0/lib:/opt/hsqr/ora/bin:/opt/hsqr/jre/jre141/lib/sparce/native_threads:/opt/hsqr/jre/jre141/lib/sparc/client:/opt/hsqr/jre/jre141/lib/sparc:/u01/app/oracle/product/10.2.0/lib32 ORACLE_BASE=/u01/app/oracle ORABIN=/u01/home/bin OWB_HOME=/u01/app/oracle/product/owb102 ORACLE_SID=MYDB ORACLE_HOME=/u01/app/oracle/product/10.2.0
MYDB = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = REMOTEHOST)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = MYDB.MYDOMAIN.COM) ) )
TWO_TASK = MYDB
Export TWO_TASK -
The top of my screen has the symbol of Firefox and the name of the page, I look at you, that is, "Firefox - Mozilla Firefox". My command line that has the essential functions such as File, Edit, View, tools, history is missing!
This has happened
Each time Firefox opened
== Just started yesterday
-
Example of command line for native playbook Adobe extension build?
Does anyone have a sample of a command line instruction to compile a native extension Adobe? The equivalent of export as Air Extension Native IDE QNX Playbook?
Hey,.
If you look at the history of this tutorial, we have here: http://supportforums.blackberry.com/t5/tkb/articlehistorypage/message-revision/1376479%3A10, the first versions used NDK 1.0 and 4.5 FB which had no export function, for the most part, the instructions to use the command line tools.
Read the version 5 of November 8, 2011, which is the most recent by using older versions. If it is not enough, let us know.
See you soon
-
Hello
I use shell, awk and php scripts to encapsulate sqlplus for html output requests
Simple question:
1 - What is the best (or fastest) way to generate an HTML output of a command line script (sqlplus, sqlcl, sqldeveloper)
Subsequently, I use sqlplus on a linux machine, because he does not expect 4 or 5 seconds for the launch of all java stuff on every single batch request, and does not expect the end user to the browser page
can 2 - I use other databases (of course with the related jdbc drivers) with sqlcl?
(with sqldeveloper, can interrogate data bases mysql or mssql)
Sorry for my English.
Thanks in advance.
Stone
Set html sqlformat
coil...
Run your query
If you don't like HTML, you might investigate our new SCRIPT function that lets you use javascript to work against your resultset - Kris examples on his blog.
SQLcl is only for the Oracle database
-
Database does not command line connect
I try to connect my database from command line
c:\users\username > sqlplus orauser/mypassword
It is to show the error
ORA-12154: TNS: could not resolve the specified point connection
But if I try to connect from Oracle Sql Developer, using the same user name and password
It connect without any problems.
If the entrance to the AMT is not correct then how Oracel Sql Developer connection to the DB?
OS: windows 2008
DB: Oracle 11.2.0.3.0
My password combination was the culprit...
I used the pass@123 password!
So, it's in conflict with the TNS entries... I changed my password through SQL Dev, without use of @! .
Now I can access db via the command prompt.
-------------------------------------------------------------------
To accept my @! password combination,
c:\ > sqlplus NomUtilisateur1
Enter the password: "pass@123!" -while asking for password I should enter password in quotation marks «»
Thank you all...
-
Take the input from command line
Hello
I have a sql file with multiple accept statements.
I would like to run this script from the DOS command line and provide the script with values for declarations to accept it.
How can I do this? (I don't want to change the sql for this file)
Kind regards
HJHI have a sql file with multiple accept statements.
I would like to run this script from the DOS command line and provide the script with values for declarations to accept it.
How can I do this? (I don't want to change the sql for this file)Create the text file and put a value per line in good condition. For example, you have the script following script.sql:
accept V1 char prompt 'Enter value for V1:' accept V2 char prompt 'Enter value for V2:' prompt Your input : &V1 &V2 exit
Text file values.txt might be the following:
ABC DEF
Then, use the following syntax:
sqlplus.exe /nolog @script.sql < values.txt
-
Command-line SQL appears then disappears
I just installed the version 11g yesterday and I don't get a good start; can't run SQL command line.
When I run the SQL command line (programs > Oracle Database 11g eXpress Edition > SQL command line) it appears for about a second then disappears
SQL command line worked well during my first installation of Oracle Database 11 g eXpress Edition and I was able to connect as 'SYSTEM', but not after the reboot.
Goes the same for the webpage to start; Now I get 'could not connect to 127.0.0.1:8080' when I go to programs > Oracle Database 11 g eXpress Edition > Get Started.
Database of departure seems to work OK.
When I run SQL * longer or Oracle SQL Developer, I get "ORA-12154: TNS: could not resolve the connect identifier specified" so this isn't really an option right now.
Any thoughts on how to get the SQL command line work? Operating system is Windows XP, 32-bit.OracleServiceXE Windows service is started?
From the command prompt:
sqlplus / as sysdba
SQL > startup
-
Could not connect to command line SQL Oracle XE
Hello
I use Oracle Xe on windows XP... I can connect to SQLPLUS using the windows shell with each of them to the account user and password as
--------------------------------------------------------------------------------------------------------------
Microsoft Windows XP [Version 5.1.2600]
Copyright (C) 1985-2001 Microsoft Corp.
H:\ > SQLPLUS MAYA/MARCO
SQL * more: Release 10.2.0.1.0 - Production Thu Jun 30 17:28:12 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL >_
---------------------------------------------------------------------------------------------------------------
but when I use the command line SQL Oracle to start-> all programs/Oracle Database 10 g Express Edition / * execute SQL Command Line * it brings the command SQL line with a quick line of SQL, but it connects to the database.
---------------------------------------------------------------------------------------------------------------
SQL * more: Release 10.2.0.1.0 - Production Thu Jun 30 17:36:12 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL > Select * from cat.
SP2-0640: not connected
SQL >
----------------------------------------------------------------------------------------------------------------
and I met with the error "not connected". I'm sure that the database has already started successfully.
Can you please let me know I'm doing wrong or what is problem with Oracle SQL Command Line?
Thank youHello
What is
connect MAYA/MARCO
You can issue a query later?
Kind regards
Maybe you are looking for
-
I had some problems with mailto in firefox, and I tried to fix it so I am able to send mail from gmail when I click on a mailto link:... link. However, I managed to solve the problem so that when I click on such a link firefox reacts now (before that
-
Portege M300 - do not have the Internet with IE 8
I have a Toshiba Portege M300 that worked fine until I updated to Explorer 8. After the update, I can't open the web pages, but the antivirus program continues to download the updates, so there seems to be a link. I have uninnstalled Explorer 8, but
-
I have vista I know is an older program and my money the program has worked until a few days ago. Now when I try to do something about it fair to say "this transaction cannot be entered" does anyone know how I can fix it or can it be fixed.Thank you
-
Cannot start Windows on first boot (works after restart)
I recently removed the dust in the housing using a bellows, at the end of which I had unplugged and removed by the drive hard and video card. After reinserting the components and start the computer, I heard a continuous beep sound while the screen re
-
Is there a software that comes with the Pavilion dm4-305 that I can use to copy the video on a cd rw or is the livery of the windows media player?