I SQL Plus environment
I have two systems one is installed with Oracle 10g on Windows XP, other is Windows XP system without any oracle software. I was connected both systems with back to back cable. When i was trying to open iSQL Plus window in other system with ip address&port number/isqlplus i was getting one pop up window of iSQL plus DBA login window.
What should i need to provide in that window.
Please provide me
Thanks
Sandeep
Take a look at this.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch1.htm#sthref202
Tom
Similar Messages
-
Restricting the user to operate DML's from SQL PLUS Environment
how to Restrict the user to operate DML statements from SQL PLUS Environment.
Once you restrict SCOTT user to not be able to do an INSERT command, the SQL*Plus returns an error for user SCOTT when he tries to execute an INSERT statement.
Note however, that this is enforced by SQL*Plus, not the database!
Look into the use of product_user_profile from Oracle documentation for more information.
SQL> insert into product_user_profile values('SQL*Plus', 'SCOTT', 'INSERT', NULL, NULL, 'DISABLED', NULL, NULL) ;
1 row created.
SQL> commit ;
Commit complete.
SQL> disconnect
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production
SQL>
SQL> connect scott
Enter password:
Connected.
SQL>
SQL> insert into emp select * from emp ;
SP2-0544: invalid command: insert
SQL>
SQL> -
SQL * PLUS environment is missing in Oracle 11g
I installed Oralce 11g successfully in my windows XP system.. but Here SQL * PLUS environment in missing.. how will i retain the SQL * environment? please help me
Hi;
I installed Oralce 11g successfully in my windows XP system.. but Here SQL * PLUS environment in missing.. how will i retain the SQL * environment? please help meWhat do you mean with " SQL * PLUS environment in missing" please give us more details.
Regard
Helios -
HI!
1. When I want to query long data from tables using select, in sql +,
the above data will go on,by scrolling upward it's not appearing,
2. I have set linesize 4500 and pagesize 50000, but no change occure.
3. As in dos prompt we set page to appear width wise, similarly it is possible to see this in sql/plsq(sql plus).
thanks.If you want to query long data, then use
SET LONG some_size;
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12040.htm#SQPUG088 -
Oracle10g Developer Suite - Application Development - SQL Plus Login Info
I have installed Oracle10g Developer Suite and when I am trying to login into the sql*plus environment the username scott with the passcode tiger is not working. I have Oracle9i Enterprise Edition Release 9.2.0.1.0 as the database.
Can anyone help me in setting up the username and password to login into Sql*plus Release 10.1.0.4.2It sounds like you may be new to Oracle and its products. I would recommend doing some reading.
Oracle 9.2 Net Services Admin Guide
http://download-west.oracle.com/docs/cd/B10501_01/network.920/a96580/toc.htm
Oracle Developer Suite Installation Guide
http://download-west.oracle.com/docs/cd/B25016_06/doc/dl/core/B16012_03/toc.htm
You create the "login" information when you install the database. If you are not the person who performed the installation, you will need to contact them or install it again. Also, be aware that the SCOTT schema is disabled by default in newer database versions for security reasons.
The tnsnames.ora and sqlnet.ora files can be found in the ORACLE_HOME\network\admin directory. This is the same for all Oracle products that use Sql-Net for database connections. You can also use the TNS_ADMIN environment variable to point to a pre-existing tnsnames.ora file (see previously mentioned documents).
The tnsnames.ora entry will be unique to your database and its listener however here is an example:
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = someServer.com)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = orcl)
) -
Buffer overflow in sql plus...
Hi,
i am getting an error 'ORA-20000: ORU-10027: buffer overflow, limit of 2000 bytes' while using DBMS_OUTPUT function in a loop in pl/sql block in sql plus environment. please help me in this regard that how can i over come this error.
thanks,i got the sulotion!
it was really simple by setting the environment before running that code.
Dbms_Output.Enable (1000000);
although it is not permanent sulotion for the problem but at least one can get the much more output by increasing the limit of buffer size.
best regards, -
SQL*Plus Release 9.2.0.1 remote connection to 10g EX
Greetings,
I am trying to access my XE database from a linux machine using SQLplus 9.2.0.1. I do the following:
sqlplus /nolog
sql>connect username/[email protected]:XEERROR:
ORA-06401: NETCMN: invalid driver designator
If I leave out the "XE" I get the following error:
sql>connect username/[email protected]:
ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect
descriptor
There seems to be nothing wrong with my database (tnsping works, etc).
One of the enviromental variables in linux is "ORACLE_SID=CLASS1"
I might have a syntax error in the connect function.
Thanks in advance to whoever can help me. I viciously search the forum before posting this and could not get it to work.
Andrey.Andrey,
Is there a reason why you are using a colon between the <hostname>.<domain> and XE? If you use a period instead of a colon and define the default domain in the sqlnet.ora file as follows:
NAMES.DEFAULT_DOMAIN = <hostname>.<domain>.XE
You should be able to use a similar TNS alias but the colon will trigger an error. If you define your TNS alias as <hostname><domain>:XE and do not define the default domain in the sqlnet.ora file, then you should be able to connect from the command-line but not from within the SQL*Plus environment. For example, using this tnsnames.ora entry:
hostname.domain:XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname.domain)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = XE)))
You can connect running this at the command line:
[oracle@s1 admin]$ sqlplus plsql/[email protected]:XE
SQL*Plus: Release 10.1.0.2.0 - Production on Mon Nov 14 18:22:54 2005
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Beta
SQL>
However, you will get the following running:
[oracle@s1 admin]$ sqlplus /nolog
SQL*Plus: Release 10.1.0.2.0 - Production on Mon Nov 14 18:21:42 2005
Copyright (c) 1982, 2004, Oracle. All rights reserved.
SQL> conn plsql/[email protected]:XE
ERROR:
ORA-12545: Connect failed because target host or object does not exist
Since the error will not occur if you define a default domain, it appears that changing the colon to a period may be your best solution. -
Hai,
I want to change the default settings in glogin.sql, how to do.
For example,
I want to set linesize 120 and pagesize 90 as default when i started the sql*plus environment.
Thanks,
Venu Gopal ChaparalaDear Schneider,
Thanx for ur help. I am pasting the glogin file here. plz check and tell the necessary modifications.
-- Copyright (c) Oracle Corporation 1988, 2000. All Rights Reserved.
-- NAME
-- glogin.sql
-- DESCRIPTION
-- SQL*Plus global login startup file.
-- Add any sqlplus commands here that are to be executed when a user
-- starts SQL*Plus on your system
-- USAGE
-- This script is automatically run when SQL*Plus starts
-- For backward compatibility
SET PAGESIZE 120
SET SQLPLUSCOMPATIBILITY 8.1.7
-- Used by Trusted Oracle
COLUMN ROWLABEL FORMAT A15
-- Used for the SHOW ERRORS command
COLUMN LINE/COL FORMAT A8
COLUMN ERROR FORMAT A65 WORD_WRAPPED
-- Used for the SHOW SGA command
COLUMN name_col_plus_show_sga FORMAT a24
-- Defaults for SHOW PARAMETERS
COLUMN name_col_plus_show_param FORMAT a36 HEADING NAME
COLUMN value_col_plus_show_param FORMAT a30 HEADING VALUE
-- Defaults for SET AUTOTRACE EXPLAIN report
COLUMN id_plus_exp FORMAT 990 HEADING i
COLUMN parent_id_plus_exp FORMAT 990 HEADING p
COLUMN plan_plus_exp FORMAT a60
COLUMN object_node_plus_exp FORMAT a8
COLUMN other_tag_plus_exp FORMAT a29
COLUMN other_plus_exp FORMAT a44
These r the additional ones i wrote and getting the error of SP2-0158: unknown COLUMN option "set"
set linesize 120 set pagesize 90
Thanx
Chaparala -
hi,
I installed oracle 11i on windows server 2003
but i didnt get the sql*plus environment
In all programs--->oracle-oradb11g_home1--->Application development--->sql plus
it shows only sqlplus .exe ...when i open it...i eneterd into dos prompt only. but i can access the db...i coludnt connect with sql plus environment....
what could be the reason for this?user613197 wrote:
hi,
I installed oracle 11i on windows server 2003
but i didnt get the sql*plus environment
In all programs--->oracle-oradb11g_home1--->Application development--->sql plus
it shows only sqlplus .exe ...when i open it...i eneterd into dos prompt only. but i can access the db...i coludnt connect with sql plus environment....
what could be the reason for this?Starting from 11g , sqlplusw is not being shipped anymore.
SQLPLUSW.exe Not supplied with 11g -
Windows System Environment Variables in "Sql * plus"
Can i use/reference Windows System Environment variables in "Sql * plus"?
For example, i want to create sql-script to run in database server computer that asks variable "ORA_HOME" and uses this value to execute some sql/plsql sentences.
Oracle 10g Personal, Windows 7.
Edited by: CharlesRoos on 12.11.2010 17:28CharlesRoos wrote:
Business problem:
I have created 2 databases in my computer. Both databases needs tablespaces created by a script. Tablespaces' datafiles (.dbf files) names are same for both database. Both database has it's own directory where it holds datafiles at the moment. At the moment the datafiles for Database1 are in folder something like "%ORACLE_HOME%"\oradata\%databasename1%\*.dbf, and second database has its datafiles in other folder, somewhere ""%ORACLE_HOME%"\oradata\%databasename1%\*.dbf". I want now the script to create tablespace called "INDX" with same datafile name "indx1.dbf" into both database. So into both mentioned folder the file "indx1.dbf" must be created by script. I think the script should do following:
1. get ORACLE_HOME.
2. connect to database "databasename1"
3. EXECUTE IMMEDIATE "Create TableSpace INDX....file=%ORACLE_HOME% || databasename1 || indx1.dbf"
4. connect to database "databasename2"
5. EXECUTE IMMEDIATE "Create TableSpace INDX....file=%ORACLE_HOME% || databasename2 || indx1.dbf"I don't have Oracle database near by anymore, so the code was pseudocode.
I don't understand how to use ?-shortcut.OK, my first impression is "why does this even NEED to be scripted? Creation of new tablespaces is usually a one-off operation.
But that aside how about this sqlplus command-line substitution variables. This example is in linux, but will work as well in Windows with the change of the way environment variables are referenced:
*nix - echo $myvariable
Windows - echo %myvariable%
First, the sqlscript to create the TS. Note the use of the substitution variable "&1"
{code}
[oracle@vmlnx01 ~]$ cat cat makets.sql
set echo on feedback on verify on trimsp on
prompt &1
CREATE SMALLFILE TABLESPACE EDSTEST
DATAFILE '/ora01/oradata/&1/edstest.dbf'
SIZE 5M
REUSE
AUTOEXTEND ON
NEXT 1280K
MAXSIZE 32767M
LOGGING
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO
drop tablespace edstest
including contents and datafiles
exit
{code}
So, at the OS prompt: Notice that the @ is separated by a space, makeing it a command line parm instead of part of the connect string
{code}
[oracle@vmlnx01 ~]$ export myparm=vlnxora1
[oracle@vmlnx01 ~]$ sqlplus system/pswd @makets $myparm
SQL*Plus: Release 10.2.0.4.0 - Production on Fri Nov 12 13:18:05 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> prompt &1
vlnxora1
SQL> --
SQL> CREATE SMALLFILE TABLESPACE EDSTEST
2 DATAFILE '/ora01/oradata/&1/edstest.dbf'
3 SIZE 5M
4 REUSE
5 AUTOEXTEND ON
6 NEXT 1280K
7 MAXSIZE 32767M
8 LOGGING
9 EXTENT MANAGEMENT LOCAL
10 SEGMENT SPACE MANAGEMENT AUTO
11 ;
old 2: DATAFILE '/ora01/oradata/&1/edstest.dbf'
new 2: DATAFILE '/ora01/oradata/vlnxora1/edstest.dbf'
Tablespace created.
SQL> --
SQL> drop tablespace edstest
2 including contents and datafiles
3 ;
Tablespace dropped.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@vmlnx01 ~]$
{code} -
Unix Environment variable for connect string in SQL*Plus
I am using some environment variables to connect to a sql*plus session in unix.
they are exported as part of a file which contains the following and gets executed through the .profile.
export db_username=xxx
export db_password=xxx
export db_name=xxx
i have created a file abc.sql which contains the following
connect $db_username/$db_password@$db_name
Now, I have a shell script which uses this file inside it to connect to a sql*plus session and execute some queries.
The contents of the shell script :
API_CONNECT_SQL=abc.sql
sqlplus /nolog << THEEND
WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
WHENEVER OSERROR EXIT FAILURE ROLLBACK
set timing on
@${API_CONNECT_SQL}
---- do something
EXIT
THEEND
Now, the sql*plus session is able to get db_username and db_password, but not the db_name. It says "TNS service name not found".
If I hardcode some database name in place of db_name, it connects properly.
Please let me know the problem and solution as well.
Any help appreciated.
thanks,
Vijayfor me this one works
# =========================================
# begin of script
# =========================================
export db_username=alpha
export db_password=bravo
export db_name=charly
echo "connect $db_username/$db_password@$db_name" > xxx.sql
API_CONNECT_SQL=/cfs/dummy1/0/appl/dummy2/rev_04/zzz/tst/xxx.sql
cat ${API_CONNECT_SQL}
sqlplus /nolog << THEEND
spool xxx
WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
WHENEVER OSERROR EXIT FAILURE ROLLBACK
set echo on
host cat ${API_CONNECT_SQL}
@${API_CONNECT_SQL}
select * from dual;
spool off
EXIT
THEEND
# =========================================
# end of script
# ========================================= -
Environment variable PATH and Sql*Plus
Hi all,
i have a problem with sqlplus.
It might seem not to be able to read the path environment variable.
I need to launch some sqls without typing their path (to put the path i should modify morre than 300 shell scripts), e.g.: @script.sql.
My shell scripts are invoked by the database using java.
Inside the shell scripts we have commands like "sqlplus -silent <login> @script.sql [parameters]"
So if sqlplus is not able to read the PATH environment variable, the command hangs waiting for something to do without the chance to close it.(it is silent).
I run RDBMS v8.1.7 on compaq tru64 Unix.
Can someone help me??
Thanks in advance.
Marco - Milan, ItalyWhere do I set SQL*Plus SQLPATH variable??As every other unix environment variable - either in your profile or in your current shell whatever you like
Is this the PATH where SQL*Plus searches for .sql
files??SQL*Plus searches for your files in your current directory, and then the directories you specify with the SQLPATH environment variable.
SQL*Plus searches this colon-separated list of directories in the order they are listed. -
What environment variable I will set for the default SQL*plus file directory
Hi there,
I run sql*plus on windows 2000 professional. I want to set a file
directory for sql*plus so that when I write something in a file,
it will be in my default file directory. What environment
variable I will set for that? Thanks in advance.hi , i have already install my oracle 8i personnel edition to my computer , but my sql plus don't seen to work ,
i understand that they username are ( scott ) and password are ( tiger ) but after i type them and press ok there will be a box coming out and it said ( Cannot open registry Software \ORACLE\HOME1\SID_LIST Starting with default sid )
after i click ok there will be another box asking for password , but i what is the password ? it look to me like a internal password , it can't be tiger for this , cos before that i have already type in my username and password , this is the later part , anyone can help? pls reply, thank alot Nigel,
I'm not sure about Oracle8i Personal Edition. The default username/passwords are:
scott/tiger
system/manager
sys/change_on_install as sysdba
You could try the database installation discussion forum for more help. If you find out what the password for this dialog is, please post it to this group for the benefit of others.
Alison -
How to pass Unix environment variable to a SQL procedure or SQL * Plus
Can any body suggest me how to ,
How to pass Unix environment variable to a SQL procedure or SQL * Plus file..
I am trying to invoke a SQL Procedure from Unix
by passing the value of a Unix environment variable.
Is it possible..?
Thanks in advance.
Regards,
Srinivas JaltaruWithin your shell script you can use what is known as a "here document" which is basically a way of wrapping a call to Oracle. The following call to Oracle loops and writes rows to files with numerically increasing file names. Two unix shell variables are used, one in a select statement and one in a spool command :
<pre>
#!/bin/bash
export ORACLE_SID=DEV05
FILENO=1007351
while [ ${FILENO} -le 1008400 ]
do
FILENAME=farm_${FILENO}.txt
DUMMY=`sqlplus -s user20/user20 <<SQLSTOP
set lines 73
set pages 0
set head off
set termout off
set echo off
set feedback off
select rpad(searchx, 8)
from blastx@PRODUCTION
where searchx = ${FILENO} ### here's a shell variable
spool /export/home/user20/sql/psiblast/BACKUP2_D/${FILENAME} ### here's a shell variable
spool off
SQLSTOP`
FILENO=`expr ${FILENO} + 1`
done
exit 0
</pre> -
Explain plan results are different in SQL Developer than SQL Plus
My Environment:
SQL Developer 1.0.0.15.27
Platform where SQL Developer is running: Windows XP 2002 SP2
Oracle Database and Client 9.2.0.7
Optimizer_mode: FIRST_ROWS
I have the following SQL statement:
SELECT a1.comp_id
FROM temp_au_company a0, au_company a1
WHERE :b2 = a0.temp_emp_code
AND a0.comp_id = a1.comp_id
AND a0.sls_terr_code != a1.sls_terr_code
AND a1.last_mdfy_date > :b1
When I run an Explain in SQL Developer I get the following access path (which is the one I really want):
SELECT STATEMENT TABLE ACCESS(BY INDEX ROWID) FEDLINK.AU_COMPANY NESTED LOOPS INDEX(RANGE SCAN)
FEDLINK.UX2_TEMP_AU_COMPANY
INDEX(RANGE SCAN) FEDLINK.PX1_COMPANY
However, when I execute the statement with sql_trace turned on and use tkprof to generate the actual access path, the statement executes as follows (which is WAY more expensive):
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 3.58 6.68 28136 29232 0 0
total 3 3.58 6.69 28136 29232 0 0
Misses in library cache during parse: 1
Optimizer goal: FIRST_ROWS
Parsing user id: 979 (FEDLINK) (recursive depth: 1)
Rows Row Source Operation
0 NESTED LOOPS
0 TABLE ACCESS FULL AU_COMPANY
0 INDEX RANGE SCAN UX2_TEMP_AU_COMPANY (object id 49783)
Notice the FULL access of au_company.
I understand that SQL Developer has nothing to do with why the statement executed the way it did, but why is the Explain in SQL Developer different than the actual execution plan?
Added note....when I run the explain in SQL Plus it is the same as the actual execution. Here is the explain from SQL Plus:
explain plan for SELECT a1.comp_id
FROM temp_au_company a0, au_company a1
WHERE '1' = a0.temp_emp_code
AND a0.comp_id = a1.comp_id
AND a0.sls_terr_code != a1.sls_terr_code
AND a1.last_mdfy_date > '01-MAY-2006';
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost |
| 0 | SELECT STATEMENT | | 2 | 76 | 2597 |
| 1 | NESTED LOOPS | | 2 | 76 | 2597 |
| 2 | TABLE ACCESS FULL | AU_COMPANY | 2 | 42 | 2595 |
| 3 | INDEX RANGE SCAN | UX2_TEMP_AU_COMPANY | 1 | 17 | 2
Thanks,
BrendaThe explain is different (full scan of au_company in SQL Plus / index access in SQL Developer) even when I use variables in SQL Plus. Here is the output for SQL Plus using variables instead of literals:
SQL> variable b1 varchar2
SQL> variable b2 char
SQL> explain plan for SELECT a1.comp_id
2 FROM temp_au_company a0, au_company a1
3 WHERE :b2 = a0.temp_emp_code
4 AND a0.comp_id = a1.comp_id
5 AND a0.sls_terr_code != a1.sls_terr_code
6 AND a1.last_mdfy_date > :b1
7 /
Explained.
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost |
| 0 | SELECT STATEMENT | | 3184 | 118K| 2995 |
| 1 | HASH JOIN | | 3184 | 118K| 2995 |
| 2 | INDEX RANGE SCAN | UX2_TEMP_AU_COMPANY | 3187 | 54179 | 3 |
| 3 | TABLE ACCESS FULL | AU_COMPANY | 24009 | 492K| 2983 |
Any other ideas? They should be the same.
Brenda
Maybe you are looking for
-
Compiler error when calling ValidateWorkflowMarkupAndCreateSupportObjects
Hi, I created a workflow in sharepoint designer then i exported xoml, xoml.rules, xoml.wfconfig.xml files from it. I want to deploy these files in sharepoint using a host application (Windows Forms application). So, I call ValidateWorkflowMarkupAndCr
-
Lens Correction profile for Canon 18-200mm IS
Hi, I'm looking for a profile for Canon lens EF-S 18-200mm f3.5-5.6 IS - I can't find it in Lightroom and at the moment I'm using a profile for similar lenses from Sigma and at first glance it looks ok, but I have to manually find that lens at each p
-
Have to keep rezooming in everytime a new window is opened
I notice everytime a new window opens that I have to keep rezooming all the time. That is for every one window that opens. Then if I rezoom, then when another opens I have to rezoom on that one. It gets to be a pain after a while. Is there any way to
-
First site, almost done, a few questions...
Hi all. I'm nearing the end (I hope) of my first flash site and have a few questions. Most pressing - I've hit a wall on this error #1009 at frame 1. I've read a bit online and and understand what it is, I just can't figure out what I've left out. Co
-
Grid Control access issue after ip change
Hi The ip address of the server was changed. In this server there was repisotory database and OMS. After that, I couldnt manage to start oms. When I try: opmnctl start all , I notice that it is hanging. I also cannot display Grid Control url, however