sqlplus

dbms_output size buffer overflow

别等时光非礼了梦想. 提交于 2019-12-10 15:06:29
问题 I tried to set the dbms_output size to unlimited inside a stored procedure. But it gave me compilation errors. So I tried in the SQL*Plus prompt the below way. But still I get the buffer overflow error. How can I overcome this? set serveroutput on size unlimited; exec service_update; ORA-20000: ORU-10027: buffer overflow, limit of 30000 bytes ORA-06512: at "SYS.DBMS_OUTPUT", line 32 ORA-06512: at "SYS.DBMS_OUTPUT", line 97 ORA-06512: at "SYS.DBMS_OUTPUT", line 112 ORA-06512: at "ARBOR.SERVICE

Oracle trimspool only trailing blanks (not leading blanks)

为君一笑 提交于 2019-12-10 13:34:04
问题 I am wondering if there's any tricks to get trimspool to only trim trailing whitespace on the right. I have code that uses dbms_output.put_line to print to the console, and the output often has indentation to make it easier to scan with the eyes. I set the line width rather large to make some of the output easier to read, so I also set trimspool to get rid of extra white space. The only problem is that now the leading which space is removed as well as the trailing whitespace. Is there a way

Generate and insert large CLOB (1 MB) using SQL*Plus

元气小坏坏 提交于 2019-12-10 11:45:34
问题 For test purposes, I would like to insert a large amount of data (approx. 1 MByte) into an Oracle CLOB column. In order to keep the test simple, I want to do that without having to write a test program using C++ or Java; instead, I want to use SQL*PLus. Does Oracle's SQL syntax offer any possibility to do that? I.e. instead of the EMPTY_CLOB() function, I would need something like MAKE_CLOB('x', 1000000) that makes a CLOB by repeating a character 1,000,0000 times. (Note: I specifically do not

CentOS7.5 install Oracle12.1 and update

左心房为你撑大大i 提交于 2019-12-10 05:20:26
CentOS7.5 install Oracle12.1 and update 1.1 、 install centos7.5 1.2 、 vi etc/sysctl.conf add row: fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmmni = 4096 kernel.shmall = 1073741824 kernel.shmmax = 4398046511104 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 1024 65500 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 vm.swappiness = 0 vm.vfs_cache_pressure = 62 # net.core.default_qdisc = fq # net.ipv4.tcp_congestion_control = bbr net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_keepalive_time = 1800 net

SQLPlus settings to generate tab-separated data file

不羁岁月 提交于 2019-12-10 01:23:54
问题 Anyone have a good set of sqlplus configuration directives to help transform a given sql query into nicely tab separated output for pulling into a spreadsheet or further processing? 回答1: Check out the Oracle documentation: Formatting SQLPlus Reports Generating HTML Reports from SQLPlus You can generate a tab in Oracle by using the tab's ASCII value 9 and the chr function: select chr(9) from dual; 回答2: As Justin pointed out in his link, using the set colsep function SQLPlus command saves

Display Dynamic EXECUTE Output Within pl/sql From sqlplus

左心房为你撑大大i 提交于 2019-12-10 01:20:56
问题 How to get the dynamic select results of EXECUTE within PL/SQL from Oracle sqlplus ? I'm writing a simple sqlplus script to collect the sum of all NUMBER columns of a given table: SET SERVEROUTPUT ON DECLARE CURSOR column_cur IS SELECT column_name FROM ALL_TAB_COLS WHERE owner = '&scheme_name' AND table_name = '&table_name' AND data_type = 'NUMBER'; sql_query VARCHAR2(32767); BEGIN sql_query := 'select '; FOR column_rec IN column_cur LOOP sql_query := sql_query || 'SUM(' || column_rec.column

How do you get the next value in a sequence into a variable?

谁说胖子不能爱 提交于 2019-12-09 17:28:30
问题 So I'm writing a stored procedure and am having trouble getting the next value of a sequence into a variable. The sequence name is passed into the function and is stored as a varchar2 variable. How can you get the next value in that sequence into a local variable. 回答1: Something like this? create or replace procedure next_val (p_sequence_name varchar2) as v_nextval integer; v_select varchar2(100); begin v_select := 'select '||p_sequence_name||'.nextval from dual'; execute immediate v_select

ORA-12560: TNS: 协议适配器错误

不羁的心 提交于 2019-12-09 14:47:28
造成ORA-12560: TNS : 协议 适配器 错误的问题的原因有三个: 1.监听服务没有起起来。 windows 平台操作如下:右击我的电脑--管理--服务和 应用程序 --服务,启动 Oracle OraDb11g_home2 TNS Listener服务; Linux 平台操作如下:$lsnrctl start 2. database instance 没有起起来。 windows 平台操作如下:右击我的电脑--管理--服务和 应用程序 --服务,启动oracleserviceXXXX,XXXX就是你的database SID. Linux平台操作如下:$srvctl start database -d sztech1 3.注册表问题。 regedit ,然后进HKEY_LOCAL_MACHINE\ SOFTWARE \ORACLE\HOME0将该环境变量ORACLE_SID设置为XXXX,XXXX就是你的database SID.或者右几我的电脑,属性--高级--环境变量---系统变量--新建,变量名=oracle_sid,变量值=XXXX,XXXX就是你的database SID.或者进入sqlplus前,在 command line 下输set oracle_sid=XXXX,XXXX就是你的 database SID.(在 Linux 下就是:$export

sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory

匆匆过客 提交于 2019-12-09 04:39:38
问题 Please suggest a solution for solving this issue?? While giving the command: sqlplus /nolog the error that occurred: sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory 回答1: The minimum configuration to properly run sqlplus from the shell is to set ORACLE_HOME and LD_LIBRARY_PATH . For ease of use, you might want to set the PATH accordingly too. Assuming you have unzipped the required archives in /opt/oracle/instantclient_11

Problem running oracle script from command line using sqlplus

做~自己de王妃 提交于 2019-12-09 03:06:09
问题 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', 'test@test.com',' '); INSERT INTO ROLES(ROLE_ID, ROLE_NAME