Windows :: Retrieving Data From Corrupt XP?
Oct 9, 2011i am using oracle 9i database.i want to retrieve data from corrupt windows xp.but i do not know what i do for that.
View 2 Repliesi am using oracle 9i database.i want to retrieve data from corrupt windows xp.but i do not know what i do for that.
View 2 RepliesI have a problem with my Oracle 9i SQL Query and I'm struggling to get it done.
I have three tables namely Student, Lease and Room and want to retrieve data from these three tables.
I want the Student name, the Lease details and the Room No from these tables.
The problem with my SQL query is that I get all the information from the tables except from the Room table, where in the column it show Room_No but the values are not displayed, the query is given below.
SELECT STUDENT.STU_FNAME, STUDENT.STU_LNAME, LEASE.LSE_NO, LEASE.LSE_DURATION, LEASE.LSE_STARTS, LEASE.LSE_ENDS, ROOM.ROOM_NO
FROM STUDENT
LEFT OUTER JOIN LEASE ON LEASE.STU_ID = STUDENT.STU_ID
LEFT OUTER JOIN ROOM ON ROOM.PLACE_NO = LEASE.PLACE_NO;
i have requirement, that is to retrieve the data from pl/sql table.
SQL> select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
[code]....
PL/SQL procedure successfully completed.now i want receive the data from particular x record to y record
I have one table when I am querying like below
select * from timeoffreqitem
where timeoffreqitemid=134
getting data like below
134 144 07-OCT-11 13-OCT-11 134
I need to see this result as below.
134 144 07-OCT-11 13-OCT-11 134
134 144 08-OCT-11 13-OCT-11 134
134 144 09-OCT-11 13-OCT-11 134
134 144 10-OCT-11 13-OCT-11 134
134 144 11-OCT-11 13-OCT-11 134
134 144 12-OCT-11 13-OCT-11 134
134 144 13-OCT-11 13-OCT-11 134
I am looking at multilple optons.
I have a requirement like to retrieve past 6 months data and i have used below query.
select count(1) from event where trunc(start_datae) between trunc(sydate)-180 and trunc(sysdate);it is giving the results but am not sure whether it is giving correct data or not.If ran the above query it is taking more time to execute.
Is the above approach is correct? Is there any difference between trunc(sysdate)-180 and trunc(sysdate-180) ?
I want to retrieve the data based on the count.
Sample data
AccountSubAccountDate
11.12-Mar-10
11.23-Mar-10
11.34-Mar-10
11.42-Mar-10
11.56-Mar-10
21.67-Mar-10
21.78-Mar-10
21.82-Mar-10
3210-Mar-10
32.111-Mar-10
32.22-Mar-10
32.313-Mar-10
32.414-Mar-10
32.52-Mar-10
42.616-Mar-10
42.717-Mar-10
What i want is I want the data which account is having more than 5 subaccounts within the last one month. Also need data with other date criteria like last 100 days if more than10 sub accounts. need single query.
Output is :
3210-Mar-10
32.111-Mar-10
32.22-Mar-10
32.313-Mar-10
32.414-Mar-10
32.52-Mar-10
Having more than 8lacks in my database. i wrote the query but it is taking much time and didnt give the data even after 14 hours.
My query is :
select * from table a where account in
(select account from table b where b.subaccount=a.subaccount
and b.date>=sysdate-35
group by b.account having count(b.subaccount)>5)
union
select * from table a where account in
(select account from table b where b.subaccount=a.subaccount
and b.date>=sysdate-100
group by b.account having count(b.subaccount)>10)
how to retrieve the Subaccounts which satisfies my requirements.
I want if the user write for example in text box 'AM TK' the query display the resualt which has am alone tk alone, and that has both. I know that i should use the Like with % but i do not know how to write it in the set property. I have wrote
set_block_property('Employee_Other',default_where,'Upper(name) like '''||UPPER(:key_search.person_name)||'''') ;
This will bring the resualt just if the user write am tk. How i can modify it to return value as i explained above.
I am using Oracle 11g version
create table ORG(Name char(20),Datetime char(45),val1 number);
insert into ORGvalues('abc','10/29/2012 13:00','1.5')
insert into ORGvalues('abc','10/29/2012 13:05','1.5')
insert into ORGvalues('abc','10/29/2012 13:10','1.5')
insert into ORGvalues('abc','10/29/2012 13:15','1.5')
insert into ORGvalues('abc','10/29/2012 13:20','0.00')
insert into ORGvalues('abc','10/29/2012 13:25','0.00')
[code]....
while I am retrieving data between two dates. from table ORG. select from ORG where datetime between '29/03/2013' and '30/03/2013' order by datetime asc*
the output is coming like this,
O/P:
abc 29/03/2012 13:00 1.5
abc 29/03/2012 13:05 1.5
'abc 29/03/2012 13:10 1.5
'abc 30/03/2012 13:15 1.5'
'abc 30/03/2012 13:20 0.00
'abc 30/03/2012 13:25 0.00
[code]....
My problem in above out put is Here I am getting previous year data also at same day and month I want data only between the dates which are specified in query
But here needed output is
*'abc 29/03/2013 13:35 0.00*
*'abc 29/03/2013 13:40 2.1*
*'abc 30/03/2013 13:45 2.3*
*'abc 30/03/2013 13:50 2.1*
*'abc 31/03/2013 13:55 2.1*
*'abc 31/03/2013 14:00 2.2*
Note:my datetime datatype is char
My dear friends actually I am getting data like this date as a string(CHAR datatype) from third party tool.Due to this reason only I treat datetime attribute as string.
how to write this query using procedure and how it can display.
SELECT iusr_id,
so_curr_assign_to,
comp_id,
[Code]....
I'm extracting/retrieving the data from the oracle database using Java application it's bit slow. However, when I retrieve from the SQL server it's faster than oracle.
View 6 Replies View Relatedam learning about database block corruption and it's recovery. for practice purpose can we corrupt the block manually. i.e. can we do logical corruption.
View 8 Replies View Relatedhave a repeatable technique for damaging a datafile block?
I need to demonstrate and contrast various recovery techniques, such as dbms_repair, RMAN block recovery, and Data Guard automatic block repair.
I'll end up with a shell script (or batch file) where I can enter a file number and block number, and wipe out that block.
I've recently moved jobs and am doing a lot of the normal things getting familiar with my new company's databases.I was checking through our production backup logs and came across something that looks a little funny. From the last two days backups, I see:
select completion_time, marked_corrupt, media_corrupt, logically_corrupt
from v$backup_datafile
where controlfile_type = 'B'
order by completion_time desc
COMPLETION_TIME MARKED_CORRUPT MEDIA_CORRUPT LOGICALLY_CORRUPT
01/12/2011 11:27:252011 1201 2
01/12/2011 11:26:180 0 0
01/12/2011 11:25:242011 1201 1
01/12/2011 11:15:562011 1201 0
01/12/2011 01:40:100 0 0
30/11/2011 11:23:482011 1130 2
30/11/2011 11:22:440 0 0
30/11/2011 11:21:562011 1130 1
30/11/2011 11:13:002011 1130 0
30/11/2011 01:41:010 0 0
The 01:40 record will come from our nightly command:
BACKUP INCREMENTAL LEVEL=0 FILESPERSET=20 FORMAT 'full_%d_%t_%s_%p'
DATABASE INCLUDE CURRENT CONTROLFILE
The 11AM records will come from the command:
BACKUP INCREMENTAL LEVEL=0 FORMAT 'ctl_%t_%s_%p' CURRENT CONTROLFILE;
(I know backups shouldn't still be running at 11am and we don't need level 0 backups every night, that's a seperate issue I'll be addressing! ) I see there's been a similar entry here in v$backup_datafile for all backups that there's records for. The database is up and running just fine. There are no unusual errors being reported by the database in OEM or the alert log.I tried looking at both our control files (yes, should have 3 - something else I've listed to change!) with dbverify which showed no issues - though I'm not sure if this is designed to work with control files.
If so, how could I confirm whether it's an issue with a specific controlfile (I'm assuming it's not an issue with the backup to tape itself, as it's reporting the same corruption every day)?I'd obviously like to diagnose this now while the db is up and running, rather than at 4am some morning during a crash and finding out my backup control files are no good!
don't know if I can repeat it. It occured while converting a database to archivelog mode, after completing a Data Pump export/import upgrade from 11.1.0.7. I fixed it like this: juno> startup mount;
ORACLE instance started.
Total System Global Area 1.7108E+10 bytes
Fixed Size 2175440 bytes
Variable Size 8858373680 bytes
Database Buffers 8220835840 bytes
Redo Buffers 26886144 bytes
Database mounted.
juno> alter database archivelog; alter database archivelog
ERROR at line 1: ORA-19821: an intentionally corrupt log file was found
juno> recover database until cancel; Media recovery complete.
juno> alter database open resetlogs;
Database altered.
juno> shu immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
juno> startup mount;
ORACLE instance started.
[code]...
how can i corrupt a block to mock up BMR (block media recovery) workaround , I want to corrupt some block of Oracle seeded table "emp" within scott schema.
View 1 Replies View RelatedI'm using database 11g & restore backup from another location.
RMAN> RESTORE CONTROLFILE FROM '/u01/RMAN/forstandby_0acekubq_1_1';
RMAN> catalog start with '/u01/RMAN/';
RMAN> restore database;
channel ORA_DISK_1: reading from backup piece /u01/RMAN/forstandby_09ceku8r_1_1
channel ORA_DISK_1: ORA-19870: error while restoring backup piece /u01/RMAN/forstandby_09ceku8r_1_1
ORA-19599: block number 782 is corrupt in backup piece /u01/RMAN/forstandby_09ceku8r_1_1
failover to previous backup
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 10/23/2012 19:24:11
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore
I couldn't take backup of the RAC database archivelog.
RMAN> BACKUP VALIDATE DATABASE ARCHIVELOG ALL;
Starting backup at 24-MAR-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=+DG1/kvxcprd/datafile/system.260.777756857
input datafile fno=00003 name=+DG1/kvxcprd/datafile/sysaux.268.777756857
input datafile fno=00002 name=+DG1/kvxcprd/datafile/undotbs1.263.777756857
input datafile fno=00005 name=+DG1/kvxcprd/datafile/undotbs2.264.777756983
input datafile fno=00004 name=+DG1/kvxcprd/datafile/users.267.777756857
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=2 sequence=17 recid=26 stamp=810915691
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 03/24/2013 14:37:11
ORA-19599: block number 1985 is corrupt in archived log +FG/kvxcprd/archivelog/2013_03_24/thread_2_seq_17.269.810915689
RMAN> backup archivelog all;
Starting backup at 24-MAR-13
current log archived
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 03/24/2013 14:39:52
ORA-19563: header validation failed for file
i have an error with block corruption
Error: Corrupt block relative dba: 0x01c12a58 (file 7, block 76376)
What all the ,methods I can go for if we are working on a production environment with out any down time.
I can go for dbms repair package and restore and recover
I have this SQL that returns the correct amount of rows which should be 2:
Select Distinct A.File_Name, A.File_Desc, A.file_location,
A.location_date, A.downloaded_date, A.downloaded_id, A.file_size,
A.days_to_request, B.File_Name, B.Act_Date, B.date_loaded
from SDT_LOG A Inner Join ACTIVITY_LOG B
On A.file_name = B.file_name
and A.downloaded_date = B.date_loaded
I need to add another field in the Select query which is B.Act_Code. When I do, I get 2 extra rows. I do not know how to make these rows distinct.
The A table's structure is along with sample data for 1st record:
CODE Example of
Name Type 1st record.
---- ------- --------------
FILE_NAME VARCHAR2(50) STLMK.txt
FILE_DESC VARCHAR2(50) NON-RESIDENT
FILE_LOCATION VARCHAR2(50) L:\NonResFiles
YEAR NUMBER(4) 2008
LOCATION_DATE DATE 10/10/2007
DOWNLOADED_DATE DATE 09/04/2008 9:17:00 AM
DOWNLOADED_ID VARCHAR2(50) Cindy
FILE_SIZE CHAR(10) 16212
DAYS_TO_REQUEST NUMBER(3) 60
The B table's structure is along with sample data for 1st record:
CODE Example of
Name Type 1st record
---- ------ -----------
FILE_NAME VARCHAR2(50) STLMK.txt
ACT_CODE CHAR(2) D
ACT_DATE DATE 10/10/2007
ACTIVITY_ID VARCHAR2(50) downloaded on
DATE_LOADED DATE 09/04/2008 9:17:00 AM
The second record of activity would all be the same except Cindy would be "Jason", act_code would be an "S", activity_id would be "sent on" and then of course the dates would be changed to whenever the new information was saved within the system.
I am getting something like this (shortened of course):
CODEFile_name Downloaded_ID Act_Code
STLMK.txt Cindy D
STLMK.txt Cindy S
STLMK.txt Jason D
STLMK.txt Jason S
There should only be one row for Cindy with a D act_code and one row for Jason with an S act_code. For some reason, Cindy and Jason each get a row with the different act_code. I'm retrieving 4 rows instead of two when I use B.Act_Code in the SQL statement.
Cindy should have the D Act_Code because she downloaded that file name and Jason should have the S because he sent that file to someone else. Every time a file's activity changes, it is entered into the system so we can keep track of where the files are.
Cindy should have the D Act_Code because she downloaded that file name and Jason should have the S because he sent that file to someone else. Every time a file's activity changes, it is entered into the system so we can keep track of where the files are.
Also, I get the 2 extra rows when I add activity_id field to the select.
I use Oracle 10.
i have created two data blocks
First data data block contains a list item and a text item based on the selection of the list item and the value in the text item i need to retrieve more than one row in another data block whose NUMBER OF RECORDS DISPLAYED property are set to 10.
I have a Button in the first data block. So in the WHEN BUTTON PRESSED trigger i wrote SELECT INTO clause which is raising "exact fetch returns more than requested number of rows".Then i used a cursor in the WHEN-BUTTON-PRESSED trigger in the first block to fetch row by row and assign it to the items in second block. But i am able to retrieve only one record in the second block.
My table XXX has following records with data
ID AMOUNT ID_TYPE APPROVE_FLAG
A1 2 A N
B1 100 B N
A2 3 A N
A3 100 A Y
The Select Query should be..All the records should be considered and if the (amount is greater than 50 and approve_flag is N )then except that records all records should be considered.The output should be 3 rows; 2nd row (B1) should not come. writing a select statement for the above conditions.
first of all sample data;
create table test_circular_data(c1 varchar2(10),c2 varchar2(10));
insert into test_circular_data values ('c1','l2');
insert into test_circular_data values ('c1','l3');
insert into test_circular_data values ('c3','l3');
insert into test_circular_data values ('c4','l3');
commit;
There is a circular relation between columns c1 and c2, so what I'm trying to retrieve is something like that :
c1--> l2 --> l3 --> c3 --> c4
The steps to get that result is :
1.- c1 related to l2 : c1-->l2
2.- c1 related to l3 : c1-->l2-->l3
3.- l3 in the list and related to c3 : c1-->l2-->l3-->c3
4.- l3 in the list and related to c4 : c1-->l2-->l3-->c3-->c4
I have this SQL that returns the correct amount of rows which should be 2:
Select Distinct A.File_Name, A.File_Desc, A.file_location,
A.location_date, A.downloaded_date, A.downloaded_id, A.file_size,
A.days_to_request, B.File_Name, B.Act_Date, B.date_loaded
from SDT_LOG A Inner Join ACTIVITY_LOG B
On A.file_name = B.file_name
and A.downloaded_date = B.date_loaded
I need to add another field in the Select query which is B.Act_Code. When I do, I get 2 extra rows. I do not know how to make these rows distinct.
The A table's structure is along with sample data for 1st record:
Example of
Name Type 1st record.
---- ------- --------------
FILE_NAME VARCHAR2(50) STLMK.txt
FILE_DESC VARCHAR2(50) NON-RESIDENT
FILE_LOCATION VARCHAR2(50) L:NonResFiles
YEAR NUMBER(4) 2008
LOCATION_DATE DATE 10/10/2007
DOWNLOADED_DATE DATE 09/04/2008 9:17:00 AM
DOWNLOADED_ID VARCHAR2(50) Cindy
FILE_SIZE CHAR(10) 16212
DAYS_TO_REQUEST NUMBER(3) 60
The B table's structure is along with sample data for 1st record:
Example of
Name Type 1st record
---- ------ -----------
FILE_NAME VARCHAR2(50) STLMK.txt
ACT_CODE CHAR(2) D
ACT_DATE DATE 10/10/2007
ACTIVITY_ID VARCHAR2(50) downloaded on
DATE_LOADED DATE 09/04/2008 9:17:00 AM
The second record of activity would all be the same except Cindy would be "Jason", act_code would be an "S", activity_id would be "sent on" and then of course the dates would be changed to whenever the new information was saved within the system.
I am getting something like this (shortened of course):
File_name Downloaded_ID Act_Code
STLMK.txt Cindy D
STLMK.txt Cindy S
STLMK.txt Jason D
STLMK.txt Jason S
There should only be one row for Cindy with a D act_code and one row for Jason with an S act_code. For some reason, Cindy and Jason each get a row with the different act_code. I'm retrieving 4 rows instead of two when I use B.Act_Code in the SQL statement.
Cindy should have the D Act_Code because she downloaded that file name and Jason should have the S because he sent that file to someone else. Every time a file's activity changes, it is entered into the system so we can keep track of where the files are. Cindy should have the D Act_Code because she downloaded that file name and Jason should have the S because he sent that file to someone else. Every time a file's activity changes, it is entered into the system so we can keep track of where the files are.
Also, I get the 2 extra rows when I add activity_id field to the select.I use Oracle 10.
I have two blocks on which I am having relation based on booking number and employee code. As I am doing a query, booking number is getting fetched in employee code's field and employee code is getting fetched in booking number's feild. Because of this, I am not able to update the form. It is giving me error unable to update record unique contraint voilated for primary key which is quite obivious. But why the data could get shuffled in each others field though during inserting its going properly.
View 7 Replies View RelatedI want to retrieve the data from ex.tables. How to get this.
table1:
Account_No, Account_sub_No
1234 1
1234 2
1234 3
2345 4
2345 5
2345 6
2345 7
2345 8
................
Account_no is the primary key
table2:
Account_sub_No, Description
1 Hello
2 Hi
3 No.1
4 great
5 people
.................
8 world
..........................
Account_sub_No is primary key.
Out put:
I want the data like Account_no who is having more than 3 Account_sub_no values.
But in my case need to join these two tables with other tables. join field is Account_no from table1. there are no other fields to join.
I have a table of N records with: Name SeqNo ID Col4 ... ColX
where Name and ID are non-unique, and SeqNo is a monotonic non-consecutive sequence 0 .. N that is unique within ID..I'd like to generate the following 'groups': For each record where SeqNo = 0, sorted by Name, create the 'group where ID is the same, ordered by SeqNo irrespective of the
values of any of the other columns. For instance, if the table contained:
NameSeqNoIDCol4 ... ColX
RPL2975...
TLM0444...
AAB2801...
AZZ0801...
ABA3444...
KTT4975...
ABA1801...
YHG0975...
DEF1444...
I'd like to generate:
NameSeqNoIDCol4 ... ColX
AZZ0801...
ABA1801...
AAB2801...
TLM0444...
DEF1444...
ABA3444...
YHG0975...
RPL2975...
KTT4975...
I got my desired results by brute-forcing via four sub-queries:
Sub-query 1 - Generate the sorted Names with SeqNo = 0
Sub-query 2 - Expand above with the additional columns,
maintaining original order
Sub-query 3 - For each of the records from sub-query 2,
generate the 'dependents' having the same ID
and SeqNo != 0
Sub-query 4 - Expand above with the additional columns,
maintaining original order of sub-query 1
Main query - Create UNION of 2 and 4, sorting by original
order and SeqNo
if there were not a simpler approach - after all, this must be a fairly common issue when generating BOMs.
I'm writing a procedure that takes a table name as a parameter and I would like to print out the column name with the supporting row entry for each row. I know the logic I'd like to use, but how do you query the metadata to return the column names and store them.
View 3 Replies View Relatedselect *
from
table(it_count_tc('bbs_swe_tve_db'))
gives this output:
COLUMN_VALUE
------------
0
2
37
8
0
1
0
0
1
3
0
0
12 rows selected
BUT: what I what is like this
Jan Feb Mars April May ...
0 2 37 8 0 ...
it_count_tc is a function returning a varray of 12 integers input is a varchar2 string
I'm running a query using SQL Developer on a table which contains several companies names from many different countries, and one of the checks I need to make to ensure data consistency is to search for all rows which the name of company contains special or non-english characters (like ç, ã, ä as example).
I don't know what can I use to do this. I tried to collate using NLS_SORT but it didn't work.
Is there someway to select only the rows that contain these special or non-english characters, excluding from the results the rows that only have english characters? We have many languages in this table.
The field I would like to make the conditions on is VARCHAR2.
My operating system is Windows Xp Professional and the Oracle database version is 10.2.0.
My task is to export datas using export utility. Following are the steps I did in my sqlplus connecting to a database db2.
SQL> CONN / AS SYSDBA
Connected.
SQL> ALTER USER scott IDENTIFIED BY tiger ACCOUNT UNLOCK;
User altered.
SQL> CREATE OR REPLACE DIRECTORY test_dir AS '/u01/app/oracle/oradata/';
Directory created.
SQL> GRANT READ, WRITE ON DIRECTORY test_dir TO scott;
Grant succeeded.
SQL> expdp scott/tiger@db2 tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=expdpEMP_DEPT.log
I was not able to export the tables, resulting in the following error.
QUOTE SP2-0734: unknown command beginning "expdp scot..." - rest of line ignored.
What should I do to rectify the error?