sqlplus

powershell/sqlplus error SP2-0042: unknown command “ ■@” - rest of line ignored

别来无恙 提交于 2019-12-11 07:39:19
问题 I am running this command in powershell: sqlplus system/passwd@mydb @my_sql I have tried it with and without backticks and various other versions I found via Google. I keep getting an error when the command is passed off to sqlplus and have been unsucessful in finding the fix. Hopefully someone here can help out? The error I get is: Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing

how to connect to an oracle database from unix

浪子不回头ぞ 提交于 2019-12-11 07:07:48
问题 I am trying to connect to an oracle database from my unix machine. I am new to script writing in general. I know how to browse round unix and have written basic scripts ( read / display ) and execute them with bash command. Also I know how to view the variables in unix ( user and system). Could you tell me what i need to do to connect to an oracle database? do I use the sqlplus command? are there any variables I have to set before that? 回答1: Could you tell me what i need to do to connect to

Ansible - Skip task when at least one item fails in loop

痴心易碎 提交于 2019-12-11 07:05:54
问题 I am running few SQL scripts using sqlplus present. Before running I am getting all the list of sql files from that directory and storing it in sql_out as shown below. The problem is if one of the sql script fails the rest of the sql scripts still executes. I want to skip the task completely if any one of the script fails. Is there any way to skip. I reckon we can use with_items but not sure how to implement. Any help? - name: "Get sql files from directory" shell: ls {{ directory }}/{{

Select the Database name in iSQL plus

和自甴很熟 提交于 2019-12-11 06:56:12
问题 I have a database but I don't know it's name, and I'm wondering how I can know it using iSQL Plus. So if anyone could please advise. 回答1: Once connected to your RDBMS, you can issue the following command to query the database name: select ora_database_name from dual; On my system: SQL> select ora_database_name from dual; ORA_DATABASE_NAME -------------------------------------------------------------------------------- XE 来源: https://stackoverflow.com/questions/27625414/select-the-database

Why Sqlplus bash script NOT returning error for ORA-02291 integrity constraint when “WHENEVER SQLERROR EXIT 1” is used?

你离开我真会死。 提交于 2019-12-11 06:16:55
问题 I have written a bash script to connect to sqlplus and execute all the sql scripts in a particular folder. Below is the execute method of the script. execute() { if [ ! -d "$DIR_SqlFiles" ] then echo "No sql files were found. Cannot find path ${DIR_SqlFiles}" return 1 fi echo "`date` :Connecting To ${userName}/******@${serviceName}"; for file in `ls ${DIR_SqlFiles}/*` ; do echo "`date` :Executing file $file..." echo "`date` :SQL OUTPUT:"; sqlplus -s ${userName}/${password}@${host}:${port}/$

scope of sqlplus parameters

一笑奈何 提交于 2019-12-11 06:07:31
问题 The following behavior puzzles me. The (positional) parameter of the main script is changed after calling another script. r1.sql prompt script r1 : &1 @r2 &1._xxx prompt script r1 : &1 r2.sql prompt script r2 : &1 Calling the script: SQL>sqlplus un/pw @r1 bla Gives: script r1 : bla script r2 : bla_xxx script r1 : bla_xxx Is there anyway around this behaviour? Assigning the positional parameters to another variable has the same problem. When the same variable name is used somewhere in the

how to disable simultaneous connections by one user on oracle

孤街醉人 提交于 2019-12-11 04:46:58
问题 i am using oracle 12, and hoping to find how can i enable or disable simultaneous connections for my database for each user. i found codes regarding dispatchers and other ones including the following codes: SHARED_SERVER_SESSIONS MAX_DISPATCHERS CONNECTIONS SESSIONS POOL in addition to other codes that didn't find suitable for my case .Can anyone help ? 回答1: Create a new profile as CREATE PROFILE <profile_name> LIMIT SESSIONS_PER_USER 1 CPU_PER_SESSION UNLIMITED CPU_PER_CALL <some_value>

PHP can't connect, but SqlPlus can

给你一囗甜甜゛ 提交于 2019-12-11 03:48:54
问题 Here is an issue that is boggling my cells right now. There is an oracle server that I want to connect to. I can easily connect to it using the sqlplus command line. When I try to connect to the oracle database with PHP though, it fails. Here is the catch, we have the same setup in another datacenter; a PHP machine is trying to connect to an oracle database. I've run the exact same code, configured php identically on both PHP machines. PHP1 can connect to Oracle1 with both sqlplus and through

SQLPlus varchar2 outputs whitespaces

本小妞迷上赌 提交于 2019-12-11 03:35:14
问题 When I query my table like below, the output of the column "NAME" is way too long. I recently changed the data type to VARCHAR2(150) instead of VARCHAR(150) to not save whitespaces. However, the output seems to include (some?) whitespaces anyway. Can anyone clearify what's going on here? Am I looking at whitespaces here, or is the problem only my terminal/console, or can SQLPLUS itself has something to do with it? Using Windows' terminal. SQL> SELECT * FROM SYS.O1_Orders; ID ---------- NAME -

Using bind variables in SQL Plus with more than one row returned?

强颜欢笑 提交于 2019-12-11 03:22:40
问题 This is a stupid problem, but I can't seem to get around it. I have a query that's causing trouble in an OCI program, so I want to run it manually in SQL*Plus to check if there is any difference there. This is the query: select e.label as doc_name, e.url, i.item_id, 'multi' as form_type from cr_items i, cr_extlinks e where i.parent_id = :comment_id and e.extlink_id = i.item_id UNION select null as doc_name, utl_raw.cast_to_varchar2(DBMS_LOB.SUBSTR(r.content, 2000, 1)) as url, r.item_id,