SQL & PL/SQL :: Set MV As Incremental Refresh Option?
Aug 19, 2011i already created metalized view
now i want to set MV as incremental refresh option?
is it possible to set this attribute after mv created..?
i already created metalized view
now i want to set MV as incremental refresh option?
is it possible to set this attribute after mv created..?
How can i use refresh option as 1 hr in creation of materialized view, Can i use unoin all in the materialized view and other clause like CONNECT BY PRIOR .
View 22 Replies View RelatedI am getting ORA -32320 when I tried to fast fresh MVs that were truncated.I am able to complete refresh all MVs. However, some MVs are still giving me ORA-32320 when I try to do fast refresh even after complete refresh.
DBMS_MVIEW.EXPLAIN_PLAN says the MVIEW can be fast refreshed.
ERROR at line 1:
ORA-32320: REFRESH FAST of "dev"."Claim_line" unsupported after cointainer table
PMOPs
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 803
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 860
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 841
ORA-06512: at line 1
Quote:ORA-32320:
REFRESH FAST of "string"."string" unsupported after container table PMOPs Cause: A Partition Maintenance Operation (PMOP) has been performed on the materialized view, and no materialized view supports fast refersh after container table PMOPs. Action: Use REFRESH COMPLETE. Note: you can determine why your materialized view does not support fast refresh after PMOPs using the DBMS_MVIEW.EXPLAIN_MVIEW() API.
how to again make the MVs fast refreshable?
I have a stocking program , i need to use opening balance + debit-credit
In the beginning of my cursor then what ever the result i need to but it in a variable to used for the next record; i try many time but i failed
my statement look like this
opening balance 1000
receive used balance
-----------------------------------------------
0 50 950
0 100 850
100 0 1850
"If no level 0 backup is available, then the behavior depends upon the compatibility mode setting. If compatibility is >=10.0.0, RMAN copies all blocks changed since the file was created, and stores the results as a level 1 backup. In other words, the SCN at the time the incremental backup is taken is the file creation SCN. If compatibility <10.0.0, RMAN generates a level 0 backup of the file contents at the time of the backup, to be consistent with the behavior in previous releases."
So yes, that's it. Even in the Oracle 11g OCP course and exam, the information given is for Oracle 9 (pre 10g). Seems like a major functional regression.
------------------------------------------------------------------------------------------------------------------------------------------------
Original problem.
Am I not understanding something about rman????
Using oracle 10g standard edition and rman.
No existing backups.
When I run repeated level 1 cumulative incrementals, the appear to back up everything (like a level 0 would).
My understanding is that if a level 1 is run w/o an existing level 0 backup, it will generate a level 0 backup.
All subsequent level 1 backups should be level 1's as expected.
If I explicitly generate an level 0, followed by level 1's it all works as expected.
I am determining what got backed up by the size of the resulting save sets.
Do I have to do an explicit level 0 and then explicit level 1's? I thought not.
am having Oracle 9i RAC on IBM AIX .
I have large partitioned tables ( 4 partitions are added every month ). Is is possible to collect Incremental Statistics Gathering on these objects ( 9i ). If I collect stats with Ggranularity => ALL and ESTIMATE_PERCENT =100 the stats are accurate but it takes so much time .
One way may be to collect stats as Ggranularity => PARTITION for each new partition ( this quite fast ). but what about the Global Table Stats?
I have RMAN configured TO RECOVERY WINDOW OF 7 DAYS;I do a Level 0 backup on SAT, SUN-FRI I do a Level 1 (all to disk)
After I do a successful Level 0 backup, why would I need to keep Level 1 backups around on disk?I know the recovery window is 7 days but is there any way to remove the other 6 days of Level 1 backups after a successful Level 0?To me this seems like a waste of space since I have a succesful Level 0 or am I missing something?
I've got a physical standby (10g) which is missing some archive logs, and thus the managed recovery is stuck. I followed the procedure for taking an incremental backup of the primary from the last SCN in the standby, and then recovering the standby from that backup using rman.
It seemed that everything went according to the instructions, except that the "recover database" of the standby from the backup went much faster than I expected. Afterwards I checked the SCN of the standby (select current_scn from v$database) and it had indeed updated to a number beyond where it was stuck originally. The standby controlfile was restored from a backup of the primary's current controlfile, and the standby restarted. The problem is that when I started up standby recovery again, the standby is still looking for the logs which were missing. I can't figure out why! I've been googling around and digging through the docs, and the only clues I can find suggest that this would happen if the standby controlfile wasn't updated. But I did that.
We are going to implement oracle 11g. Now I wanna use rman to take the incremental backup in the follwing way:
Level-0 backup weekly, in the way:
run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
BACKUP incremental level 0 DATABASE
TAG 'Weekly_full' FORMAT 'E:RMAN_backupweekly_full_%d_%Y%M%D_s%s_p%p.bak';
backup archivelog all not backed up 1 times delete input
TAG 'Weekly_full_arc' FORMAT 'E:RMAN_backupweekly_full_arc_%d_%Y%M%D_s%s_p%p.bak';
[code].....
and RETENTION POLICY TO RECOVERY WINDOW is set to 10 days, so that there is no chance that i will delete expired backup before taking backup.
Now my question is,
1) Is the way is correct that there is no wrong configuration. My main concern is about archive log, is it correct?
2) As i am deleting archive log files with the backup and after that the expired archive log backup is also deleted, so is there any chance of failure in recovery.
3) here how archive log backup will work with 10 days retention policy.
We just purchased NAS (Raid5) unit to manage our data storage. I am planning to create a virtual partition on this nas device and use one partition for oracle data storage and another virtual partition will be used by other data (files and may be sqlserver data files....etc..)
We will have oracle installed on seperate oracle server. Can we use RMAN to manage incremental backups in this environment? May main worry point is that our data storage device will have many different type of datas and will we be able to tell RMAN to make backups only from certain virtual drives?
what is the difference between incremental and differential backup?
View 5 Replies View RelatedI have set the incremental stats for my partition table as it takes more than 20 min to gather , though the incremental is set to 'true' the table is getting analyzed completely.
View 3 Replies View Relatedafter i issue the following command,what checkpoint does it trigger?(full checkpoint or incremental checkpoint):
SQL> ALTE SYSTEM SWITCH LOGFILE;
As part of an incremental backup I recover copies of the tablespaces. These by default are stored in the disk backup location diskgroup. Is it possible to move these copies to another disk group / location whilst still backing up to the default disk backup location diskgroup. I know how to do it with the main datafiles but not with the copies.
e.g.
Current situation:
Original Datafiles in +DATA
Backups in +FRA
Recovered Datafile copies in +FRA
New setup to be:
Original Datafiles in +DATA
Backups in +FRA
Recovered Datafile copies in +BACKUP
In Oracle 11g/R2, I created replica of HR.Employees table & executed the following statement (+Although using SUM() function is non-logical in this case, but just testifying the result+)
STEP - 1
SELECT /+ RESULT_CACHE */ employee_id, first_name, last_name, SUM(salary)*
FROM HR.Employees_copy
WHERE department_id = 20
GROUP BY employee_id, first_name, last_name;
EMPLOYEE_ID FIRST_NAME LAST_NAME SUM(SALARY)
-------------------------------------------------------------------------------------------------------
202 Pat Fay 6000
201 Michael Hartstein 13000
Elapsed: 00:00:00.01
Execution Plan
----------------------------------------------------------
Plan hash value: 3837552314
--------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 2 | 130 | 4 (25)| 00:00:01 |
| 1 | RESULT CACHE | 3acbj133x8qkq8f8m7zm0br3mu | | | | |
| 2 | HASH GROUP BY | | 2 | 130 | 4 (25)| 00:00:01 |
|* 3 | TABLE ACCESS FULL | EMPLOYEES_COPY | 2 | 130 | 3 (0)| 00:00:01 |
Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
0 consistent gets
0 physical reads
0 redo size
*690* bytes sent via SQL*Net to client
416 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
2 rows processed
STEP - 2
INSERT INTO HR.employees_copy
VALUES(200, 'Dummy', 'User','Dummy.User@email.com',NULL, sysdate, 'MANAGER',5000, NULL,NULL,20);
STEP - 3
SELECT /*+ RESULT_CACHE */ employee_id, first_name, last_name, SUM(salary)
FROM HR.Employees_copy
WHERE department_id = 20
GROUP BY employee_id, first_name, last_name;
EMPLOYEE_ID FIRST_NAME LAST_NAME SUM(SALARY)
--------------------------------------------------------------------------------------------------
202 Pat Fay 6000
201 Michael Hartstein 13000
200 Dummy User 5000
Elapsed: 00:00:00.03
Execution Plan
----------------------------------------------------------
Plan hash value: 3837552314
--------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 3 | 195 | 4 (25)| 00:00:01 |
| 1 | RESULT CACHE | 3acbj133x8qkq8f8m7zm0br3mu | | | | |
| 2 | HASH GROUP BY | | 3 | 195 | 4 (25)| 00:00:01 |
|* 3 | TABLE ACCESS FULL| EMPLOYEES_COPY | 3 | 195 | 3 (0)| 00:00:01 |
Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
4 consistent gets
0 physical reads
0 redo size
*714* bytes sent via SQL*Net to client
416 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
3 rows processed
In the execution plan of STEP-3, against ID-1 the operation RESULT CACHE is shown which shows the result has been retrieved directly from Result cache. Does this mean that Oracle Server has Incrementally Retrieved the resultset?
Because, before the execution of STEP-2, the cache contained only 2 records. Then 1 record was inserted but after STEP-3, a total of 3 records was returned from cache. Does this mean that newly inserted row is retrieved from database and merged to the cached result of STEP-1?
If Oracle server has incrementally retrieved and merged newly inserted record, what mechanism is being used by the Oracle to do so?
Oracle database concepts 11gr2 manual states that "An incremental checkpoint is a type of thread checkpoint partly intended to avoid writing large numbers of blocks at online redo log switches. DBWn checks at least every three seconds to determine whether it has work to do. When DBWn writes dirty buffers, it advances the checkpoint position, causing CKPT to write the checkpoint position to the control file, but not to the data file headers."
As i have understand the DBWR write DIRTY BUFFER (that are under active checkpoint requests in the ACQ) to the datafiles from The Buffer Checkpoint Queues and after that the CKPT process may write the checkpoint RBA to the control files.[URL]...
The CKPT porcess write the chekpoint RBA to the controlfile after that the DBWR write the Dirty BUFFER in the datafiles, so as i understand at some point the datafiles containt block with higher RBA than the controle files. am i wrong ?
So if the instance craches before the CKPT record the chekpoint RBA in the controlfile what will be the recover behavior.Will the redo record be reapplied from the last recoded chekpoint RBA in the controlfile to the tail of the log ?
Here we have a dataguard environment with db1 as primary and db2 as physical standby database. We configured dataguard in 10g environments and we are not using grid control. What are the steps for configuring rman for incremental backups in this environment?
We want to schedule the backups to be taken in standby db, (that is applicable in case of switchover too). In the case of switchover to db2 what all do we need to do in rman manually to resume backups in db1?
7 of days ago Full backup has been taken to disk due to issues with tape devices.3 days ago tape devices have been fixed and we switched to CommVault managed tape backups. CommVault calls RMAN with following command:
run {
allocate channel ch1 type 'sbt_tape'
PARMS="SBT_LIBRARY=/usr/local/bin/simpana/Base/libobk.so,BLKSIZE=1048576,ENV=(CV_mmsApiVsn=2,CV_channelPar=ch1,ThreadCommandLine=BACKUP -jm 45 -a 2:71 -cl 9 -ins 9 -at 22 -j 294321 -jt 294321:4:1 -bal 1 -rcp 0 -ms 1 -data -ma 89 -cn oraclehost -vm Instance001)"
TRACE 0;
setlimit channel ch1 maxopenfiles 8;
backup
incremental level = 0
filesperset = 32
database
include current controlfile spfile ;
}
exit;
These backups done successfully.Then archivelog backup taken similar way.But when I issue RESTORE DATABASE PREVIEW SUMMARY; RMAN starts with Full backup set, though newer Incremental Level 0 ones are available.Why it does not use these newer ones?
Oracle 10.2.0.5 for Linux on IBM POWER
Any procedure which we can initiate an incremental backup without Level 0 backup.
View 9 Replies View RelatedI have a Primary database and Standby database both in ASM. Recently my archive logs got deleted and i am trying to recover my standby database with an incremental backup based on scn from primary database. But i face the below error when i recover the standby database with the incremental backup taken in primary database.
RMAN> recover database noredo;Starting recover at 06-NOV-13using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=21 device type=DISKchannel ORA_DISK_1: starting incremental datafile backup set restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00001: +STDBY/11gdb/datafile/system.258.805921881destination for restore of datafile 00002: +STDBY/11gdb/datafile/sysaux.259.805921967destination for restore of datafile 00003: +STDBY/11gdb/datafile/undotbs1.260.805922023destination for restore of datafile 00004: +STDBY/11gdb/datafile
[code]....
the rman backup script for weekly full backup and daily incremental backups with configure commands for oracle 11g database.
View 10 Replies View RelatedI want browse option in oracle forms.
View 3 Replies View RelatedWhat is the Best option for SQL/sybase server Temp table to use/for data manipulation (Insert/update/delete) inside the procedure in oracle Other then global temporary table.
Since we are porting from SQL/Sybase to Oracle we don't want to Create too many global temporary table.
Imagine I have the following scenario:
CREATE TABLE AAA_PLACE
(COD_PLACE NUMBER,
PLACE_NAME VARCHAR2(50 BYTE)
)
insert into AAA_PLACE (COD_PLACE, PLACE_NAME) values (1, 'Munich');
insert into AAA_PLACE (COD_PLACE, PLACE_NAME) values (2, 'Lisbon');
insert into AAA_PLACE (COD_PLACE, PLACE_NAME) values (3, 'Monaco');
insert into AAA_PLACE (COD_PLACE, PLACE_NAME) values (4, 'Madrid');
insert into AAA_PLACE (COD_PLACE, PLACE_NAME) values (5, 'Milan');
Imagine I want to retrieve those records in only 3 distinct rows, like this:
Munich
Madrid
Others
Is there any way I can do this with an simple Statement?
in many shopping cart applications they are providing multiple filter option.
suppose filter by brand,fitler by price ranges,filter by color,filter by shape etc..
so how they are achieving the performance.because lot of filter if applied then it should get slow execution.
how to achieve this.I tried as follows.
alter session set nls_date_format = 'dd-MON-yy';
CREATE OR replace PROCEDURE Multiple_filter (p_empno VARCHAR2,
p_ename VARCHAR2,
p_from_hiredate DATE,
p_to_hiredate DATE)
[Code]....
I am using 11.2.0.2 database.
I got ORA-14074 error says that if you have a MAXVALUE already you will need to either drop the partition that encompasses the MAXVALUE or split partition.So I want to use split partition option through the below statement,
alter table
tablename
split partition
partmax at (XXX)
into
(partition partXXX, partition partmax);
I am concerned about the existing data in the table will it by any change gets deleted, and what about indexes, do I have to rebuild, etc.I have to do this on produciton. I cannot test this as I don't have a test environment and moreover the table is having 70 million records and we don't have time/hardware resources to recreate this by export import in another database.
Just a general query on parallel query. My customer having 4 cpus and running the database in 11.2.0.3 in AIX 5.3(One is in AIX 6.1). Under which circumstances, we can propose to user parallel query options.
View 2 Replies View RelatedI want to know what syntax I should use for encoding option with loadjava command?
here is the scenario--
Our oracle database is already compatible with UTF-8 characters i.e. charset encoding is set as 'AL32UTF8'. I am able to save Chinese characters in the database however when I trigger a stored procedure which eventually use a loaded java class I get an error.
I am suggested to provide -encoding option while running 'loadjava' command but I don't know what syntax I should provide for 'UTF8' encoding.
create or replace p_aggop(dno number, maxi number,mini number,avgi number,tot number,cnt number) is
cursor c1 is select * from emp1 WHERE DEPTNO=dno GROUP BY DEPTNO;
v_emp1 c1%rowtype;
begin
open c1;
loop
fetch c1 into v_emp1;
select min(v_emp1.sal),max(v_emp1.sal),avg(v_emp1.sal),sum(v_emp1.sal),count(*) into mini,maxi,avgi,tot,cnt from v_emp1;
exit when c1%notfound;
Dbms_output.put_line('EXECUTED ');
end loop;
dbms_output.put_line('The minimum salaray in dept is :'||v_emp1.mini);
dbms_output.put_line('The maximum salaray in dept is :'||v_emp1.maxi);
dbms_output.put_line('The average salaray in dept is :'||v_emp1.avgi);
dbms_output.put_line('The total salaray in dept is :'||v_emp1.tot);
dbms_output.put_line('The total members in dept is :'||v_emp1.cnt);
CLOSE C1;
end;
I am creating a stored procedure to create a table during run time using 3 passed in parameters to build the table name. Oracle is giving me the ORA-00922 missing or invalid operation error message on the EXECUTE IMMEDIATE statement of my stored procedure. I am new to writing stored procedures in Oracle. I am pasting a copy of the stored procedures. I have also changed the names of the field names to be generic so I can post the code in this forum.
CREATE OR REPLACE PROCEDURE createTable(PARAMETER1 in string, PARAMETER2 in string, PARAMETER3 in string) IS
TABLE_NAME NVARCHAR2(50);
QUERY_STRING LONG;
BEGIN
[Code]....