SQL * MORE
Previously I had installed Oracle Database 10 g Client Release 2 (10.2.0.1.0) on Windows XP and sqlplus was ok.
Now I have installed Oracle Database 10 g Release 2 (10.2.0.1.0) on Windows 7 Client, to run SQL more, after I entered the name of user and password @db, it comes automatically closes
Kindly advice
You can trigger a SR with the binary applicants Oracle for the same thing, if there is a reuirement of business.
Kind regards
Kundan Sinha
Tags: Database
Similar Questions
-
SQL * more the 'timing' in SQL Developer command
I installed SQL Developer version 4.1.1.19. In the sql worksheet, how can I use SQL * more order 'timing' in a script to see a time elapsed SQL? The "Timing" on 'set' did not return any info after running SQL, and 'calendar beginning mon_timer' back 'command Timing is obsolete. Help, please.
Thank you
- As you can see, there is no calendar information in the script output log.
- Then I tried on the discussion forum, found it can be enabled in "tool > preference > Database > startup script" and set as startup script:
Set serveroutput on
set timing on
- However, 2 questions are:
- the calendar that he returned is NOT the elapsed time of my stored procedure to run. He simply choose the 2 time points its time, before and not after MS point run. Set timing on is therefore not a solution for me.
- He did not follow the instructions in the startup script. After that I put the calendar in the startup script, stop & restart SQL Developer, same laptop charging, timing still on. The only way to turn off now is to configure it to NOT use
any startup script.
- Then I developed my own coding as a solution:
3. control of the COIL
VAR bv_start_ts VARCHAR2 (30)
VAR bv_end_ts VARCHAR2 (30)
VAR bv_elps_ts VARCHAR2 (30)
DECLARE
v_start_ts VARCHAR2 (30);
BEGIN
SELECT TO_CHAR (SYSTIMESTAMP, 'yyyymmddfxDyhh24miss.ff6') INTO v_start_ts FROM DUAL;
: bv_start_ts: = v_start_ts;
END;
/
IMPRESSION bv_start_ts
EXEC pmsmmi.rpt.rpt_ethncty_race_smry (15);
DECLARE
v_end_ts VARCHAR2 (30);
BEGIN
SELECT TO_CHAR (SYSTIMESTAMP, 'yyyymmddfxDyhh24miss.ff6') INTO v_end_ts FROM DUAL;
: bv_end_ts: = v_end_ts;
END;
/
IMPRESSION bv_end_ts
EXEC: bv_elps_ts: = TO_CHAR (TO_TIMESTAMP (: bv_end_ts, 'yyyymmddfxDyhh24miss.ff6')-TO_TIMESTAMP (: bv_start_ts, 'yyyymmddfxDyhh24miss.ff6'), 'hh:mi:ss.ff6');
IMPRESSION bv_elps_ts
SPOOL OFF
- Then I got what I want, the answer is in the 'PRINT ': bv_elps_ts
SQL > VAR bv_start_ts VARCHAR2 (30)
SQL > VAR bv_end_ts VARCHAR2 (30)
SQL > VAR bv_elps_ts VARCHAR2 (30)
SQL > DECLARE
v_start_ts VARCHAR2 (30);
BEGIN
SELECT TO_CHAR (SYSTIMESTAMP, 'yyyymmddfxDyhh24miss.ff6') INTO v_start_ts FROM DUAL;
: bv_start_ts: = v_start_ts;
END;
/
PL/SQL procedure successfully completed.
Elapsed time: 00:00:00.031
SQL > PRINT bv_start_ts
BV_START_TS
-----------
20150702Thu112617.775545
SQL > EXEC pmsmmi.rpt.rpt_ethncty_race_smry (15)
PL/SQL procedure successfully completed.
SQL > DECLARE
v_end_ts VARCHAR2 (30);
BEGIN
SELECT TO_CHAR (SYSTIMESTAMP, 'yyyymmddfxDyhh24miss.ff6') INTO v_end_ts FROM DUAL;
: bv_end_ts: = v_end_ts;
END;
/
PL/SQL procedure successfully completed.
Elapsed time: 00:00:00.062
SQL > PRINT bv_end_ts
BV_END_TS
---------
20150702Thu112630.805786
SQL > EXEC: bv_elps_ts: = TO_CHAR (TO_TIMESTAMP (: bv_end_ts, 'yyyymmddfxDyhh24miss.ff6')-TO_TIMESTAMP (: bv_start_ts, 'yyyymmddfxDyhh24miss.ff6'), 'hh:mi:ss.ff6')
PL/SQL procedure successfully completed.
SQL > PRINT bv_elps_ts
BV_ELPS_TS
----------
+ 00:00:13.030241000 000000
SQL > SPOOL OFF
-
SQL * more substitution vs bind variable question
Hi all, I am trying to automate some SQL within SQL codes * more script that is triggered by a script .bat, the only parts that change are Dates...
example:
create table blah as
Select * from table
WHERE DATE between start_date and END_DAY;
the DATE is a numeric field, YYYYMMDD
The script runs always at the beginning of a new week, so a Monday, unless a public holiday, then a Tuesday.
The END_DAY is * always * last Friday and I realized that:
variable L_FRIDAY char (15);
Start
Select to_char (next_day(sysdate-7,'FRIDAY'), 'YYYYMMDD') as Last_Friday in: double L_FRIDAY;
end;
/
The thing is that I get an error when I try to use the binding variable?
create table blah as
Select * from table
WHERE DATE between start_date and: L_FRIDAY;
Then once I found the end date, I was going to use add_months(L_FRIDAY,-12) for previous 12 months for the start_date...
When I tried to use a variable Substitution I could just hard code the date, but I can not or do not know how to set the value of this exec to the variable?
Help!
:-)
Basically my research reveals that - Bind variables are not allowed for operations of data definition, use substutions instead of bind variables
I need an automated way to find the END_DAY which is last Friday and START_DATE that is 12 months before Friday and refer to those in the SQL without errors.
Hello
Kodiak_Seattle wrote:
Hi all, I am trying to automate some SQL within SQL codes * more script that is triggered by a script .bat, the only parts that change are Dates...
example:
create table blah as
Select * from table
WHERE DATE between start_date and END_DAY;
the DATE is a numeric field, YYYYMMDD
The script runs always at the beginning of a new week, so a Monday, unless a public holiday, then a Tuesday.
The END_DAY is * always * last Friday and I realized that:
variable L_FRIDAY char (15);
Start
Select to_char (next_day(sysdate-7,'FRIDAY'), 'YYYYMMDD') as Last_Friday in: double L_FRIDAY;
end;
/
The thing is that I get an error when I try to use the binding variable?
create table blah as
Select * from table
WHERE DATE between start_date and: L_FRIDAY;
Then once I found the end date, I was going to use add_months(L_FRIDAY,-12) for previous 12 months for the start_date...
When I tried to use a variable Substitution I could just hard code the date, but I can not or do not know how to set the value of this exec to the variable?
Help!
:-)
Basically my research reveals that - Bind variables are not allowed for operations of data definition, use substutions instead of bind variables
I need an automated way to find the END_DAY which is last Friday and START_DATE that is 12 months before Friday and refer to those in the SQL without errors.
Or SQL * more bind variable or variable substitution can be DATEs. The best you can do is set a different type, as a string, representing a date. A string as June 19, 2015"represents a date, but so strings like 'SYSDATE' and ' SYSDATE - 7', so you can do something like this:
SET l_friday = ' NEXT_DAY ((SYSDATE-7), 'FRIDAY').
DEFINE start_date = "ADD_MONTHS (& l_friday, - 12)"
SELECT & start_date AS t_n
, & l_friday AS l_f
OF the double
;
Output (when executed on 25 June 2015):
L_F T_N
----------- -----------
June 19, 2014 19 June 2015
-
Special characters could not load DB via SQL * MORE
Hi, I have a pl as .accidentally sets sql script which will insert data in database. The question is there are some records are missing and these missing records contains a special character: Sansao and Strasse. The strange was if I run the script via F5 (Toad), all data can be inserted successfully but run through SQL * MORE (Toad), all records that contain special characters are not inserted.
Anyone here know why it didn't load these special characters via SQL * MORE?
Probably because you have given unicode (multi byte charsets) you read with a customer of standard single-byte character set.
It's SILLY to loading data using SQL * more. It's the wrong tool used for loading the data. It does not support the bind variable. It doesn't support liaison in bulk. It does not support direct path inserts. It is not SQL * Loader.
-
Choose one in SQL Developer fails - SQL * more work
Hi all
I have the HS to MySLQ connection works correctly and most of the requirements I have in regards to the data works.
However, I "only able to test my procedures and functions in SQL * more." IN SQL Developer 4.0.0.12 there is always a problem and questioning of the results are never displayed.Thanks in advance for any advice.
Sincerely
JS
Hello Mike,.
I use Oracle XE 11.2.0.2 x 64 on Linux. Using the MySQL ODBC 5.3.4 connection.
I've just upgraded the SQL Developer to version 4.0.3 (released September 2014) and the problem seems to be resolved because I'm able to query the MySQL database and get the results.
However, there is something I don't like all the whitespace added, whether in SQL Developer 4.0.3 in SQL * more.
Here's the query I tested:
Select "host", "User", "Password" in "user"@MYODBC5;
-
SQL more how to stop script after the exception of the DDL
Hello
I have script .sql, which I managed by SQL * more.
Some migration of data and database structure changes were made in the script.
So, I use a lot of distinct calls:
@script_name.sql
@script_name_1.sql
@script_name_2.sql
...
Some of the scripts contains DDL as create table or column.
contains some declare blocks (DML).
Is it possible to stop the script after an exception has occurred?
Thank you, Olga.
Hi, Olga.
You can use the SQL * more order
WHENEVER SQLERROR EXIT
to tell SQL * more to stop the execution of orders and immediately disconnect after any exception SQL is triggered.
I don't know of anyway to stay connected, but to stop script execution, after an error.
-
SP2-0642: SQL * more internal error of State 2165
Hello
I was faced with the question with sqlplus suddenly in 11.2.0.3 throw version on solaris 10 OS, it was working fine until today. No changes made on this (11.2.0.3.Q3) oracle home, but new ORACLE HOME installed by Server DBA (shared server) with the Q4 patch.
-bash-3, $2 sqlplus / as sysdba
SP2-0642: SQL * more internal error state 2165, context 4294967295:0:0
Impossible to continue
As explained in metalink note: 396154.1, I set NLS_DATE_FORMAT, but it doesn't seem to work
also, I've checked the timezone as explained in the blog file, but the file timezone.dat does not exist in 11.2.0.3 version and all the files in $ORACLE_HOME/oracore/zoneinfo/have permissions of reading to the dba group
http://arjudba.blogspot.com/2010/07/non-Oracle-user-hits-SP2-0642-or-SP2.html
-bash - $3.2 ls - ltr
30942 total
-rw - r - r - 1 oracle dba readme.txt 6068 7 June 2010
-rw - r - r - 1 oracle dba 31525 June 7, 2010 timezdif.csv
-rw - r - r - 1 oracle dba 351525 Aug 21, 2011 timezone_9.dat
-rw - r - r - 1 oracle dba 302100 August 21, 2011 timezone_8.dat
-rw - r - r - 1 oracle dba 286815 Aug 21, 2011 timezone_7.dat
-rw - r - r - 1 oracle dba 286217 Aug 21, 2011 timezone_6.dat
-rw - r - r - 1 oracle dba 286310 Aug 21, 2011 timezone_5.dat
-rw - r - r - 1 oracle dba 286264 Aug 21, 2011 timezone_4.dat
-rw - r - r - 1 oracle dba 286651 Aug 21, 2011 timezone_3.dat
-rw - r - r - 1 oracle dba 274900 August 21, 2011 timezone_2.dat
-rw - r - r - 1 oracle dba 344448 Aug 21, 2011 timezone_14.dat
-rw - r - r - 1 oracle dba 344425 Aug 21, 2011 timezone_13.dat
-rw - r - r - 1 oracle dba 345024 Aug 21, 2011 timezone_12.dat
-rw - r - r - 1 oracle dba 345356 Aug 21, 2011 timezone_11.dat
-rw - r - r - 1 oracle dba 345637 Aug 21, 2011 timezone_10.dat
-rw - r - r - 1 oracle dba 274427 Aug 21, 2011 timezone_1.dat
-rw - r - r - 1 oracle dba 801410 Aug 21, 2011 timezlrg_9.dat
-rw - r - r - 1 oracle dba 616723 Aug 21, 2011 timezlrg_8.dat
-rw - r - r - 1 oracle dba 601242 Aug 21, 2011 timezlrg_7.dat
-rw - r - r - 1 oracle dba 586750 Aug 21, 2011 timezlrg_6.dat
-rw - r - r - 1 oracle dba 587487 Aug 21, 2011 timezlrg_5.dat
-rw - r - r - 1 oracle dba 531137 Aug 21, 2011 timezlrg_4.dat
-rw - r - r - 1 oracle dba 527717 Aug 21, 2011 timezlrg_3.dat
-rw - r - r - 1 oracle dba 507957 Aug 21, 2011 timezlrg_2.dat
-rw - r - r - 1 oracle dba 791430 Aug 21, 2011 timezlrg_14.dat
-rw - r - r - 1 oracle dba 782475 Aug 21, 2011 timezlrg_13.dat
-rw - r - r - 1 oracle dba 785621 Aug 21, 2011 timezlrg_12.dat
-rw - r - r - 1 oracle dba 787272 Aug 21, 2011 timezlrg_11.dat
-rw - r - r - 1 oracle dba 792894 Aug 21, 2011 timezlrg_10.dat
-rw - r - r - 1 oracle dba 493675 Aug 21, 2011 timezlrg_1.dat
drwxr-xr-x 2 oracle dba 30 Sep 8 05:03 big
drwxr-xr-x 2 oracle dba 30 Sep 8 05:03 little
Please suggest alternatives to troubleshoot
Thank you
Sol.beach thanks for the reply, I'm able to correct the problem. In fact the PATH variable has put in .profile of export PATH = $PATH: $ORACLE_HOME/bin and the value is lower.
-bash-3, $ 2 echo $PATH
/Apps/Oracle/product/9.2.0.8.2009Q4/bin:/usr/ccs/bin:/usr/sbin:/usr/bin:/bin:.:/ bin:/opt/bin:usr/CSS/bin:/usr/ucb:/usr/local/bin:/apps/Oracle/product/11.2.0.3.2014Q3/bin
I changed as export PATH = $ORACLE_HOME/bin: $PATH and now it works fine. It seems to be a problem with the old Oracle Home, also present in the PATH variable before the bin to the current address of Oracle Home Directory.
-bash-3, $ 2 echo $PATH
/Apps/Oracle/product/11.2.0.3.2014Q3/bin:/apps/Oracle/product/9.2.0.8.2009Q4/bin:/usr/ccs/bin:/usr/sbin:/usr/bin:/bin:.:/ bin: / opt/bin: css/usr/bin: / usr/ucb: / usr/local/bin
Concerning
-
Database demo of vision: how to access the database through SQL * more?
I'm totally new in this space, so forgive my beginner questions.
What I want to do, is to integrate EBS with APEX. To get there I downloaded (of delivery) and installed the Vision database unique node in a VirtualBox. To do this, I followed this video on YouTube: https://www.youtube.com/watch?v=8JgxMDPsd6s
Now I want to install APEX and for this I need to access my database as SYS. Now for my questions:
1. How can I use SQL * more in the VirtualBox?
2. What is the default password for SYS with this demo database?
Thanks, Alex
File under $ORACLE_HOME and the owner is the user 'oracle '.
You will need to source the file VISION_ebs.env , and then deliver "env | fate"and you should see the set env variables. You can connect as sysdba.
Thank you
Hussein
-
Does anyone know how to preserve the credibility of a string returned by using SQL * more variable substitution for use in a title column.
I am under SQL * more script and the output of the securities. I need to find out the name of the company (in the text name of the legal entity). However, the substitution variable returns / outputs the data to the correct record, but corrupts the content of the returned string by spaces dropping (necessary)?
In the script below, I tried several combinations to include using a technique of faking the output as a formula in Excel. It is very effective with the attack anywhere to Oracle/Microsoft problem at the output to Excel. For some varieties in solution, there are two methods to fill the Legal_Entity_Name which each produce the same corrupt result. I use method 2 because it's a little more friendly.
The output is directed to a local directory C:... If you try to run this script... note the output in the script path is c:\Ora_scripts\Corrupt_Example.xls coil;
In the database, EBS R12, the correct output should be: Industrias Selkirk of Mexico S de RL de CV . (IN THE SCRIPT, THE SAME SELECT STATEMENT IS USED AS THE MAIN QUERY - IT PRODUCES A CORRECT RESULT).
However, data is corrupted to: IndustriasSelkirkdeMexico.
Here's a testable script:
--@C:\Ora_Scripts\Corrupt_String_Script.SQL
trigger the echo
went to CHECK
moved the markup html off the coast of the coil
Leave your COMMENTS
Set trimspool on
delete columns
clear breaks
clear the buffer
Disable CALCULATED
TOPIC on the value
set PAGESIZE 50000
Set LINESIZE 500
NewPage 0 value
set TERMOUT off
-The variable definitions Section.
Undefine g_Registration_Id
Set g_Registration_Id = 12033;
Cancel the Instance definition;
Set the Instance = "XXXXXX";
Undefine Time_Stamp;
Define Time_Stamp = "DD-Mon-YYYY hh ';
Undefine sv_Legal_Entity_Name
Bnd_Legal_Entity_Name variable Char (75)
Variable bnd_Registration_Id number
--
-Fill in the title and the title of the data items.
-Company name get - method 1
/ * Start
Select xrg. Alternate_Registered_Name in: bnd_Legal_Entity_Name
of apps.xle_registrations xrg
where xrg. Source_Table = "XLE_ENTITY_PROFILES."
and xrg. Registration_Id = & g_Registration_Id;
End;
/
-Transfer the value of the variable binding to the variable substitution
Column sv_Var_1 sv_Legal_Entity_Name noprint new_value
Select: bnd_Legal_Entity_Name double sv_Var_1;
*/
--
-Company name method retrieves 2
Run: bnd_Registration_Id: = & g_Registration_Id;
Column sv_Legal_Entity_Name sv_Legal_Entity_Name FORMAT A75 noprint new_value
-Try in the form of Excel formula - no luck!
-Select ' = ' ' | xRG. Alternate_Registered_Name | «"«as sv_Legal_Entity_Name»»»
Select xrg. Alternate_Registered_Name as sv_Legal_Entity_Name
of apps.xle_registrations xrg
where xrg. Source_Table = "XLE_ENTITY_PROFILES."
and xrg. Registration_Id =: bnd_Registration_Id;
--
Column Instance_Col by Instance NOPRINT new_value
Select the name as Instance_COL in apps. Fnd_Apps_System;
--
Column Time_Stamp_Col new_value Time_Stamp NOPRINT
Select to_char (sysdate, "Mon-DD-YYYY HH24:MI:SS) as Time_Stamp_Col
From Dual;
--
the forage value off markup html on spool
coil c:\Ora_scripts\Corrupt_Example.xls;
TTITLE-
Skip - 0
'Arguments' left... »-
Jump - 1
Center & sv_Legal_Entity_Name-
Jump - 1
Right ' run: ' Time_Stamp-
Center "it is a centered string constant;
Jump - 2
-Various declaration of Variables.
the forage value off markup html on spool.
HEAD ' < title > example string of corrupt < /title >.
< style type = "text/css" >-
table {background: white; do-size: 80% ;}} -
Th {background: #ccc ;}} -
TD {padding: 0px ;}} -
< / style > '
-- Mainline query --
-REPLICATE THE SELECT USED TO DERIVE THE LEGAL_ENTITY_NAME TO THE TITLE
Select xrg. Alternate_Registered_Name
of apps.xle_registrations xrg
where xrg. Source_Table = "XLE_ENTITY_PROFILES."
and xrg. Registration_Id = & g_Registration_Id;
-Liquidation of script.
spool off;
moved the html markup;
Here is output (open in Excel):
Arguments... IndustriasSelkirkdeMexico It is a centered string
constantRun: 14 October 2014 10:10:45 ALTERNATE_REGISTERED_NAME Industrias Selkirk of Mexico S of CV RL Hello
Just use double quotes... First test: with x.sql container
trigger the echo
delete columns
TOPIC on the value
set PAGESIZE 50000
Set LINESIZE 500
NewPage 0 value
set TERMOUT off
-The variable definitions Section.
Undefine sv_Legal_Entity_Name
Column sv_Legal_Entity_Name sv_Legal_Entity_Name FORMAT A75 noprint new_value
TTITLE-
Skip - 0
'Arguments' left... »-
Jump - 1
Centre '& sv_Legal_Entity_Name ' -.
Skip 1
SELECT 'test ttitle' FROM dual;
running the script, providing a ttitle (slightly different from yours ;-), I have):
Industrias Belgica ;-) Selkirk ' TESTINGTTITLE
--------------
test ttitle
Best regards
Bruno Vroman.
-
Cannot access SQL more from other than the Oracle users
Hello
I installed Oracle 11 g R2 on Red Hat 6. My problem is that I can't access sqlplus from other than the oracle users.
I put the PATH, the ORACLE_HOME and ORACLE_SID to the correct values.
Session1
Connect as: oracle
[email protected] password:
Last login: Sun Aug 24 01:24:46 192.168.202.1 2014
[oracle@localhost ~] $ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/Home/Oracle/bin:/Home/Oracle/app/Oracle/product/11.2.0/dbhome_1/bin
[oracle@localhost ~] $ echo $ORACLE_HOME
/Home/Oracle/app/Oracle/product/11.2.0/dbhome_1
[oracle@localhost ~] $ echo $ORACLE_SID
ORCL
[oracle@localhost ~] $ sqlplus
SQL * more: Production release 11.2.0.1.0 Sun Aug 24 03:17:32 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Enter the user name:
Session2
Connect as: nada
[email protected] password:
Last login: Sun Aug 24 02:31:49 192.168.202.1 2014
[prithwish@localhost ~] $ export PATH=$PATH:/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin
[prithwish@localhost ~] $ export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
[prithwish@localhost ~] $ export ORACLE_SID = orcl
[prithwish@localhost ~] $ echo $ORACLE_HOME
/Home/Oracle/app/Oracle/product/11.2.0/dbhome_1
[prithwish@localhost ~] $ echo $ORACLE_SID
ORCL
[prithwish@localhost ~] $ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/Home/Prithwish/bin:/Home/Oracle/app/Oracle/product/11.2.0/dbhome_1/bin
[prithwish@localhost ~] $ sqlplus
-bash: sqlplus: command not found
I guess that I could not access sqlplus as the Nada the user has no access to X11R6
[prithwish@localhost ~] $ cd...
[Host prithwish@localhost] $ ls - ltr
Total 8
drwx-. 30 oracle oinstall 4096 23 August 23:51 oracle
drwx-. Nada Nada 4096 24 August to 02:33 27 Mathieu
[Host prithwish@localhost] $
My question is, although quite stupid, that double
(1) I have to change the permissions of the directory oracle of 755 for any other user to access the sqlplus?
(2) why is the user directory under the folder created with permissions of 700, even when the umask is set to 002? Change the permissions of the directory under/Home oracle will cause security problems?
My apologies for being naïve. It's the first time I installed Oracle under UNIX
Kind regards
Prithwsh
Actually, the default procedure is NOT to install oracle to X11R6, but in/opt/oracle. or maybe/usr/local/oracle.
This is what you're going to be recommended in the installation documentation, and in doing so, don't forget to run rootpre.sh and root.sh, I never had security problems and could run Oracle from any account.
Sybrand Bakker
Senior Oracle DBA
-
I installed Oracle Developer with success, but having bad connect to Sql more than command line, also unable to connect via the developer tools, I get a TNS: Connect timeout occurred. This happens also for the "Plus" Sql for Windows.
However, I can connect via the Sql Plus command window when it is executed from "Start-> all programs", but not when I first run the command window:
I have a good Oracle 11 g install on Windows 7 and a good developer Sql install so I can connect to databases, but something does not work when you try to connect through these tools. Although Sql Plus works when called from 'Start-> all programs'
sqlplus scott/tiger - don't use SQL * Net, you can connect like this even with the listener is stopped.
Developer SQL can ONLY connect using SQL * Net & can be blocked by the firewall
to connect using sqlplus & SQL * Net, you need to invoke it as below
sqlplus scott/tiger@orcl
-
How to validate SQL * MORE connection in Unix shell script
I wrote the following function in unix shell script to validate SQL * MORE connection and throw a user-defined message.
function check_db_conn
{
output | sqlplus-s-L $User/$Password@$SID >/dev/null
If [[$?-no 0]]; then
echo 'credentials incorrect DB.
FI
}
However, I would like to change this feature so that the user has entered a good connection and that there is a problem with TNS listener must display the appropriate message.
Hello
Try adding:
lsnrctl status $listener_name > /dev/null if [[ $? -ne 0 ]]; then echo "Issue with Listener" fi
-
Connection with SQL * more is not possible
Hello together,
I have a problem with my database and SQL Plus.
I can't connect to my DB via SQL Plus, I get the error message: > > ORA_12546: TNS: detonation verweigert (Permission denied) < <.
I tried it with several users. When I try to log in to enterprise manager or connecting to the DB through SQL Developer works very well with the user > > sys < <, only the SQL more connection does not work.
It works until yesterday that there are some problems with the DB and the processor and RAM were almost 100% occupied each.
We use the Version 11 g Enterprise Edition Release 11.2.0.1.0 64 bit Production on a Windows Server 2008 R2 Enterprise Server.
I am running SQL Plus, Enterprise Manager and SQL Developer directly on the DB server.
When I start SQL Plus he asks me my username > > enter user name: < < and after that my password: > > password: < <.
A connection as seen in many forums or document on the internet like > > scott/tiger@ORCL < < never worked on my system, which is also confused me.
We have no listener.ora file in the folder: ORACLE_HOME/NETWORK/ADMIN only a sqlnet.ora with line > > SQLNET. AUTHENTICATION_SERVICES = (NTS) < < in it.
Status of the listener:
---------------------------------------------------------------------------------------------------------------------------------------------------------
C:\Windows\System32 > lsnrctl status
LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 18 February 2014 12:14:32
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connection to (ADDRESS = (PROTOCOL = tcp)(HOST=) (PORT = 1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
TNSLSNR for Windows 64-bit version: Version 11.2.0.1.0 - Production
Start date February 18, 2014 10:15:54
Uptime 0 days 1 hour 58 minutes 42 seconds
Draw level off
Security ON: OS Local Authentication
SNMP OFF
O:\app\administrator\diag\tnslsnr\QualisysDbNbg\listener\alert\log.XML log listener
Summary of endpoints listening...
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST=QualisysDbNbg) (PORT = 1521)))
Summary of services...
Service "orcl" has 1 instance (s).
Instance "orcl", State LOAN, has 1 operation for this service...
The command completed successfully
C:\Windows\System32 >
---------------------------------------------------------------------------------------------------------------------------------------------------------
I hope someone can help me with this problem.
Thank you you very much in forward for your answerand greetings
Matthias
The sys user must connect as sysdba
have you tried
sqlplus 'sys@ORCL as sysdba'
or
sqlplus 'sys/yoursyspwd@ORCL as sysdba'
the first command should work without password for all users group ORA_DBA.
Scott, the user cannot also exists in your database.
-
SQL * more question: unprinted despite SET ECHO ON command
RDBMS Version: 11.2.0.4
OS: Oracle Linux 6.4 (bash shell)
I'm kinda a newbie to SQL * more.
Here's a SQL * Plus script embedded in bash script that scales multiple data files. This script has been run on the DB server side.
#! / bin/bash
export ORACLE_SID = ORCL1
echo "resize Datafile began to" 'date '.
sqlplus "/ as sysdba" < < EOF
set echo on
Set of feedback on
ALTER DATABASE DATAFILE '+ DATA/brfcsprd/datafile/manh_audit_lob.338.834340223' resize 25g;
ALTER DATABASE DATAFILE '+ DATA/brfcsprd/datafile/manh_audit_lob.337.834340223' resize 25g;
ALTER DATABASE DATAFILE '+ DATA/brfcsprd/datafile/manh_audit_lob.336.834340225' resize 25g;
ALTER DATABASE DATAFILE '+ DATA/brfcsprd/datafile/manh_audit_lob.335.834340225' resize 25g;
ALTER DATABASE DATAFILE '+ DATA/brfcsprd/datafile/manh_audit_lob.334.834340225' resize 25g;
ALTER DATABASE DATAFILE '+ DATA/brfcsprd/datafile/manh_audit_lob.333.834340225' resize 25g;
ALTER DATABASE DATAFILE '+ DATA/brfcsprd/datafile/manh_audit_lob.332.834340227' resize 25g;
quit smoking
EXPRESSIONS OF FOLKLORE
echo "resize Datafile ended in" 'date '.
As you can see, the SQL * more script contains ON SET ECHO ON and PUT your COMMENTS.
But in the logfile (see below), I don't see every ALTER DATABASE DATAFILE... command printing. I see that ' altered database.' printing messages.
I executed the script to nohup as
nohup resize.sh > MyResize2.log &
$ cat MyResize2.log
DataFile resize started at Sun Dec 29 00:09:45 MYT 2013
SQL * more: Production of the 11.2.0.4.0 on Sun Dec 29 00:09:45 version 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production
With partitioning, Real Application Clusters, Automatic Storage Management, OLAP,.
Options of Data Mining and Real Application Testing
SQL > SQL > SQL > SQL > SQL >
Database altered.
SQL >
Database altered.
SQL >
Database altered.
SQL >
Database altered.
SQL >
Database altered.
SQL >
Database altered.
SQL >
Database altered.
Hello
ECHO applies only to the SQL commands * Plus reads through the @ or the STARTUP command, no statements you type directly in the SQL > prompt or read the bash script statements.
Try to create a separate file, containing only the command ALTER DATABASE in a separate file (let's call it alter_database.sql for now) and call it from your script bash, like this:
#! / bin/bash
export ORACLE_SID = ORCL1
echo "resize Datafile began to" 'date '.
sqlplus "/ as sysdba".<>
set echo on
Set of feedback on
@whatever/alter_database
quit smoking
EXPRESSIONS OF FOLKLORE
echo "resize Datafile ended in" 'date '.
-
Connection to the 11g on Oracle_Developer_Days.ova with sql + more
I downloaded the Oracle_Developer_Days.ova and have confirmed with connectivity
C:\Users\robm > ping ServeurOracle
ServeurOracle ping [192.168.11.18] with 32 bytes of data:
Reply from 192.168.11.18: bytes = 32 time < 1 ms TTL = 64
Reply from 192.168.11.18: bytes = 32 time < 1 ms TTL = 64
Reply from 192.168.11.18: bytes = 32 time < 1 ms TTL = 64
Reply from 192.168.11.18: bytes = 32 time < 1 ms TTL = 64
Ping statistics for 192.168.11.18:
Packets: Sent = 4, received = 4, lost = 0 (0% loss),
Time approximate round trip in milli-seconds:
Minimum = 0ms, Maximum = 0ms, average = 0ms
C:\Users\robm >
I have advanced and installed the client instant and also installed the sql + more
C:\Users\robm > sqlplus scott/tiger@orcl
SQL * more: Production of the 12.1.0.1.0 on sat Nov 30 00:27:44 version 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener is not currently of service requested in connect
descriptor of
Enter the user name:
Here the tnsnames.ora can, I did you see errors?
XRACQ_MYSERVICE_TAF =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracleserver) (PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)
any ideas on how to make it work?
I now get
ORA-01017: name of user and password invalid. connection refused
using tsnames.ora
WEIRD =.
(DESCRIPTION =
(ADDRESS_LIST =
(ADRESSE = (PROTOCOL = TCP) (HOST = 192.168.11.18)(PORT = 1521)))
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
so I seem to connect now... . How can scott Tiger be wrong isn't the default?
Maybe you are looking for
-
Why the new tab icon keep disappearing once I closed everything except a tab?
The new tab icon appears to the left of my tabs, but as soon as I close all tabs in the browser until there is just one left, the new tab button disappears. I tried to reset the default customization and add a new tab button but no work. After that I
-
How to set up email notifier in xp and mypostoffice.co.uk mail server
I tried to input of information in the settings box indifferent forms but still doesn't test
-
Pls I need help to reset my bios of my computer compaq mini CQ10
Pls I need help to reset my bios of my computer compaq mini CQ10-130se error fatal problem with CNU0014WZF TNX!
-
the situation: I erase all the contents of Documents and sending them to the Recycle Bin. This is in preparation for a new backup of Documents to an external hard drive device.What continues to be: whenever I press DELETE I get the following error m
-
I imported an image group which does not appear in Lightroom.
Lightroom indicates that they have already imported to my catalog, but I can't see them. How can I make it appear?