Business should be able to issue a job whereby the sub assemblies do not have a different job number, however the job itself maintains the indentation (BOM levels). What we are looking to do is to issue one job for a full build of a product, which would be built in one go anyway.
I'm trying to test moving a single instance 11202 database to single instance w/ grid infra.
Here is what I've done:
1. Install a database (11202), single instance and create a database 2. Install Grid Software only (user: grid) 3. start the cluster 4. "srvctl add database -d orclsidb -o $ORACLE_HOME" to register the database with grid. 4.1> I was able to start/stop the database with srvctl command here onwards 5. configure disks using asmlib and start the asm 6. "srvctl add asm" to register asm with grid. 7. PROBLEM ... when I try to "backup as copy database format '+ASM_DATA_DG';" from oracle user it errors out as below:
RMAN> backup as copy database format '+ASM_DATA_DG';
Starting backup at 24-AUG-12 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=134 device type=DISK channel ORA_DISK_1: starting datafile copy input datafile file number=00011 name=/fs0/oracle/oradata/orclsidb/sjc883p_indx_large_01.dbf RMAN-00571:
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 08/24/2012 08:53:29 ORA-19504: failed to create file "+ASM_DATA_DG" ORA-12547: TNS:lost contact ORA-15001: diskgroup "ASM_DATA_DG" does not exist or is not mounted ORA-15055: unable to connect to ASM instance ORA-12547: TNS:lost contactConsidering "TNS: lost contact" I tried to see if grid listener is aware of ASM instance:
[Code]....
All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=usracdb03.rwcats.com)(PORT=1522))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production Start Date 22-AUG-2012 06:08:53 Uptime 2 days 2 hr. 50 min. 48 sec Trace Level off
Input data: Sec_SSC_ID Column_nameAs of dateOld valu New Value IBM Mat_dt 10/10/20101/1/2001 1/1/2002 IBM Bid Market 10/10/201075 85 IBM asset_nm 1/1/2011International IBM MSFT asset_nm 1/2/2011Microsoft Intel MSFT Bid Market price 1/1/201189 90
I have a table which lists previous jobs, whcih has monthto,yearto, monthfrom and year from fields. I am trying to find the most recent job (of which they might be multiple ending on the same month) Initially, i did the following:
ran a sub query to find the most recent (employee id, max (yearto * 12 + monthto), then another query where I got a list of the most recent jobs, and returned the first one using rownum = 1 (note this may be inconsistent between runs as thee rownum is calculcated before nay ordering clause. This worked, but i figured using the first function might be better as it gives an order
select employee_id from (select employee_id ,max(NVL(yearto,0) *12 + NVL(monthto,1)) KEEP (DENSE_RANK FIRST ORDER BY emloyer) as latest from employees group by employee_id;
but this seems to return more than one entrty:
table date below: drop table employee_list; drop table employee_historic; [code]...
What is the best way to return a single row, if the primary key is not available / applicable.
I am returning the ORA-01427 after running the query below. why I am returning the error and how to address it.
select b.value , b.name, p.value ...... (case when p.value <> 'G2' then null else (select c.oldvalue from ad_changelog c where c.record_id = b.c_bpartner_id and c.ad_table_id = 291 and c.ad_column_id = 4216 ) end) as oldtradeName from c_bpartner b, zz_receipt r, zz_recp_alloc a, m_product p, ad_user us where a.c_bpartner_id = b.c_bpartner_id and a.zz_receipt_id = r.zz_receipt_id and us.ad_user_id = r.createdby and p.m_product_id = a.m_product_id
Just trying to update a table in which the sales amount is inserted when the sales amount is null.
I have
UPDATE ph2_customer_temp SET sales_amount = ( SELECT sl.sales_amount FROM PH2_CUSTOMER_TEMP pct join sales_limit sl on substr(pct.site_code,1,2) = sl.state where pct.credit_limit is null )
I can't seem to wrap my head around this problem I'm having with a query. I need to update all rows in my ps_ntsr_gf_stufile tables with the concatenated values from the ps_classes_tbl table where a.CLASS_NBR = b.CLASS_NBR. I tried to limit it to emplid from the ps_stdnt_enrl table but no luck.
UPDATE ps_ntsr_gf_stufile a SET a.CLASS_NAME = (SELECT CONCAT('SUBJECT', 'CATALOG_NBR') FROM PS_CLASS_TBL b WHERE a.CLASS_NBR = b.CLASS_NBR AND a.STRM = '1118' AND a.INSTITUTION = 'NT752') WHERE a.EMPLID IN (SELECT distinct EMPLID FROM PS_STDNT_ENRL);
I have one Linux machine on which first I did with Oracle 11gR2 Enterprise edition (EE) , it was working fine.
now today I installed oracle11gR2 Standard edition in different partition which is having separate oracle_home from EE.
when I checked the listener services ,port and all , I came to know that the new installation(SE) it will automatically pickup different listener name(listener_SE SID name) and non-standard port(1523).
I did with oracle10gR2 SE and EE both on the same machine with different oracle_home but all together using only one listener (LISTENER) and one port - 1521.
I'm trying to get this down from two regexp to a single one, but I'm not sure it can be done and if so, its beyond me to work out how atm.
BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production PL/SQL Release 11.1.0.7.0 - Production CORE 11.1.0.7.0 Production TNS for Solaris: Version 11.1.0.7.0 - Production NLSRTL Version 11.1.0.7.0 - Production [code]...
The expression itself contains all the rules I'm aware of (nothing to say they won't move the goalposts again mind!) of and the desired output is as shown above. I should add that the actual data is more complex (many tags per record) so it rules out a regexp_replace
/* (SELECT A.TOTAL_ALLOCATED_AMT FROM CLS_ALLOCATION_HDR@LAMS_PROD A WHERE A.APPROVAL_DATE BETWEEN BCTH.TRAN_FROM_DATE AND BCTH.TRAN_TO_DATE AND A.CUSTOMER_ID=BCTH.CUSTOMER_ID AND ALLOCATION_ID IN (SELECT ALLOCATION_ID FROM CLS_ALLOCATION_DTL@LAMS_PROD B WHERE ENTITY_TYPE='REC' AND B.ALLOCATION_ID=A.ALLOCATION_ID AND ENTITY_ID IN (SELECT RECEIPT_NO FROM CLS_RECEIPT_DTL@LAMS_PROD C WHERE B.ENTITY_ID=C.RECEIPT_NO AND RECEIPT_STATUS='A'))AND ALLOCATION_STATUS='A')*/
when i am trying to run this query i am getting an error'single row subquery returns more than one row'.
My problem : I Wrote a package(a function), this function just return a varchar2 , but in this function I wrote a cursor , when I call this function in this manner :
I have written the below sql select loc,(select ename from emp where emp.deptno = dept.deptno) from dept
It results in the below error.
[Error] Execution (1: 13): ORA-01427: single-row subquery returns more than one row
I have modified the SQL and got the required output select em.ename,dep.loc from (select loc,deptno from dept) dep , (select ename,deptno from emp) em where dep.deptno=em.deptno(+)
I have written the below sql to fetch all loc for emp which got executed
SELECT ENAME, (SELECT LOC FROM DEPT WHERE DEPT.DEPTNO=EMP.DEPTNO) LOC FROM EMP
But as i need all locations irrespective of any emp in the locaton so i tried to put emp side (+) which resulted in error.
I want to get any employee name of deptno 10 but total count of number of employees under dept 10.
DECLARE l_deptno NUMBER:=10; l_count NUMBER; l_ename varchar2(20); BEGIN SELECT count(*) OVER(order by empno) ,ename INTO l_count,l_ename FROM emp WHERE ROWNUM=1 and deptno=l_deptno; dbms_output.put_line(l_count||' '||l_ename); end;
We need to get the single node with class type ="1" from this XML as given below.At any point of time, there will be only one such tag with classType="1". Its position could be anywhere inside the "GroupDetails" Tag.ie, The query should get the tag irrespective of its position inside "GroupDetails".
<info groupId="128" classType="1"/>
Is there any way using EXTRACT function with 3 parameter? I tried but with failure.
with rec AS ( select XMLTYPE( '<connection value="0"> <GroupDetails> <info groupId="100" classType="0"/> <info groupId="128" classType="1"/>
I have been trying to spool a table into a .lst. The table is spooled correctly, but there is a column which has xmlType data into. The problem is it does not write the xml into a single row. Every time it find a xml node, the spooling gets indented.
My code is as follows:
-- Establece opciones de formato. set echo off; set feedback off; set heading off; set recsep off; set verify off; set embedded off; set long 1000000; set pagesize 0; SET LINESIZE unlimited; set trimout off; set trimspool on; set serveroutput on size unlimited; set term on;
-- Definicion de variables del script prompt Introducir Creador de la tabla prompt Creador de la tabla: &&1 prompt Introducir Nombre de la tabla prompt Nombre de la tabla: &&2 prompt Introducir Directorio del fichero prompt Directorio del fichero: &&3 prompt Introducir Nombre del fichero prompt Nombre del fichero: &&4 prompt Introducir Caracter separador de campos prompt Caracter separador de campos: &&5 prompt Campo fecha: &&6
create table test_g(x date); insert into test_g values (to_date('01-NOV-2001','DD-MON-YYYY')); insert into test_g values (to_date('02-NOV-2011','DD-MON-YYYY')); insert into test_g values (to_date('03-DEC-2012','DD-MON-YYYY')); insert into test_g values (to_date('12-DEC-2012','DD-MON-YYYY')); insert into test_g values (to_date('31-DEC-2012','DD-MON-YYYY'));
[code].....
I wrote below procedure
create or replace procedure p_testq(p_in_date in date) is
v_comp date; v_strg varchar2(200); i number:=1; type t_trc is ref cursor; trc t_trc; v_sql varchar2(2000);
-- record to which data goes into
type t_prec is record(x date); prec t_prec;
-- plsql table to store data
type t_frec is table of t_prec index by binary_integer; frec t_frec;
-- flow of data, is from v_sql --> plsql record --> plsql table
begin dbms_output.put_line(' month of paramter '|| P_IN_DATE ||' is '||to_char(P_IN_DATE,'MON')); select min(x) into v_comp from test_g where x <= P_IN_DATE
[code].....
how do I store v_strg values so that the dates are included in single quotes
begin p_testq('12-DEC-2012'); end; v_strg: 06-Nov-2012,09-Nov-2012
creating a single row from 2 rows based on the first column which is not unique.
CREATE TABLE RELATIONSHIP ( RelationshipID number not null, DepartmentID number not null ) INSERT INTO RELATIONSHIP VALUES (1,1) INSERT INTO RELATIONSHIP VALUES (1,2) INSERT INTO RELATIONSHIP VALUES (2,3) INSERT INTO RELATIONSHIP VALUES (2,4)
There are a few more tables that would need joining, which I can provide but at the moment I'm struggling with this part, I know there is a problem with the formatting here but not sure how to get tabs correctly
The closest I got was with the below, but this also returns duplicates within the same NAME_ID.
select phone_number, name_id from name_phone where (phone_number) in (select phone_number from name_phone group by phone_number having count(*) > 1) group by phone_number, name_id order by phone_number
I want to insert multiple records in a single row. Example: I have a below query
select '"'||c1||'","'||c2||'","'||c3||'"'from (select 'ABC' as C1,'ZYX' as C2,'TEST' AS c3from dual unionselect 'A1' as C1,'a2' as C2,'A3' AS c3from dual)
And I want to insert the above 2 records in table T1 as a single row as below: