"block change tracking" equivalent in sql server
Hi All,
If someone has expertise in both oracle and sql server, pls let me know if there is " block change tracking" equivalent in sql server. I know sql server has incremental/differential backup, curious to know whether it got this equivalent feature.
Regards,
Satheesh Shanmugam
http://borndba.com
May be the below link will help you:
http://www.databasejournal.com/features/mssql/article.php/3824196/Introducing-Change-Tracking-in-SQL-Server-2008.htm
Similar Messages
-
Change Tracking System in SQL Server 2012
Hi,
I have enabled change tracking to one of the database with retention period 1 day and auto clean is true. As per this setting changed data of one day old should get cleaned up automatically. But i am able to see 4 days
old data also using CHANGETABLE function. Let me know is there any other setting or is this an issue in SQL server 2012 which quires some patch?
SQL Server configuration: SQL Server 2012, Enterprise Edition, 64 bit.
Thanks in advance for the support.
Aruna Veluruplease paste out:
select * from sys.change_tracking_databases -
Oracle equivalent to SQL Server Table Variables ?
Does Oracle have anything equivalent to SQL Server table variables, that can be used in the JOIN clause of a select statement ?
What I want to do is execute a query to retrieve a two-column result, into some form of temporary storage (a collection ?), and then re-use that common data in many other queries inside a PL/SQL block. I could use temporary tables, but I'd like to avoid having to create new tables in the database, if possible. If I was doing this in SQL Server, I could use a table variable to do this, but is there anything similar in Oracle ? SQL Server example:
use Northwind
DECLARE @myVar TABLE(CustomerID nchar(5), CompanyName nvarchar(40))
INSERT INTO @myVar(CustomerID, CompanyName)
select CustomerID, CompanyName
from Customers
--Join the variable onto a table in the database
SELECT *
FROM @myVar mv join Customers
on mv.CompanyName = Customers.CompanyName
The closest I've found in Oracle is to use CREATE TYPE to create new types in the database, and use TABLE and CAST to convert the collection to a table, as shown below. I can't see anyway without creating new types in the database.
CREATE TYPE IDMap_obj AS Object(OldID number(15), NewID number(15));
CREATE TYPE IDMap_TAB IS TABLE OF IDMap_obj;
DECLARE
v_Count Number(10) := 0;
--Initialize empty collection
SourceIDMap IDMap_TAB := IDMap_TAB();
BEGIN
--Populate our SourceIDMap variable (dummy select statement for now).
FOR cur_row IN (select ID As OldID, ID + 10000000 As NewID From SomeTable) LOOP
SourceIDMap.extend;
SourceIDMap(SourceIDMap.Last) := IDMap_obj(cur_row.OldId, cur_row.NewId);
END LOOP;
--Print out contents of collection
FOR cur_row IN 1 .. SourceIDMap.Count LOOP
DBMS_OUTPUT.put_line(SourceIDMap(cur_row).OldId || ' ' || SourceIDMap(cur_row).NewId);
END LOOP;
--OK, can we now use our collection in a JOIN statement ?
SELECT COUNT(SM.NewID)
INTO v_Count
FROM SomeTable ST JOIN
TABLE(CAST(SourceIDMap As IDMap_TAB)) SM
ON ST.ID = SM.OldID;
DBMS_OUTPUT.put_line(' ' );
DBMS_OUTPUT.put_line('v_Count is ' || v_Count);
END;Hi, got this from our plsql guys:
The term "table function" is a bit confusing here. In Oracle-speak, it means a function that can be used in the from list of a select statement thus:
select * from Table(My_Table_Function()),..
where...
The function's return type must be a collection that SQL understands. So for the interesting case -- mimicking a function with more than one column -- this would be a nested table of ADTs where both the ADT and the nested table are defined at schema level. PL/SQL -- by virtue of some clever footwork -- allows you to declare the type as a nested table of records where both these types are declared in a package spec. This alternative is generally preferred, especially because the nested table can be of Some_Table%rowtype (or Some_Cursor%rowtype if you prefer).
As I understand it from our man on the ANSI committee, our use terminology follows the standard.
The construct below seems to be a bit different (though there are similarities) because it appears from your code sample that it's usable only within procedural code. And the object from which you select is a variable rather than a function.
So, after that preamble... the answer would be:
No, we don't have any constructs to let you "declare" something that looks like a regular schema-level table as a PL/SQL variable -- and then use (static) SQL on it just as if it were a schema-level table.
But yes, you can use PL/SQL's pipelined table function to achieve much of the same effect.
Look at the attached Table_Function.sql.
It shows that you can populate a collection of records using ordinary PL/SQL code. You can't use SQL for insert, update, or delete on such a collection. I see that SQL Server lets you do
insert into Program_Variable_Table select... from Schema_Level_Table
The PL/SQL equivalent would be
select...
bulk collect into Program_Variable_Collection
from Schema_Level_Table
The attached shows that once you have populated your collection, then you can then query it with regular SQL -- both from inside PL/SQL code and from naked SQL.
and the code is here
CONNECT System/p
-- Drop and re-create "ordinary" user Usr
EXECUTE d.u
CONNECT Usr/p
create table Schema_Things(ID number, Description Varchar2(80))
create package Pkg is
subtype Thing_t is Schema_Things%rowtype;
type Things_t is table of Thing_t; -- index by pls_integer
Things Things_t;
-- PLS-00630: pipelined functions must have
-- a supported collection return type
-- for "type Things_t is table of Thing_t index by pls_integer".
function Computed_Things return Things_t pipelined;
procedure Insert_Schema_Things(No_Of_Rows in pls_integer);
end Pkg;
create package body Pkg is
function Computed_Things return Things_t pipelined is
Idx pls_integer;
Thing Thing_t;
begin
Idx := Things.First();
while Idx is not null loop
pipe row (Things(Idx));
Idx := Things.Next(Idx);
end loop;
end Computed_Things;
procedure Insert_Schema_Things(No_Of_Rows in pls_integer) is
begin
Things := Things_t();
Things.Extend(No_Of_Rows);
for j in 1..No_Of_Rows loop
Things(j).ID := j;
Things(j).Description := To_Char(j, '00009');
end loop;
insert into Schema_Things
select * from Table(Pkg.Computed_Things());
end Insert_Schema_Things;
end Pkg;
-- Test 1.
begin Pkg.Insert_Schema_Things(100); end;
select * from Schema_Things
-- Test 2.
begin
Pkg.Things := Pkg.Things_t();
Pkg.Things.Extend(20);
for j in 1..20 loop
Pkg.Things(j).ID := j;
Pkg.Things(j).Description := To_Char(j, '00009');
end loop;
for j in 1..5 loop
Pkg.Things.Delete(5 +2*j);
end loop;
end;
select * from Table(Pkg.Computed_Things())
/ -
How to enable block change tracking with pfile
Hello
I want to use enable block change tracking (for fast incremental RMAN backup). kindly advice how can i use this parameter using pfile.
Thanks
KrishnaKrishna Agnihotri wrote:
Hello
I want to use enable block change tracking (for fast incremental RMAN backup). kindly advice how can i use this parameter using pfile.
You could have just tried ,
D:\app\aristadba\product\11.2.0\dbhome_1\database>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Aug 30 10:04:20 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup pfile=initorcl112.ora
ORACLE instance started.
Total System Global Area 263639040 bytes
Fixed Size 1373964 bytes
Variable Size 213911796 bytes
Database Buffers 41943040 bytes
Redo Buffers 6410240 bytes
Database mounted.
Database opened.
SQL> alter database enable block change tracking using file 'block';
Database altered.
SQL>Just to show that the file actually gets created,
SQL> alter database enable block change tracking using file 'block';
Database altered.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
D:\app\aristadba\product\11.2.0\dbhome_1\database>dir
Volume in drive D has no label.
Volume Serial Number is A408-F176
Directory of D:\app\aristadba\product\11.2.0\dbhome_1\database
08/30/2011 10:05 AM 11,600,384 BLOCK
05/17/2010 10:45 AM 2,048 hc_orcl112.dat
10/17/2009 01:35 PM 1,015 INITorcl.ORA
08/30/2011 10:01 AM 1,042 INITorcl112.ORA
12 File(s) 21,412,139 bytes
3 Dir(s) 17,036,451,840 bytes free
D:\app\aristadba\product\11.2.0\dbhome_1\database>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Aug 30 10:06:40 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter database disable block change tracking;
Database altered.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
D:\app\aristadba\product\11.2.0\dbhome_1\database>dir
Volume in drive D has no label.
Volume Serial Number is A408-F176
Directory of D:\app\aristadba\product\11.2.0\dbhome_1\database
08/30/2011 10:06 AM <DIR> .
08/30/2011 10:06 AM <DIR> ..
05/17/2010 08:55 AM <DIR> archive
05/17/2010 10:45 AM 2,048 hc_orcl112.dat
10/17/2009 01:35 PM 1,015 INITorcl.ORA
08/30/2011 10:01 AM 1,042 INITorcl112.ORA
12/22/2005 04:07 AM 31,744 oradba.exe
08/30/2011 09:05 AM 9,314 oradim.log
12/24/2009 08:09 PM 1,536 PWDorcl.ora
08/07/2011 11:00 PM 1,536 PWDorcl112.ora
04/15/2011 05:52 PM 9,748,480 SNCFORCL112.ORA
02/10/2011 09:00 PM 3,584 SPFILEORCL.ORA
08/30/2011 09:59 AM 3,584 SPFILEORCL112.ORA
02/10/2011 09:07 PM 7,872 upgrade.logAman....
Edited by: Aman.... on Aug 30, 2011 10:08 AM added 2nd code snippet -
Hello,
I have a Oracle 10.1.0.5.0 on Windows 2003. My need to enable block change tracking. So I login SQL PLUS as sysdba:
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE
'HOME/DB_INSTANCE/BLOCK_CHANGE.TRC';
ALTER DATABASE ENABLE
ERROR at line 1:
ORA-00439: feature not enabled: Block Change Tracking.
I have read some documentations and this is command I should use. Please help me where I can enable this feature.
Many thanks!According to the metalink note 271197.1, the fast incremental feature is not included in the Standard Edition.
As suggested earlier, check the Edition you are working on.
Nicolas. -
How to multiplex the block change tracking file?
Hi,
I have a question to change block tracking feture.
The normal way to enable block change tracking would be:
ALTER DATABASE ENABLE BLOCK CHANGE TRACKING
USING FILE 'mydir/change_track.f'
REUSE;
What if my harddrive is gone?
Is there anyway to define more than one destinitaion like for archive log files?The difference is... archive log files can contain irreplaceable data.
With Block Change Tracking the data is not irreplaceable , just run full RMAN backup and then regen the file. <- IMHO -
Oracle equivalent of SQL Server's "FOR XML" and "OPENXML"
Hi
Can someone please tell what are the Oracle's equivalent of SQL Server's "FOR XML" and "OPENXML" features?Probably you can try General XML forum General XML
Gints Plivna
http://www.gplivna.eu -
Enable Block Change Tracking in 11gr2
Hi Team,
If my database file system is in ASM..Can I enable blk change tracking in local filesystem?
Or IS it better to do in ASM? Any new features in 11gr2?
Regards,
ManoharDo you plan running DUPLICATE against that DB?
If yes, you should place the Block Change Tracking File in a location that would enable you to effectively deal with this nasty bug:
"Bug 10193846 - RMAN duplicate fails with ORA-19755 when BCT file is not accessible [ID 10193846.8]"
Also, If you plan to use DUPLICATE, you should “name” your Block Change Tracking File, rather than going with the system name.
This advice applied only for 11gR2 versions that are affected by the bug.
Iordan Iotzov
http://iiotzov.wordpress.com/
Edited by: Iordan Iotzov on Oct 2, 2012 7:19 AM -
Block change tracking file error
Hi,
when i selected
"enable block change tracking for faster incremental backups" option under Backup setting policy, and apply it, i get following error
error: "since the database area is not set you must specify a block change tracking file"
how can i fix this error.
1. is it better to provide a block change tracking file, if then how do i do it.
else
2.how can i set a database area
Thanks,
Philip.Hi Anita,
i have 2 more problems which i have explained below.
1. i am running my oracle 10g in linux and after starting the listener, when i try to start the database using
"dbstart" command, i get following error
"Failed to auto-start Oracle Net Listener using /ade/vikrkuma_new/oracle/bin/tnslsnr"
i really have no idea what is this error and how to solve this erorr. Can you please help me. i have also posted a separate forum for this with the heading as
"dbstart" command error
2. my tnsservice name works sometimes and some other times it does not work at all.
at sqlplus prompt when i login as
sys/pwd@orcl as sysdba
sometimes it works fine, other times it gives me error similar to -- protocol could not identify this service name.
Thanks,
Philip. -
RMAN block change tracking doubt
hi guys,
I want to speed up my RMAN incremental backup.So i decide to enable the block change tracking mechanism. How to implement it ? Should i create any file or set any parameters? plz guide me...
Oracle version:10.2.0.1.0
WindowsNT
TIA,ALTER DATABASE
ENABLE BLOCK CHANGE TRACKING
USING FILE os_file_name;
use this command on the database level. As soon as the file kept the data change tracking, u will speed up ur increamental backups. -
Block change tracking and Backup size
DB Version : 10gRelease
We have a Differential Incremental Backup strategy with Recovery Window retention policy. I haven't enabled BLOCK CHANGE TRACKING. Just would like to know if the backup size of both Level 0 and Level1 backups become smaller by enabling Block Change Tracking. Or is it just Level 1 backups' size which is going to decrease?
Thank you.An excerpt from Oracle RMAN 11g Backup and Recovery by Robert G. Freeman & Matthew Hart
ISBN: 978-0-07-162861-7
The Block Change Tracking File
By default, when doing an incremental backup, any datafile that has changed in any way will be
backed up. This can make incremental backups take longer and will make them larger. RMAN
offers the ability to just back up changed database blocks. +This can make your incremental+
+database backups much smaller and shorter.+ To enable block change tracking, issue the command
alter database enable block change tracking. The result of this command will be the creation of a
file called the block change tracking file (BCTF).Checkout the word smaller.
Two things:
A. This is not Official oracle documentation ( Oracle press though)
B. This book is about 11g. I don't know if BCTF makes backups smaller in 11G. -
How to change Rendering Extension in sql server Reporting Services based on User Permissions
Hi,
I want to provide SQL server reporting services rendering extension based on user Access.
For Example
User1 can have options of Rendering to EXCEL and PDF
User2 can have a option of CSV
i read one article which is useful for report basis rendering extension changes. but i want to give user basis rendering options.
http://www.mssqltips.com/sqlservertip/3569/how-to-change-rendering-extensions-in-sql-server-reporting-services/?utm_source=dailynewsletter&utm_medium=email&utm_content=headline&utm_campaign=20150406
Thanks in advance.
GVRSPK VENIYou can use a data driven subscription for that
Maintain a table with rendering extension information for various users ie their AD user login. Then setup a data driven subscription based on table values
You will be creating a dataset with query for retrieving userid as well as rendering extensions and then just set the value as Get value from database for render Format and To properties
For more details refer
http://beyondrelational.com/modules/2/blogs/101/posts/13460/ssrs-60-steps-to-implement-a-data-driven-subscription.aspx
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Sql is not working after changing from MsAccess into sql server
Following Sql is not working after changing from MsAccess into sql server.
sum(trn.sales) as sales,
sum(trn.cost) as cost,
sales - cost as profit // Here is not working . can we not use sales a column. Please advise
from trn
Kind Regards
pol
polachanIt will not work if use two different column from the table or column from two different table
Example
sum(trn.sales * trn.rate) as salesAmount,
sum(trn.cost) as cost,
sum(trn.salesAmount)-sum(trn.cost) as profit ----- Here is not working . can we not use sales a column. Please advise
from trn
Regards
polachan -
Change Data Capture in SQL Server
Post Author: rtamanji
CA Forum: Data Integration
I am having primary key constraint problems whenever there is a failure during the data flow from the source to the target, and I have to restart the process. It looks like check points only occurs if the data flows completely ends. How often are these check points initiated ? The AL table keeps track of this value, is there a similarly table to determine the last record read ? Or does DI reads the entire Repcmd table using the last xact_seqno stored ? Thanks for any information.It is not using triggers. The source is the transaction log.
Related link:
Basics of Change Data Capture
...The source of change data for change data capture is the SQL Server transaction log. As inserts, updates, and deletes are applied to tracked source tables, entries that describe those
changes are added to the log. The log serves as input to the change data capture capture process. This reads the log and adds information about changes to the tracked table’s associated change table. Functions are provided to enumerate
the changes that appear in the change tables over a specified range, returning the information in the form of a filtered result set. The filtered result set is typically used by an application process to update a representation of the source in some external
environment. ...
Kalman Toth, SQL Server & Business Intelligence Training; SQL Server 2008 Training -
Oracle DB equivalent of SQL Server's Simple Transaction Logging mode?
G'Day Experts !
Was wondering if Oracle DB has the functional equivalent of the 'simple' transaction logging available in SQL Server?
Would this be availabe at the schema level, or would it have to be the entire instance?
I'm asking because the WebCenter Interaction portal and related services has no practical use for point-in-time rollbacks. The portal uses discreet event boundaries which unfortunately do not map into the relational world.
Thanks!
Rob in VermontPlumtree wrote:
G'Day Experts !
Was wondering if Oracle DB has the functional equivalent of the 'simple' transaction logging available in SQL Server?
Would this be availabe at the schema level, or would it have to be the entire instance?
I'm asking because the WebCenter Interaction portal and related services has no practical use for point-in-time rollbacks. The portal uses discreet event boundaries which unfortunately do not map into the relational world.
Thanks!
Rob in VermontHi Rob
I assume you are referring to the simple recovery model, i.e lose everything since last backup. Oracle's equivalent of that is to run a database in NOARCHIVELOG mode. It applies to the database rather than the instance, though you probably intended database when you said instance.
Niall Litchfield
http://www.orawin.info/
Maybe you are looking for
-
How to access variables declared in java class file from jsp
i have a java package which reads values from property file. i have imported the package.classname in jsp file and also i have created an object for the class file like classname object=new classname(); now iam able to access only the methods defined
-
Multiple batches for a production order and mapping with components
Hello Gurus, Our business requires to create multiple batches for one production order + they want to trace which component in the production order has been issued to the main equipment. For example, I am creating production order for 'A' equipment f
-
How can i install on my MacBook Pro the adobe installer
How can I install adobe installer in my Mac ?
-
ITunes has detected an iPod in recovery mode loop
Hello, I have an Ipod 5 and during update of the OS to the latest, the process got an error. No my Ipod is in recovery mode. Everytime I download the Update (Restore and update) there is this constant pop up that comes up (iTunes has detected an iPod
-
I have a problem creating a pdf from within Firefox using the print to function.
I have a problem creating a PDF from within Firefox. I get an error message stating that Adobe PDF creation cannot continue because Acrobat is not activated. Acrobat Pro then opens. If it try to create the PDF again, the same problem. I have FF ver 3