oracle11g

shrink a database in oracle 11g

空扰寡人 提交于 2019-12-20 02:54:14
问题 I am not a database administrator by any means so I might be wrong in stating some of the things here. In SQL Server, when we add a large amount of data in the database and then when we delete it, the size of the data files (.mdf file) or database (or whatever it is called) does not get reduced to the original size. We need to shrink it. Do the same fundamentals work in Oracle? If yes then how should I go about shrinking an Oracle 11g database? 回答1: Full explanation from the Oracle

I'm getting an error in SQL command not properly ended

自作多情 提交于 2019-12-19 17:44:50
问题 when I enter this INSERT INTO works_on (essn, pno, hours) values ('123456789', 1, 32.5), ('123456789', 2, 7.5), ('666884444', 3, 40.0), ('453453453', 1, 20.0), ('453453453', 2, 20.0), ('333445555', 2, 10.0), ('333445555', 3, 10.0), ('333445555', 10, 10.0), ('333445555', 20, 10.0), ('999887777', 30, 30.0), ('999887777', 10, 10.0), ('987987987', 10, 35.0), ('987987987', 30, 5.0), ('987654321', 30, 20.0), ('987654321', 20, 15.0), ('888665555', 20, 0); I get the follow error ORA-00933: SQL

SQL For Update Skip Locked Query and Java Multi Threading - How to fix this

前提是你 提交于 2019-12-19 10:26:53
问题 SELECT id FROM table_name tkn1, (SELECT id, ROWNUM rnum FROM table_name WHERE PROCS_DT is null order by PRTY desc, CRET_DT) result WHERE tkn1.id= result.id AND result.rnum <= 10 FOR UPDATE OF tkn1.id SKIP LOCKED Here is my problem. 2 threads are accessing this query at the same time Thread 1 - Executes select and locks 10 rows ordered by descending priority and created date. Next I would update the procs_dt as todays date from a separate query.. Thread 2 - Before update of procs_dt or commit

Joining together consecutive date validity intervals

你离开我真会死。 提交于 2019-12-19 09:06:54
问题 I have a series of records containing some information (product type) with temporal validity. I would like to meld together adjacent validity intervals, provided that the grouping information (the product type) stays the same. I cannot use a simple GROUP BY with MIN and MAX , because some product types ( A , in the example) can "go away" and "come back". Using Oracle 11g. A similar question for MySQL is: How can I do a contiguous group by in MySQL? Input data : | PRODUCT | START_DATE | END

PHP interpreter gets undefined constant OCI_COMMIT_ON_SUCCESS with ADODB

懵懂的女人 提交于 2019-12-19 09:03:36
问题 I wrote a php script that must be run on the php interpreter (Without Apache), which uses the adodb library with an Oracle database, but when I try to run it, I'm getting the following error: PHP Notice: Use of undefined constant OCI_COMMIT_ON_SUCCESS - assumed 'OCI_COMMIT_ON_SUCCESS' in c:\proyect\backend\libraries\adodb\adodb.inc.php on line 4248 I've checked, and have both the php_oci8 and php_oci8_11g enabled, so the constant SHOULD be defined. Also, when I run this script WITH Apache, it

Oracle XE 11g the XE database was not found

萝らか妹 提交于 2019-12-19 09:01:17
问题 I am a new one who started to use Oracle Database and faced the problem during installation the last verstion of Oracle XE 11g x64 to the Microsoft Windows 7 x64 Enterprise. During installation were not any errors and Windows Services ( OracleXETNSListener and OracleServiceXE ) were successfully created and started. However, when I try to get the list of available databases I receive an error ORA-01034: ORACLE not available For some reason the XE database was not created into %ORACLE_BASE%

SQL - Missing right parenthesis

不想你离开。 提交于 2019-12-19 08:58:48
问题 I am trying to execute this script in Oracle 11g and getting the following error, I dont know where I am missing the paranthesis or what is the mistake kindly help me figure this out. Script: CREATE TABLE User_Role ( user_role_id INT NOT NULL , Users_user_id INT FOREIGN KEY REFERENCES Users(user_id), User_Types_user_type VARCHAR(20) FOREIGN KEY REFERENCES User_Types(user_type), PRIMARY KEY(user_role_id) ) Error: ORA-00907: missing right parenthesi 回答1: Delete FOREIGN KEY clause. Rewrite your

Return resultset from oracle 11g stored procedure using classic asp

烂漫一生 提交于 2019-12-19 08:55:53
问题 We recently upgraded from Oracle 10g to 11g and now the microsoft provider MSDAORA.1 won't work. I've changed to using the OraOLEDB.Oracle provider but now one of my stored procedures that is returning a resultset isn't going to work either. Old Call: strSQL = "{call SYSADM.lss_pkg_catalog_pages.get_catalog_pages(?,{resultset 100, lss_media_cd, lss_page_num})}" So I've been trying to change it to return parameter values but I keep getting the following error: Error: -2147217900 - ORA-06550:

PL/SQL How to get X day ago from a Date as Date?

二次信任 提交于 2019-12-19 05:13:28
问题 I want to get 100 days ago from 08-APR-13, as date. How to do it with pl/sql? 回答1: Assumption was made that the 08-APR-13 is a string in your situation. So you need convert it to date using to_date function, and then simply subtract 100 literal. SQL SQL> select (to_date('08-APR-13', 'DD-MON-RR') - 100) res 2 from dual 3 / RES ----------- 29-12-2012 PL/SQL SQL> declare 2 l_res_date date; 3 l_in_date varchar2(11) := '08-APR-13'; 4 begin 5 select (to_date(l_in_date, 'DD-MON-RR') - 100) 6 into l

What is the difference between USER() and SYS_CONTEXT('USERENV','CURRENT_USER')?

南笙酒味 提交于 2019-12-19 05:13:14
问题 In an Oracle Database, what are the differences between the following: user() sys_context('USERENV', 'CURRENT_USER') sys_context('USERENV', 'SESSION_USER') Are these also possible related values to whatever 'the current user' is? sys_context('USERENV', 'CURRENT_SCHEMA') sys_context('USERENV', 'AUTHENTICATED_IDENTITY') I am specifically interested in which ones can change, what can change them, which ones can not change value, which ones have different values based on connection type, and