oracle11g

Oracle数据恢复情景2-模拟redo log丢失(3)

风流意气都作罢 提交于 2019-12-07 15:26:51
在Oracle数据恢复情景2的前两篇中,我模拟的情况都是删除current redo log,基本上都是删除部分的redo logs,如果将DB中的所有redo logs全部删除呢? DB version: Release 11.2.0.2.0 1.查看online redo logs SQL> select t1.GROUP#,t1.MEMBER,t1.TYPE,t2.STATUS,t2.bytes from v$logfile t1,v$log t2 where t1.GROUP#=t2.GROUP#; GROUP# MEMBER TYPE STATUS BYTES ------ ---------------------------------------- -------- -------- ---------- 3 /opt/oracle/oradata/ora/redo03.log ONLINE CURRENT 52428800 2 /opt/oracle/oradata/ora/redo02.log ONLINE INACTIVE 52428800 1 /opt/oracle/oradata/ora/redo01.log ONLINE INACTIVE 52428800 2.删除数据 SQL> @del.sql SQL> select count(1) from

How to reverse a string in Oracle (11g) SQL without using REVERSE() function

谁说胖子不能爱 提交于 2019-12-07 15:18:56
问题 I am trying to reverse a string without using REVERSE function. I came across one example which is something like: select listagg(letter) within group(order by lvl) from (SELECT LEVEL lvl, SUBSTR ('hello', LEVEL*-1, 1) letter FROM dual CONNECT BY LEVEL <= length('hello')); Apart from this approach,is there any other better approach to do this? 回答1: If you're trying to avoid the undocumented reverse() function you could use the utl_raw.reverse() function instead, with appropriate conversion

What data structure to use in order to sort this data in PL/SQL?

↘锁芯ラ 提交于 2019-12-07 15:05:17
问题 This is Oracle 11.2g. In a PL/SQL function, I've got a loop whereby each iteration, I create a string and an integer associated with that string. The function returns the final concatenation of all the generated strings, sorted (depending on a function input parameter), either alphabetically or by the value of the integer. To give an idea, I'm generating something like this: Iteration String Integer 1 Oslo 40 2 Berlin 74 3 Rome 25 4 Paris 10 If the input parameter says to sort alphabetically,

Oracle SQL unsigned integer

女生的网名这么多〃 提交于 2019-12-07 13:59:55
问题 In Oracle, what is the equivalent to MySQL's UNSIGNED? I have the following query, only it doesn't work: CREATE TABLE foo ( id INT UNSIGNED NOT NULL PRIMARY KEY ); Edit: My purpose is to save space, because for some fields I won't be using negative values. Alternatively, it would answer my question of someone confirms that what I'm asking for is impossible in Oracle 11g, or if it's possible, but not straightforward to do (more than 3 lines of code per unsigned int). Also, It's not necessarily

Oracle NLS_DATE_FORMAT not working properly

情到浓时终转凉″ 提交于 2019-12-07 13:44:29
In my application I am setting the NLS_DATE_FORMAT of the session to format all dates returned by the program using the following command: alter session set nls_date_format='DY DDTH MON YYYY'; This should return the date like this: 'Fri 23rd Aug 2013' However, if I run the following query: select SYSDATE from dual; I get the date in the following format: 'FRI 23 AUG 2013'. Notice the lack of the 'rd' after '23'. If I run the following query: select to_char(sysdate, 'DY DDTH MON YYYY') from dual; The date does come back in the desired format. So why does the 'TH' date format parameter not work

When does an Oracle Package Specification become INVALID

南楼画角 提交于 2019-12-07 11:10:46
问题 As far as I know a package body can be replaced and recompiled without affecting the specification. A package specification declares procedures and functions, not defines them, so they can not reference objects, that can make the package specification INVALID. I know that a package specification can reference objects when it uses stand-alone subprograms and other packages to define it's variables. In this case changing referenced objects may cause the specification invalidation. Is there any

How to get rid of NUL characters in Oracle database?

假装没事ソ 提交于 2019-12-07 11:02:45
问题 The database : I have a Oracle11g database with a table that contains about 10 million rows and has about 40 columns. The data originates from punched card age and has been transformed from one Oracle version to the next several times. This is a live production database and in somewhat continuous use. But it's not so critical (especially during night time) that I could not strain it with expensive queries and updates. So that's ok. edit: Charset is AL32UTF8. The problem : I noticed that some

Table Name with more than 30 characters

为君一笑 提交于 2019-12-07 10:54:39
问题 I have a table in a MySQL database. The name of the table is more than 30 characters long and I want to make the same table in Oracle 11g, but Oracle only allows tables with a maximum of 30 characters in the name. I can't change the name of the table to make it less than 30 charachters, because the system is based on these tables, and it will cost me a lot if I change the name, so changing the table name is not the answer I am looking for. There is a table called user_tables , and when I

Can a table variable be used in a select statement where clause?

天大地大妈咪最大 提交于 2019-12-07 09:30:09
问题 I have a stored procedure that is doing a two-step query. The first step is to gather a list of VARCHAR2 type characters from a table and collect them into a table variable, defined like this: TYPE t_cids IS TABLE OF VARCHAR2(50) INDEX BY PLS_INTEGER; v_cids t_cids; So basically I have: SELECT item BULK COLLECT INTO v_cids FROM table_one; This works fine up until the next bit. Now I want to use that collection in the where clause of another query within the same procedure, like so: SELECT *

Oracle 11g Backward compatibility with older oracle releases

不羁岁月 提交于 2019-12-07 09:21:07
问题 Our organization is planning to upgrade its most of the oracle servers & clients to 11g Release 2. But one of our client system is still using oracle 8i installation. Can we able to access the objects of Oracle 8i from oracle 11g client? Some blogs says that it should work and other say it won't. Can anybody faced any issue with such configuration. One of the senior dba told us that oracle only supports backward compatibility of 2 versions earlier to current version. Assuming this fact we