Subscribe to Blog via Email
I did a couple great sessions yesterday for the awesome Dallas Oracle User Group, (DOUG.) It was the first time I did my thought leadership piece on Making Sense of the Cloud and it was a great talk, with some incredible questions from the DOUG attendees!
This points me to a great [older] post on things IT can do to help guarantee tech projects are more successful. DevOps is a standard in most modern IT shops and DBAs are expected to find ways to be part of this valuable solution. If you inspect the graph, displaying the value of different projects in ROI, vs. how often these different types of projects run over budget and time, it may be surprising.
Where non-software projects are concerned, the project rarely runs over the schedule, but in the way of benefits, often comes up short. When we’re dealing with software, 33% of project run over time, but the ROI is excruciatingly high and worthy of the investment. You have to wonder how much of that over-allocation in time feeds into the percentage increase in cost? If this could be deterred, think about how more valuable these projects would become?
The natural life of a database is growth. Very few databases stay a consistent size, as companies prosper, critical data valuable to the company requires a secure storage location and a logical structure to report on that data is necessary for the company’s future. This is where relational databases come in and they can become the blessing and the burden of any venture. Database administrators are both respected and despised for their necessity to manage the database environment as the health of the database is an important part of the IT infrastructure and with the move to the cloud, a crucial part of any viable cloud migration project.
How much of that time, money and delay shown in those projects are due to the sheer size and complexity of the database tier? Our source data shows how often companies just aren’t able to hold it together due to lacking skills, lacking estimates in time estimates and other unknowns that come back to bit us.
I can’t stress enough why virtualization is key to removing a ton of the overhead, time and money that ends up going into software projects that include a database.
Virtualizing non-production databases results in:
It’s definitely something to think about and if you don’t believe me, test it yourself with a free trial! Not enough people are embracing virtualization and it takes so much of the headache out of RDBMS management.
For over a year I’ve been researching cloud migration best practices. Consistently there was one red flag that trips me that I’m viewing recommended migration paths. No matter what you read, just about all of them include the following high level steps:
As we can see from above, the scope of the project is identified, requirements laid out and a project team is allocated.
The next step in the project is to choose one or more clouds, choose the first environments to test out in the cloud, along with security concerns and application limitations. DBAs are tested repeatedly as they continue to try to keep up with the demand of refreshing or ensuring the cloud environments are able to keep in sync with on-prem and the cycle continues until a cutover date is issued. The migration go or no-go occurs and the either non-production or all of the environment is migrated to the cloud.
As someone who works for Delphix, I focus on the point of failure where DBAs can’t keep up with full clones and data refreshes in cloud migrations or development and testing aren’t able to complete the necessary steps that could be if the company was using virtualization. From a security standpoint, I am concerned with how few companies aren’t investing in masking with the sheer quantity of breeches in the news, but as a DBA, there is a whole different scenario that really makes me question the steps that many companies are using to migrate to the cloud.
Now here’s where they loose me every time- the last step in most cloud migration plans is to optimize.
I’m troubled by optimization being viewed as the step you take AFTER you migrate to the cloud. Yes, I believe that there will undoubtedly be unknowns that no one can take into consideration before the physical migration to a cloud environment, but to take databases, “as is” when an abundance of performance data is already known about the database that could and will impact performance, seems to be inviting unwarranted risk and business impact.
So here’s my question to those investing in a cloud migration or have already migrated to the cloud- Did you streamline and optimize your database/applications BEFORE migrating to the cloud or AFTER?
I was in a COE, (Center of Excellence) meeting yesterday and someone asked me, “Kellyn, is your blog correct? Are you really speaking at a Blockchain event??” Yeah, I’m all over the technical map these days and you know what?
I love the variety of technology, the diversity of attendance and the differences in how the conferences are managed. Now that last one might seem odd and you might think that they’d all be similar, but its surprising how different they really are.
Today I’m going to talk about an aspect of conferences that’s very near to my heart, which is networking via events. For women in technology, there are some unique challenges for us when it comes to networking. Men have concerns about approaching women to network- such as fearful of accusations of inappropriate interaction and women have the challenge that a lot of networking opportunities occur outside of the workplace and in social situations that we may not be comfortable in. No matter who you are, no matter what your intentions, there’s a lot of wariness and in the end, women often just lose out when it comes to building their network. I’ve been able to breach this pretty successfully, but I have seen where it’s backfired and have found myself on more than one occasion defending both genders who’ve ended up on the losing side of the situation.
With that said, conferences and other professional events can assist with helping us geeks build our networks and it’s not all about networking events. I noticed a while back that the SQL Server community appeared to be more networked among their members. I believe part of this is due to the long history of their event software and some of its features.
Using the SQL Pass website, specifically the local user group event management software- notice that its all centralized. Unlike the significantly independent Oracle user groups, SQL Server user groups are able to use a centralized repository for their event management, speaker portal, scheduling, etc. It’s not to say that there aren’t any events outside of Pass Summit and SQL Saturdays, there’s actually a ton, but this was the portal for the regional user groups, creating the spoke that bridged out to the larger community.
Outside of submitting my abstract proposals to as many SQL Saturdays worldwide from one portal, I also can maintain one speaker biography, information about my blog, Twitter, Linkedin and other social media in this one location.
The second benefit of this simplicity, is that these biographies and profiles “feed” the conference schedules and event sites. You have a central location for management, but hundreds of event sites where different members can connect. After abstracts have been approved and the schedule built, I can easily go into an event’s schedule and click on each speaker biography and choose to connect with anyone listed who has entered their social media information in their global profile.
Using my profile as an example, you’ll notice the social media icons under my title are available with a simple click of the mouse:
This gives me both an easy way to network with my fellow speakers, but also an excuse to network with them! I can click on each one of the social media buttons and choose to follow each of the speakers on Twitter and connect with them on Linkedin. I send a note with the Linkedin connection telling the speaker that we’re both speaking at the event and due to this, I’d like to add them to my network.
As you can join as many regional and virtual user groups as you like, (and your Pass membership is free) I joined the three in Colorado, (Denver, Boulder and Colorado Springs.) Each one of those offers the ability to also connect with the board members using a similar method, (now going to use Todd and David as my examples from the Denver SQL Server user group.)
The Oracle user groups have embraced adding twitter links to most speaker bios and some board groups, but I know for RMOUG, many still hesitated or aren’t using social media to the extent they could. I can’t stress enough how impressed I am when I see events incorporate Linkedin and Twitter into their speaker and management profiles, knowing the value they bring to technical careers, networks and the community.
Although the SQL Server community is a good example, they aren’t the only ones. I’m also speaking at new events on emergent technologies, like Data Platforms 2017. I’ll be polite and expose my own profile page, but I’m told I’m easy to find in the sea of male speakers… 🙂 Along with my picture, bio and session information, there are links to my social media connections, allowing people to connect with me:
Yes, the Bizzabo software, (same software package that RMOUG will be using for our 2018 conference, along with a few other Oracle events this coming year) is aesthetically appealing, but more importantly, it incorporates important networking features that in the past just weren’t as essential as they are in today’s business world.
I first learned the networking tactic of connecting with people I was speaking with from Jeff Smith and I think its a great skill that everyone should take advantage of, no matter if you’re speaking or just attending. For women, I think it’s essential to your career to take advantage of opportunities to network outside of the traditional ways we’ve been taught in the past and this is just one more way to work around that glass ceiling.
I recently switched to a Mac after decades use with PCs. I loved my Surface Pro 4 and still do, but that I was providing content for those I thought would be on Macs, it seemed like a good idea at the time. I didn’t realize at the time I’d be doing as many SQL Server conferences as Oracle in my next role with the Delphix… 🙂
With this change, I found myself limited to VMs running on my Mac with SQL Server, then I was working with Azure and it seemed like a lot of extra “weight” to just have access to a few tools. I figured I wasn’t the only one and did some research, locating SQLPro for MSSQL from Hankinsoft. Its an easy to configure and use, 12Mb query interface, (also available from the App Store) that was created for SQL Server users that find themselves on Mac.
If you’re using Azure, you simply need to update our firewall rules to allow access for your local IP address and connection to the Azure SQL database is simple after this update, (and will need to be updated each time, if you’re like me and change locations, (and IP addresses each time.))
You can collect the information for your Azure database from the Azure administration Console, under Database and Overview:
This offers a very robust, full featured and comparable tool to Oracle’s SQL Developer for those that want to work with SQL Server databases but are on a Mac. I didn’t go into the features, but those, I leave to you right now to discover… 🙂
I’m itching to dig more into the SQL Server 2016 optimizer enhancements, but I’m going to complete my comparison of indices between the two platforms before I get myself into further trouble with my favorite area of database technology.
Index Organized Tables, (IOT) are just another variation of a primary b-tree index, but unlike a standard table with an index simply enforcing uniqueness, the index IS the table. The data is arranged in order to improve performance and in a clustered primary key state.
This is the closest to a clustered index in SQL Server that Oracle will ever get, so it makes sense that a comparison in performance and fragmentation is the next step after I’ve performed standard index and primary key index comparisons to Oracle.
Let’s create a new copy of our Oracle objects, but this time, update to an Index Organized Table:
CREATE TABLE ora_tst_iot( c1 NUMBER, c2 varchar2(255), CREATEDATE timestamp DEFAULT CURRENT_TIMESTAMP, CONSTRAINT pk_ora_iot PRIMARY KEY (c1)) ORGANIZATION INDEX TABLESPACE users PCTTHRESHOLD 20 OVERFLOW TABLESPACE users;
CREATE SEQUENCE C1_iot_SEQ START WITH 1; CREATE OR REPLACE TRIGGER C1_iot_BIR BEFORE INSERT ON ORA_TST_IOT FOR EACH ROW BEGIN SELECT C1_iot_SEQ.NEXTVAL INTO :new.C1 FROM DUAL; END; /
The PCTThreshold can be anywhere between 0-50, but I chose 20 for this example. I didn’t add any compression, as C1 is a simple sequence which won’t have the ability to take advantage of compression and I also added the additional support objects of a sequence and a trigger, just as I did for the previous test on the Oracle table.
Now we’ll insert the rows from ORA_INDEX_TST into ORA_TST_IOT
SQL> insert into ora_tst_iot(c2) select c2 from ora_index_tst; 995830 rows created. Elapsed: 00:00:04:01
There won’t be any fragmentation in the current table- it was directly loaded- no deletes, no updates. Although it won’t be shown in the examples, I will collect stats at regular intervals and flush the cache to ensure I’m not impacted in any of my tests.
SQL> ANALYZE INDEX PK_INDEXPS VALIDATE STRUCTURE; Index analyzed. Elapsed: 00:00:00.37 SQL> select index_name from dba_indexes 2 where table_name='ORA_TST_IOT'; INDEX_NAME ------------------------------ PK_ORA_IOT
SQL> analyze index pk_ora_iot validate structure; Index analyzed. SQL> analyze index pk_ora_iot compute statistics; Index analyzed. SQL> SELECT LF_BLKS, LF_BLK_LEN, DEL_LF_ROWS,USED_SPACE, PCT_USED FROM INDEX_STATS where NAME='PK_ORA_IOT'; 32115 7996 0 224394262 88
Well, the table IS THE INDEX. We collect stats on the table and now let’s remove some data, rebuild and then see what we can do to this IOT-
SQL> select * from ora_tst_iot 2 where c1=994830; 994830 SBTF02LYEQDFGG2522Q3N3EA2N8IV7SML1MU1IMEG2KLZA6SICGLAVGVY2XWADLZSZAHZOJI5BONDL2L 0O4638IK3JQBW7D92V2ZYQBON49NHJHZR12DM3JWJ1SVWXS76RMBBE9OTDUKRZJVLTPIBX5LWVUUO3VU VWZTXROKFWYD33R4UID7VXT2NG5ZH5IP9TDOQ8G0 10-APR-17 03.09.52.115290 PM SQL> delete from ora_tst_iot 2 where c1 >=994820 3 and c1 <=994830; 11 rows deleted. SQL> commit;
Now we see what the data originally looked like- C2 is a large column data that was consuming significant space.
What if we now disable our trigger for our sequence and reinsert the rows with smaller values for c2, rebuild and then update with larger values again?
ALTER TRIGGER C1_IOT_BIR DISABLE; INSERT INTO ORA_TST_IOT(C1,C2) VALUES (994820, 'A'); INSERT INTO ORA_TST_IOT(C1,C2) VALUES (994821, 'B'); INSERT INTO ORA_TST_IOT(C1,C2) VALUES (994822, 'C'); INSERT INTO ORA_TST_IOT(C1,C2) VALUES (994823, 'D'); INSERT INTO ORA_TST_IOT(C1,C2) VALUES (994824, 'E'); INSERT INTO ORA_TST_IOT(C1,C2) VALUES (994825, 'F'); INSERT INTO ORA_TST_IOT(C1,C2) VALUES (994826, 'G'); INSERT INTO ORA_TST_IOT(C1,C2) VALUES (994827, 'H');
so on and so forth till we reach 994830…
COMMIT and then let’s rebuild our table…
ALTER TABLE ORA_IOT_TST REBUILD;
What happens to the table, (IOT) when we’ve issued this command? It’s moving all the rows back to fill up each block up to the pct free. For an IOT, we can’t simply rebuild the index, as the index IS THE TABLE.
Now we’ve re-organized our IOT so the blocks are only taking up the space that it would have when it was first inserted into. So let’s see what happens now that we issue an UPDATE to those rows-
SQL> update ora_tst_iot set c2=dbms_random.string('B',200) 2 where c1 >=994820 3 and c1 <=994830; 11 rows updated.
So how vulnerable are IOTs to different storage issues?
Chained Rows after updating, moving data and then updating to larger data values than the first with 10% free on each block?
Just 11 rows shows the pressure:
SQL> SELECT 'Chained or Migrated Rows = '||value FROM v$sysstat WHERE name = 'table fetch continued row'; Chained or Migrated Rows = 73730
Let’s delete and update more rows using DML like the following:
SQL> delete from ora_tst_iot 2 where c2 like '%300%'; 4193 rows deleted.
Insert rows for 300 with varying degree of lengths, delete more, rinse and repeat and update and delete…
So what has this done to our table as we insert, update, delete and then insert again?
SQL> SELECT table_name, iot_type, iot_name FROM USER_TABLES WHERE iot_type IS NOT NULL; 2 TABLE_NAME IOT_TYPE IOT_NAME ------------------------------ ------------ ------------------------------ SYS_IOT_OVER_88595 IOT_OVERFLOW ORA_TST_IOT ORA_TST_IOT IOT
This is where a clustered index and an IOT is very different. There is a secondary management object involved when there is overflow. If you look up at my creation, yes, I chose to create an overflow. Even if I drop the IOT properly, the overflow table will go into the recycle bin, (unless I’ve configured the database without it.)
SQL> select index_name from dba_indexes 2 where table_name='ORA_TST_IOT'; INDEX_NAME ------------------------------ PK_ORA_IOT SQL> analyze index pk_ora_iot validate structure; Index analyzed. SQL> select blocks, height, br_blks, lf_blks from index_stats; BLOCKS HEIGHT BR_BLKS LF_BLKS ---------- ---------- ---------- ---------- 32768 3 45 32115
We can see, for the blocks, the rows per leaf blocks aren’t too many- this is a new table without a lot of DML, but we still see that with the current configuration, there aren’t a lot of rows returned per leaf block.
When we select from the IOT, the index is in full use and we can see that with the proper pct free/pct used, the index is still in pretty good shape:
SQL> select * from table(dbms_xplan.display_awr('fbhfmn88tq99z')); select c1, c2, createdate from ora_tst_iot Plan hash value: 3208808379 -------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time PLAN_TABLE_OUTPUT ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | | | 8709 (100)| | 1 | INDEX FAST FULL SCAN| PK_ORA_IOT | 995K| 206M| 8709 (1)| 00:01:4 5 | 13 rows selected.
SQL> analyze index pk_ora_iot validate structure; Index analyzed. SQL> SELECT blocks, height, br_blks, lf_blks FROM index_stats; BLOCKS HEIGHT BR_BLKS LF_BLKS ---------- ---------- ---------- ---------- 32768 3 45 32058 SQL> select pct_used from index_stats; PCT_USED ---------- 88
So now what happens, if like our original test, we shrink down the percentage of what can be used and reorganize, (and please don’t do this in production…or test….or dev….or ever! 🙂)?
SQL> alter table ora_tst_iot move pctfree 90; Table altered. SQL> analyze index pk_ora_iot validate structure; Index analyzed. SQL> SELECT blocks, height, br_blks, lf_blks FROM index_stats; BLOCKS HEIGHT BR_BLKS LF_BLKS ---------- ---------- ---------- ---------- 172928 3 228 165630
Well, that’s a few more leaf blocks, eh? Insert after enabling trigger again-
SQL> BEGIN FOR i in 1..1000000 LOOP INSERT INTO ORA_TST_IOT(c2) VALUES(i); END LOOP; COMMIT; END; /
Now we have our elapsed time for Azure inserts of 1 million records with 100% and 10%. Let’s compare it to our IOT. The IOT move command to fill the blocks to 100% was quite fast. Of course, the reverse, only allowing for 10%, (90% free) took F.O.R.E.V.E.R…, (OK, it sure felt like it…why didn’t I just truncate it? Oh, yeah, I wanted it to be a real test, not simply an easy test..)
Note: For this test, we’ll rebuild after updating the pctfree each time.
10% Fill Factor in SQL Server and 1 million insert: Elapsed time: 23 minutes, 18 seconds
90% PCTFree in Oracle and 1 million insert: 7 min, 12 seconds
100% Fill Factor in SQL Server and 1 million insert: Elapsed Time: 4 minutes, 43 seconds
0% PCTFree in Oracle and 1 million insert: 1 min, 8 seconds
REBUILD of the Oracle IOT to make it 90% free in each block? Elapsed Time: 8 hrs, 21 minutes, 12 seconds
…along with four backups of archive logs it generated that filled up the archive dest… 🙂 Now the AWS Trial is to be used to test out the Delphix product, not to test out index performance in a high insert/delete/update scenario, so I’ve been asking for some of these challenges, but it was still a great way to build this out quickly and then compare.
In this test, this was the overall results:
Now there’s more to do comparisons on, so I’m going to dig in more on the SQL Server side, but here’s to Oracle Index Organized Tables, (IOTs)!
This post has a lot of the support code and data for my Oak Table Talk that I’ll be giving at IOUG Collaborate 2017 in Las Vegas on April 5th, 2017.
One of the Iceland 2017 SQL Saturday sessions got me thinking about indexing and how similar and different it all is in Oracle vs. SQL Server. There was some really fun, (well, at least what I call fun…) test cases built out and referenced by Paul Randal. After looking through some of it, I decided it might be interesting to try to replicate it to Oracle, (as close as possible) and compare how the two database platforms deal with index storage and specifically- SQL Server’s Fill Factor vs. Oracle PctIncrease index percentage filled.
B-tree indexing is the cornerstone of physically optimizing searches on data. No consensus exists on what the “B” stands for, (some think its from Bayer, for one of the main gentlemen who did the research and many more believe it’s for Boeing, for the Research Center the research was done at.)
The choice in how the data is organized, leafs and such are pretty standard, but database platforms have created some unique indexing that enhances queries on RDBMS vs. just having heap tables.
Using Oracle and SQL Server as our choice for a comparison today, there are a few translations I need for readers of this blog:
|Index Organized Table, (IOT)||Clustered Index||physical index storing data in their key values. In SQL Server, there can be only one Clustered index per table.|
|Pctfree of block||FillFactor of page||Percent of storage that is allowed filled. There are different times when this is used for each platform.|
|Sequence||TOP||Ability to populate data with a sequential number|
|dbms_random.string||Replicate||Ability to populate data with string values|
|block||page||unit of storage|
|Automatic Workload Repository, (AWR)||Dynamic Management Views, (DMV)||Performance data collection|
Now that we have that out of the way, you can use this trusty, little graph for common terms that require a “translation” from one database platform to the other.
The next thing to remember is that PCTFree and FillFactor aren’t adhered to at all times. Appending a row to an index is different than updating a row in an index and each platform has it’s own set of criteria to decide if it follows the rule of percentage of a block or page to fill or not.
The steps of this test:
Yes, I could have just used RowNum, but I was trying to kill a second bird, (testing task) with this one stone, so an trigger with a sequence it is… 🙂
CREATE TABLE ORA_INDEX_TST ( C1 NUMBER NOT NULL ,C2 VARCHAR2(255) ,CREATEDATE TIMESTAMP ); CREATE INDEX PK_INDEXPS ON ORA_INDEX_TST (C1); ALTER TABLE ORA_INDEX_TST ADD CONSTRAINT OIT_PK PRIMARY KEY(C1) USING INDEX PK_INDEXPS; CREATE UNIQUE INDEX IDX_INDEXPS ON ORA_INDEX_TST(C2); ALTER INDEX PK_INDEXPS REBUILD PCTFREE 90 INITRANS 5; ALTER INDEX IDX_INDEXPS REBUILD PCTFREE 90 INITRANS 5; CREATE SEQUENCE C1_SEQ START WITH 1; CREATE OR REPLACE TRIGGER C1_BIR BEFORE INSERT ON ORA_INDEX_TST FOR EACH ROW BEGIN SELECT C1_SEQ.NEXTVAL INTO :new.C1 FROM DUAL; END; /
We’ll need to manually insert just enough data to fill up one block, which is 8KB in this database, (and default.)
INSERT INTO ORA_INDEX_TST (C2, CREATEDATE) VALUES (dbms_random.string('A', 200), SYSDATE); INSERT INTO ORA_INDEX_TST (C2, CREATEDATE) VALUES (dbms_random.string('B', 200), SYSDATE); INSERT INTO ORA_INDEX_TST (C2, CREATEDATE) VALUES (dbms_random.string('C', 200), SYSDATE); INSERT INTO ORA_INDEX_TST (C2, CREATEDATE) VALUES (dbms_random.string('D', 200), SYSDATE); INSERT INTO ORA_INDEX_TST (C2, CREATEDATE) VALUES (dbms_random.string('E', 200), SYSDATE); INSERT INTO ORA_INDEX_TST (C2, CREATEDATE) VALUES (dbms_random.string('F', 200), SYSDATE); INSERT INTO ORA_INDEX_TST (C2, CREATEDATE) VALUES (dbms_random.string('G', 200), SYSDATE); COMMIT;
We’ll now verify that our data is inserted into one block:
SQL> ANALYZE INDEX PK_INDEXPS VALIDATE STRUCTURE; SQL> SELECT LF_BLKS, LF_BLK_LEN, DEL_LF_ROWS,USED_SPACE, PCT_USED FROM INDEX_STATS where NAME='PK_INDEXPS';
LF_BLKS LF_BLK_LEN DEL_LF_ROWS USED_SPACE PCT_USED ---------- ---------- ----------- ---------- ---------- 1 7924 0 1491 19
Code for SQL Server Objects and Support. Since I didn’t have the same secondary project request, this one will appear simpler:
CREATE TABLE SQL_INDEX_TST (c1 INT NOT NULL, c2 CHAR (255), createdate datetime); CREATE INDEX CL2_INDEX_TST ON SQL_INDEX_TST(C2); GO ALTER TABLE SQL_INDEX_TST ADD CONSTRAINT PK_CLINDX_TST PRIMARY KEY CLUSTERED (c1); GO
First, in SQL Server, a page will hold around 8KB of data, so let’s test out our index storage:
INSERT INTO SQL_INDEX_TST(c1,c2) VALUES (1, 'a'); INSERT INTO SQL_INDEX_TST(c1,c2) VALUES (2, 'a'); INSERT INTO SQL_INDEX_TST(c1,c2) VALUES (3, 'a'); INSERT INTO SQL_INDEX_TST(c1,c2) VALUES (4, 'a'); INSERT INTO SQL_INDEX_TST(c1,c2) VALUES (5, 'a'); INSERT INTO SQL_INDEX_TST(c1,c2) VALUES (6, 'a'); INSERT INTO SQL_INDEX_TST(c1,c2) VALUES (7, 'a'); GO
We now have officially “filled” the first page as much as possible and we should see this if we query the information schema:
SELECT OBJECT_SCHEMA_NAME(ios.object_id) + '.' + OBJECT_NAME(ios.object_id) as table_name, i.name as index_name, leaf_allocation_count, nonleaf_allocation_count, fill_factor, type_desc FROM sys.dm_db_index_operational_stats(DB_ID(), OBJECT_ID('dbo.SQL_INDEX_TST'),NULL, NULL) ios INNER JOIN sys.indexes i ON i.object_id = ios.object_id AND i.index_id = ios.index_id;
SQL> Begin For IDS in 1..1000000 Loop INSERT INTO ORA_INDEX_TST (C2) VALUES (dbms_random.string('X', 200)); Commit; End loop; End; /
10% PCT Free- Time Elapsed 2 minutes, 12 seconds
90% PCT Free- Time Elapsed 7 minutes, 3 seconds
I’ll have both the initial test data and the new 10000 rows I’ve added:
SQL> select count(*) from ora_index_tst; COUNT(*) ---------- 1000008
Let’s delete some of this data load to create deleted leaf blocks:
SQL> delete from ora_index_tst 2 where c2 like '%200%'; 4179 rows deleted. SQL> commit; Commit complete.
Now let’s analyze and take a look at the stats again:
SELECT LF_BLKS, LF_BLK_LEN, DEL_LF_ROWS,USED_SPACE, PCT_USED FROM INDEX_STATS where NAME='PK_INDEXPS';
LF_BLKS LF_BLK_LEN DEL_LF_ROWS USED_SPACE PCT_USED ---------- ---------- ----------- ---------- ---------- 41227 7924 121 212596009 19
There’s a substantial difference in number of leaf blocks vs. when the pct_used is allowed to fill up:
LF_BLKS LF_BLK_LEN DEL_LF_ROWS USED_SPACE PCT_USED ---------- ---------- ----------- ---------- ---------- 2004 7996 531 15985741 100
Oracle wasn’t impacted by PCTFREE that much, but there was some impact. Rebuilds were required to clean up some wait, but it wasn’t a true “requirement”, just a preferences if consistent deletes, updates where data was different sized than original and poor storage choices. The differences in performance weren’t that significant.
Now that we know we have deleted rows, let’s do the same on the SQL Server side:
declare @id int select @id = 9 --already inserted 8 rows while @id >= 0 and @id <= 1000000 begin insert into sql_index_tst (c1,c2) values(@id, 'DKUELKJ' + convert(varchar(7), @id)) select @id = @id + 1 end
Default Fill Factor- Elapsed Time: 4 minutes, 43 seconds
10% Fill Factor- Elapsed time: 23 minutes, 18 seconds
Delete some rows to test similar to Oracle:
DELETE FROM SQL_INDEX_TST WHERE c2 LIKE ‘%200%’;
Now there are a few ways we can look at how the indexes were impacted. We’ll first check for page splits, which as we’ve discussed, cause extra work to the transaction log and fragmentation in the index:
SELECT OBJECT_SCHEMA_NAME(ios.object_id) + '.' + OBJECT_NAME(ios.object_id) as table_name ,i.name as index_name ,leaf_allocation_count ,nonleaf_allocation_count FROM sys.dm_db_index_operational_stats(DB_ID(), OBJECT_ID('dbo.SQL_Index_tst'),NULL, NULL) ios INNER JOIN sys.indexes i ON i.object_id = ios.object_id AND i.index_id = ios.index_id;
Next, we’ll look at the physical fragmentation of the index:
SELECT OBJECT_SCHEMA_NAME(ips.object_id) + '.' + OBJECT_NAME(ips.object_id) as table_name ,ips.avg_fragmentation_in_percent ,ips.fragment_count ,page_count FROM sys.dm_db_index_physical_stats(DB_ID(), OBJECT_ID('dbo.SQL_Index_tst') GO
There’s significant fragmentation and it also impacted performance as we viewed above.
USE AS_test; GO DBCC DBREINDEX ('SQL_INDEX_TST', CL2_INDEX_TST,100); DBCC DBREINDEX ('SQL_INDEX_TST', PK_CLINDX_TST,100); GO
We’ve now rebuilt our indexes and moved the fillfactor to 100%. Queries using each index column in where clause improved over 20%. Insert and updates increased to perform similarly to Oracle, unless….
Sorts on data for C1 column on a clustered index in SQL Server increased dramatically and out-performed Oracle’s PK. Only IOT tables could compete, but the use case was very small where it was beneficial.
So who won out in my comparison at Oak Table World? As we always hear from the DBA,
Some of the benefits of clustered indexes in SQL Server are superior to Oracle:
There are negatives that leave this debate still open for me:
There was a lot of other tests and queries I used than what is presented here, but this is the main focus of the test. I need to thank those that have contributed to the deep index knowledge that offered me the research to then want to research on my own. Shout out to Richard Foote, Mr. Oracle Index and Paul Randal and Jason Strate for the SQL Server expertise!
I ended up speaking at two events this last week. Now if timezones and flights weren’t enough to confuse someone, I was speaking at both an Oracle AND a SQL Server event- yeah, that’s how I roll these days.
I arrived last Sunday in Salt Lake, which is just a slightly milder weather and more conservative version of Colorado, to speak at UTOUG’s Spring Training Days Conference. I love this location and the weather was remarkable, but even with the warm temps, skiing was still only a 1/2 hour drive from the city. Many of the speakers and attendees took advantage of this opportunity by doing just that while visiting. I chose to hang out with Michelle Kolbe and Lori Lorusso. I had a great time at the event and although I was only onsite for 48hrs, I really like this event so close to my home state.
I presented on Virtualization 101 for DBAs and it was a well attended session. I really loved how many questions I received and how curious the database community has become about how this is the key to moving to the cloud seamlessly.
There are significant take-aways from UTOUG. The user group, although small, is well cared for and the event is using some of the best tools to ensure that they get the best bang for the buck. It’s well organized and I applaud all that Michelle does to keep everyone engaged. It’s not an easy endeavor, yet she takes this challenge on with gusto and with much success.
After spending Wednesday at home, I was back at the airport to head to Reykjavik, Iceland for their SQL Saturday. I’ve visited Iceland a couple times now and if you aren’t aware of this, IcelandAir offers up to 7 day layovers to visit Iceland and then you can continue on to your final destination. Tim and I have taken advantage of this perk on one of our trips to OUGN, (Norway) and it was a great way to visit some of this incredible country. When the notification arrived for SQL Saturday Iceland, I promptly submitted my abstracts and crossed my fingers. Lucky for me, Ásgeir Gunnarsson accepted my abstract and I was offered the chance to speak with this great SQL Server user group.
After arriving before 7am on Friday morning at Keflavik airport, I realized that I wouldn’t have a hotel room ready for me, no matter how much I wanted to sleep. Luckily there is a great article on the “I Love Reykjavik” site offering inside info on what to do if you do show up early. I was able to use the FlyBus to get a shuttle directly to and from my hotel, (all you have to do is ask the front desk to call them the night before you’re leaving and they’ll pick you back up in front of your hotel 3 hrs before your flight.) Once I arrived, I was able to check in my bags with their front desk and headed out into town.
I stayed at Hlemmur Square, which was central to the town and the event and next to almost all of the buses throughout the city. The main street in front of it, Laugavegur, is one of the main streets that runs East-West and is very walkable. Right across this street from the hotel was a very “memorable” museum, the Phallilogical Museum. I’m not going to link to it or post any pictures, but if you’re curious, I’ll warn you, it’s NSFW, even if it’s very, uhm…educational. It was recommended by a few folks on Twitter and it did ensure I stayed awake after only 2 hours of sleep in 24 hours!
As I wandered about town, there are a few things you’ll note about Iceland- the murals of graffiti is really awesome and Icelandic folks like good quality products- the stores housed local and international goods often made from wool, wood, quality metal and such. The city parliment building is easily accessible and it’s right across from the main shopping area and new city development.
On Saturday, I was quick to arrive at Iceland’s SQL Saturday, as I had a full list of sessions I wanted to attend. I was starting to feel the effects of Iceland weather on my joints, but I was going to make sure I got the most out of the event. I had connected with a couple of the speakers at the dinner the night before, but with jet lag, you hope you’ll make a better impression on the day of the event.
I had the opportunity to learn about the most common challenges with SQL Server 2016 and that Dynamic Data Masking isn’t an enterprise solution. Due to lacking discovery tools, the ability to join to non-masked objects and common values, (i.e. 80% of data is local and the most common location value would easily be identified, etc.) the confidential data of masked objects could be identified.
I also enjoyed an introduction to containers with SQL Server and security challenges. The opening slide from Andy says it all:
Makes you proud to be an American, doesn’t it? 🙂
My session was in the afternoon and we not only had excellent discussions on how to empower database environments with virtualization, but I even did a few quick demonstrations of ease of cloud management with AWS and Oracle…yes, to SQL Server DBAs. It was interesting to see the ease of management, but how easy it was for me to manage Oracle with the interface. I performed all validations of data refreshes from the command line, so there was no doubt that I was working in Oracle, yet the refreshes and such were done in AWS and with the Delphix Admin console.
I made it through the last session on the introduction to containers with SQL Server, which included a really interesting demonstration of a SQL Server container sans an OS installation, allowing it to run with very limited resource requirements on a Mac. After this session was over, I was thankful that two of my fellow presenters were willing to drop me off at my hotel and I promptly collapsed in slumber, ready to return home. I was sorry to miss out on the after event dinner and drinks, but learned that although I love Iceland, a few days and some extra recovery time may be required.
I thought I’d do something on Oracle this week, but then Microsoft made an announcement that was like an early Christmas present- SQL Server release for Linux.
I work for a company that supports Oracle and SQL Server, so I wanted to know how *real* this release was. I first wanted to test it out on a new build and as they recommend, along as link to an Ubuntu install, I created a new VM and started from there-
There were a couple packages that were missing until the repository is updated to pull universe by adding repository locations into the sources.list file:
There is also a carriage return at the end of the MSSQL installation when it’s added to the sources.list file. Remove this before you save.
Once you do this, if you’re chosen to share your network connection with your Mac, you should be able to install successfully when running the commands found on the install page from Microsoft.
The second install I did was on a VM using CentOS 6.7 that was pre-discovered as a source for one of my Delphix engines. The installation failed upon running it, which you can see here:
Even attempting to work around this wasn’t successful and the challenge was that the older openssl wasn’t going to work with the new SQL Server installation. I decided to simply upgrade to CentOS 7.
The actual process of upgrading is pretty easy, but there are some instructions out there that are incorrect, so here are the proper steps:
[upgrade] name=upgrade baseurl=http://dev.centos.org/centos/6/upg/x86_64/ enabled=1 gpgcheck=0
Save this file and then run the following:
yum install preupgrade-assistant-contents redhat-upgrade-tool preupgrade-assistant
You may see that one has stated it won’t install as newer ones are available- that’s fine. As long as you have at least newer packages, you’re fine. Now run the preupgrade
The log final output may not write, also. If you are able to verify the runs outside of this and it says that it was completed successfully, please know that the pre-upgrade was successful as a whole.
Once this is done, import the GPG Key:
rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
After the key is imported, then you can start the upgrade:
/usr/bin/redhat-upgrade-tool-cli --force --network 7 --instrepo=http://mirror.centos.org/centos/7/os/x86_64
Once done, then you’ll need to reboot before you run your installation of SQL Server:
Once the VM has cycled, then you can run the installation using the Redhat installation as root, (my delphix user doesn’t have the rights and I decided to have MSSQL installed under root for this first test run):
curl https://packages.microsoft.com/config/rhel/7/mssql-server.repo > /etc/yum.repos.d/mssql-server.repo
Now run the install:
sudo yum install -y mssql-server
Once its completed, it’s time to set up your MSSQL admin and password:
One more reboot and you’re done!
You should then see your SQL Server service running with the following command:
systemctl status mssql-server
You’re ready to log in and create your database, which I’ll do in a second post on this fun topic.
OK, you linux fans, go MSSQL! 🙂
OK, so I’m all over the map, (technology wise) right now. One day I’m working with data masking on Oracle, the next it’s SQL Server or MySQL, and the next its DB2. After almost six months of this, the chaos of feeling like a fast food drive thru with 20 lanes open at all times is starting to make sense and my brain is starting to find efficient ways to siphon all this information into the correct “lanes”. No longer is the lane that asked for a hamburger getting fries with hot sauce… 🙂
One of the areas that I’ve been spending some time on is the optimizer and differences in Microsoft SQL Server 2016. I’m quite adept on the Oracle side of the house, but for MSSQL, the cost based optimizer was *formally* introduced in SQL Server 2000 and filtered statistics weren’t even introduced until 2008. While I was digging into the deep challenges of the optimizer during this time on the Oracle side, with MSSQL, I spent considerable time looking at execution plans via dynamic management views, (DMVs) to optimize for efficiency. It simply wasn’t at the same depth as Oracle until the subsequent releases and has grown tremendously in the SQL Server community.
As SQL Server 2016 takes hold, the community is starting to embrace an option that Oracle folks have done historically- When a new release comes out, if you’re on the receiving end of significant performance degradation, you have the choice to set the compatibility mode to the previous version.
I know there are a ton of Oracle folks out there that just read that and cringed.
Compatibility in MSSQL is now very similar to Oracle. We allocate the optimizer features by release version value, so for each platform it corresponds to the following:
|Oracle||12c release 2||22.214.171.124.0|
SQL Server has had this for some time, as you can see by the following table:
|Product||Database Engine Version||Compatibility Level Designation||Supported Compatibility Level Values|
|SQL Server 2016||13||130||130, 120, 110, 100|
|SQL Database||12||120||130, 120, 110, 100|
|SQL Server 2014||12||120||120, 110, 100|
|SQL Server 2012||11||110||110, 100, 90|
|SQL Server 2008 R2||10.5||105||100, 90, 80|
|SQL Server 2008||10||100||100, 90, 80|
|SQL Server 2005||9||90||90, 80|
|SQL Server 2000||8||80||80|
These values can be viewed in each database using queries for the corresponding command line tool.
SELECT name, value, description from v$parameter where name='compatible';
Now if you’re in database 12c and multi-tenant, then you need to ensure you’re correct database first:
ALTER SESSION SET CONTAINER = <pdb_name>; ALTER SYSTEM SET COMPATIBLE = '126.96.36.199.0';
SELECT databases.name, databases.compatibility_level from sys.databases GO ALTER DATABASE <dbname> SET COMPATIBILITY_LEVEL = 120 GO
How many of us have heard, “You can call it a bug or you can call it a feature”? Microsoft has taken a page from Oracle’s book and refer to the need to set the database to the previous compatibility level as Compatibility Level Guarantee. It’s a very positive sounding “feature” and for those that have upgraded and are suddenly faced with a business meltdown due to a surprise impact once they do upgrade or simply from a lack of testing are going to find this to be a feature.
So what knowledge, due to many years of experience with this kind of feature, can the Oracle side of the house offer to the MSSQL community on this?
I think anyone deep into database optimization knows that “duct taping” around a performance problem like this- by moving the compatibility back to the previous version is wrought with long term issues. This is not addressing a unique query or even a few transactional processes being addressed with this fix. Although this should be a short term fix before you launch to production, [we hope] experience has taught us on the Oracle side, that you have databases that exist for years in a different compatibility version than the release version. Many DBAs have databases that they are creating work arounds and applying one off patch fixes for because the compatibility either can’t or won’t be raised to the release version. This is a database level way of holding the optimizer at the previous version. The WHOLE database.
You’re literally saying, “OK kid, [database], we know you’re growing, so we upgraded you to latest set of pants, but now we’re going to hem and cinch them back to the previous size.” Afterwards we say, “Why aren’t they performing well? After all, we did buy them new pants!”
So by “cinching” the database compatibility mode back down, what are we missing in SQL Server 2016?
Now there is a change I don’t like, but I do prefer how Microsoft has addressed it in the architecture. There is a trace flag 2371 that controls, via on or off, if statistics are updated at about 20% change in row count values. This is now on by default with MSSQL 2016 compatibility 130. If it’s set to off, then statistics at the object level aren’t automatically updated. There are a number of ways to do this in Oracle, but getting more difficult with dynamic sampling enhancements that put the power of statistics internal to Oracle and less in the hands of the Database Administrator. This requires about 6 parameter changes in Oracle and as a DBA who’s attempted to lock down stats collection, its a lot easier than said. There were still ways that Oracle was able to override my instructions at times.
There is also a flag to apply hot fixes which I think is a solid feature in MSSQL that Oracle could benefit from, (instead of us DBAs scrambling to find out what feature was implemented, locating the parameter and updating the value for it…) Using trace flag 4199 granted the power to the DBA to enable any new optimizer features, but, just like Oracle, with the introduction of SQL Server 2016, this is now controlled with the compatibility mode. I’m sorry MSSQL DBAs, it looks like this is one of those features from Oracle that, (in my opinion) I wish would have infected cross platform in reverse.
As stated, the Compatibility Level Guarantee sounds pretty sweet, but the bigger challenge is the impact that Oracle DBAs have experienced for multiple releases that optimizer compatibility control has been part of our database world. We have databases living in the past. Databases that are continually growing, but can’t take advantage of the “new clothes” they’ve been offered. Fixes that we can’t take advantage of because we’d need to update the compatibility to do so and the pain of doing so is too risky. Nothing like being a tailor that can only hem and cinch. As the tailors responsible for the future of our charges, there is a point where we need to ensure our voices are heard, to ensure that we are not one of the complacent bystanders, offering stability at the cost of watching the world change around us.
It’s Friday and the last day of my first Summit conference. I’ve wanted to attend this conference for quite a few years, but with my focus on the Oracle side and scheduling date so close to Oracle Open World, I couldn’t justify it before joining Delphix. When I was offered a spot to join the Delphix team and attend, I jumped at the opportunity. Look at this booth and these impressively talented Delphix employees- how could you resist??
The Summit event has around 5000 attendees and is held in Seattle each year around the last week of October. Its held in the Washington Convention Center which is a great venue for a conference. I’d attended KSCOPE here in 2014 and loved it, so was looking forward to enjoying this great location once more.
As I’m just re-engaging the MSSQL side of my brain, I have some catching up to do and there was no place better to do it than at Summit. I was able to dig in deep and attend a few sessions around booth duty and meeting folks I’ve rarely had opportunities outside of Twitter to interact with before this event.
Brent Ozar came by the Delphix booth to say “Hi” and absolutely made my day!
There is always that challenge of learning about what you need to know and what you want to know- this event was no different. I had a list of features and products that I really need to come up to speed on, but with cool technology like Polybase, Analytics with R and performance talks, it could be a bit distracting from my main purpose here. I’ve always been a performance freak and I still find it pulling me from the database knowledge that is important to day-to-day tasks. I know this is why I find such value in Delphix- It frees the DBA from spending any extra time on tasks that I find more mundane so we can spend it on more interesting and challenging areas of database technology.
What I did learn was that many of the companies that are realizing the importance of virtualization for on-premise and in the cloud, aren’t coming close to Delphix in features of ensuring they have the basics down first. You can’t just talk the talk, you have to walk the walk, too. I’m proud of Delphix and what we’ve accomplished- that we don’t say we can do something we can’t and continue on the path to be Azure compliant for 2017. Azure was everywhere this year at Summit and will continue to be a major push for Microsoft.
Another important recognition at Summit was the percentage of women attendees, the women in technology program at Summit, along with the support of the everyone at Summit of the WIT program.
The WIT luncheon and happy hour was on Thursday. In support of this day, over 100 men showed up in kilts. It may seem like a small gesture, but it shows in how the men and women interact at this conference and the contribution of everyone at the event. There is a lot more collaboration and the community is on average, much more interactive and involved than I’ve experienced at any Oracle event. It’s not to say that Oracle is doing it wrong, it’s just to say that the SQL Server community is much farther ahead. They refer to their SQL Family and they take it seriously in a good way.
Due to all of this, I was given the opportunity of a PassTV interview, met a number of incredible experts in the MSSQL community that I’ve only previously known on social media and appreciate being embraced.
I want to thank my great cohorts from Delphix who manned the booth with me at Summit. We had incredible crowds that kept us so busy answering questions, doing demos and talking about how virtualized databases can increase productivity and revenue. Sacha, Venkat, Jonathan, Dante and Jenny and Richie- you all ROCKED!
Thanks to everyone for making my first SQL Pass Summit conference AWESOME!!
I’ll be attending my very first Pass Summit next week and I’m really psyched! Delphix is a major sponsor at the event, so I’ll get to be at the booth and will be rocking some amazing new Delphix attire, (thank you to my boss for understanding that a goth girl has to keep up appearances and letting me order my own Delphix ware.)
Its an amazing event and for those of you who are my Oracle peeps, wondering what Summit is, think Oracle Open World for the Microsoft SQL Server expert folks.
I was a strong proponent of immersing in different database and technology platforms early on. You never know when the knowledge you gain in an area that you never thought would be useful ends up saving the day.
Yesterday this philosophy came into play again. A couple of folks were having some challenges with a testing scenario of a new MSSQL environment and asked for other Delphix experts for assistance via Slack. I am known for multi-tasking, so I thought, while I was doing some research and building out content, I would just have the shared session going in the background while I continued to work. As soon as I logged into the web session, the guys welcomed me and said, “Maybe Kellyn knows what’s causing this error…”
Me- “Whoops, guess I gotta pay attention…”
SQL Server, for the broader database world, has always been, unlike Oracle, multi-tenant. This translates to a historical architecture that has a server level login AND a user database level username. The Login ID, (login name) is linked to a userID, (and such a user name) in the (aka schema) user database. Oracle is starting to migrate to similar architecture with Database version 12c, moving more away from schemas within a database and towards multi-tenant, where the pluggable database, (PDB) serves as the schema.
I didn’t recognize the initial error that arose from the clone process, but that’s not uncommon, as error messages can change with versions and with proprietary code. I also have worked very little to none on MSSQL 2014. When the guys clicked in Management Studio on the target user database and were told they didn’t have access, it wasn’t lost on anyone to look at the login and user mapping to show the login didn’t have a mapping to a username for this particular user database. What was challenging them, was that when they tried to add the mapping, (username) for the login to the database, it stated the username already existed and failed.
This is where “old school” MSSQL knowledge came into play. Most of my database knowledge for SQL Server is from versions 6.5 through 2008. Along with a lot of recovery and migrations, I also performed a process very similar to the option in Oracle to plug or unplug a PDB, in MSSQL terminology referred to as “attach and detach” of a MSSQL database. You could then easily move the database to another SQL Server, but you very often would have what is called “orphaned users.” This is where the login ID’s weren’t connected to the user names in the database and needed to be resynchronized correctly. To perform this task, you could dynamically create a script to pull the logins if they didn’t already exist, run it against the “target” SQL Server and then create one that ran a procedure to synchronize the logins and user names.
Use <user_dbname> go exec sp_change_users_login 'Update_One','<loginname>','<username>' go
For the problem that was experienced above, it was simply the delphix user that wasn’t linked post restoration due to some privileges and we once we ran this command against the target database all was good again.
This wasn’t the long term solution, but pointed to where the break was in the clone design and that can now be addressed, but it shows that experience, no matter how benign having it may seem, can come in handy later on in our careers.
I am looking forward to learning a bunch of NEW and AWESOME MSSQL knowledge to take back to Delphix at Pass Summit this next week, as well as meeting up with some great folks from the SQL Family.
See you next week in Seattle!
This is a living document that I will continue to update and will add new database platforms to as I go along in my career. I spend a lot of time translating database platforms I’ve worked in for all tiers of the technical business. It just seems natural that we might need a location on the web where that information is kept.
I’ll add some diagrams at a later date, but we’ll start with a simple spreadsheet of common terms and questions and how each of the terms or tasks in Oracle, (the current #1 RDBMS) translates in other platforms. If there isn’t a similar term or task, I’ve marked not applicable, (N/A). If you have any additions or suggestions on how to improve the list, please feel free to comment or email me at DBAKevlar at Gmail.
As I’m still working on the best viewable format, keep in mind, you can export the table into a number of formats or even print it!
Oracle MSSQL MySQL SAP Hana Cassandra Instance: Start of the SGA and one or more background processes
Instance: A Windows Service and following dbs: Master, model, tempdb, msdb, resource
MySQL Instance is backgroun processes
Hana Instance, Multi-tenant does exist
Storage Engines: Innodb, ISAM, NDB, (cluster), Marta, Falcon, etc.
SGA, (System Global Area) memory allocated to Oracle
Conventional memory mgmt, AWE, pages
Hana is an in-memory database
Java Heap Memory
Query Cache, Key Cache, (storage engine can determine some of this)
Memory Pool, (allocated to in-memory)
sys.tables WHERE name = 'TransactionHistoryArchive'
Persistence Layer, (some of this)
Parition Index Summary Cache
SQL Server Windows Service, MSSQL executable process
Connection and Sesssion Manager
SQLCmd and Powershell
MySQL Workbench and mysql cli
SAP Hana Studio
TNS, (Transparent Network Substrate), Bequeath, EZConnect
ADO.net, OLEDB, ODBC, etc.
MySQL connectors (ODBC, JDBC, .NET, etc)
Performance Management Views, (i.e. V$ views)
Dynamic Management Views/functions
HANA_SQL* and HOST_* views
DB Management Memory Pool
Persistance layer for data store
Index, (one clustered index per object)
Index Management Layer
Index for partition key
Partition Key for row level
Partition key for row level
Partition key for row level
Partition Key as column level to store relevant rows
Compaction of SSTABLES
sql_trace = on
SQL Profiler and for version 2012+ Extended Events
C and ANSI SQL
Java and CQL
Database and DBOwner
Logins and Users
database backup/storage snapshot
incremental/incremental with redo only
part of transaction log, transactional commit
part of transaction log
Part of Transaction Logging and session manager
Temp Database per SQL Server
Data Actually Stores in Order no need of temp
Network /Disk Heartbeat
Part of Connection Manager
Only one heartbeat network heartbeat in messages
Master / Slave Nodes
Node Clustering, managed by Calculation Engine
Peer Nodes (no master) indeed every node act as coordinator
Shared Storage, (Voting Disk, too)
Local Storage to each node
Tokens: Data Stripes using token range at node level
Replication Factor: Data Mirrors across nodes using RF=ONE, ALL, N..
init.ora or spfile.ora
cassandra.yaml in /softwarelocation/conf/
redo log sizes & location: v$log, v$redolog
logging module manages this
redo log flush
backup transaction logs
transaction log volumes
Log located at /cassandrasoftware/clustername/nodename/logs/system.log
crsctl / srvctl
Rebalance of Data in diskgroups
nodetool repair or nodetool repair -st -et
private network or private ips
no private ip's
Microsoft Failover cluster, (MSFC) and Voting Disk
MySQL clusters, sharding
scn_to_timestamp or rowscn functions
Log Sequence Number, (LSN) to timestamp
alter session set schema
alter database set user
ALTER SYSTEM ALTER SESSION
v$asm_operation, rebalance operation
nodetool netstats or nodetool tpstats
cssd.log (disk heartbeat and network heartbeat)
size of table: bytes in dba_tables
calculate space used(total), bytes output from nodetool cfstats keyspace.tablename
number of rows in table: dba_tables.num_rows
calculate number of keys(estimate)
Size of Tablespace:sum(bytes) from dba_segments where tablespace_name=
Size of each schema- SELECT table_schema "Data Base Name", sum( data_length + index_length) / 1024 / 1024
"Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;
No Undo tablespace in MSSQL
N/A dependent on storage engine, too.
Written to redo
gc_grace_seconds for holding tombstones
result cache , keep pools
memory tables, heap tables
Shutdown instance, srvctl stop instance
NET STOP MSSQLSERVER, NET STOP MSSQL$instancename
sudo /usr/local/mysql/bin/mysqld stop
rman>backup tablespace tag 'today'
backup database dbname filegroup = 'filegroup' to disk = 'path\name'
After read lock, backup table files
on each node, backup keyspace -t today
rman> backup incremental tag 'incr'
Backups database 'db' with differential
enable incremental backups
enable incremental backups
rebuild index or reorg table
rebuild index keyspace tablename idx1, idx2
rman> backup database
backup database, snapshot
logical backup at tablename
rman> recover block 57;
mysqlbinlog- use logs to create statement sql to recover transactions to PIT.
scrub [keyspace] [tablename] [-s|--skip-corrupted]
rman> recover datafile
RESTORE DATABASE adb FILEGROUP='filegroup'
Depends on storage engine- mysqldump, mysqlbackup mysqlndb, etc.
RECOVER DATA USING FILE ('
N/A SSTABLELOADER from snapshot
restricted mode: alter database restricted mode
set global read_only=1
Boot OS into single user mode
cost based statistics, (CBO or optimizer)
cost based statistics
SQL and MDX, (Multidimensional Expressions)
A couple folks have emailed me, looking for my slides from Oracle Open World. Both presentations can be viewed here at Enktiec’s website, along with all my great coworker’s presentations, as well.
If you are still looking for my interview with Oracle Technology Network on contributing to the Oracle community and User group involvement, that can be found here.
I’m thoroughly busy right now with KSCOPE database track abstract selection, the RMOUG Training Days planning and abstract selection and finishing up the chapters along with my wonderful co-authors on the EM12c book for Apress. I’m really proud of this collaboration with Pete Sharman, Alex Gorachev, Gokhan Atil, Niall Litchfield, Anand Akela and Leighton Nelson. These guys really know their EM12c and are putting their hearts and minds into this great book. If you are interested, it’s already available via pre-order through Apress. If you are one of my SQL Server folks and are interested, the new Pro SQL Server 2012 Practices Book is out, too!
I’m hoping in another month I can get back to writing blog posts and not just chapters for books, but I am starting an EM CLI book as soon as the EM12c book is over, so cross your fingers!
I’m seeing a light at the end of the tunnel and it’s not a train, so that has to be good, right? 🙂
I wanted to send out a quick post and remind folks that I will be presenting at SQL Saturday #169 in Denver, hashtag #sqlsat169 presenting on the seemingly popular “Oracle for the SQL Server DBA”. I really enjoy these sessions, as the MsSQL DBA’s are always a refreshing change from the more common Oracle world I’ve been in the last year and they are in turn, happy to talk to an Oracle consultant who really, truly believes that a database is a database, forget the platform, it’s what you put behind it that matters!
If you are in the neighborhood and interested in attending, the link will help you register. If you are attending, please come see me, even if you aren’t interested in learning about Oracle, come by to say ‘hi’! 🙂
Stay tuned, next week- The train ride on the California Zephyr out to Oracle Open World!
I ended up so wrapped up in everything going on when I returned home that I never did get my Miracle Oracle World 2012 post out on my blog, (bad DBA Goth Princess!:)) so here it is!
Miracle Oracle World, (aka MOW2012, hashtag #MOW2012) is a yearly event held by Mogens Noorgard and his company Miracle, (http://www.miracleas.dk/ ) at Hotel Legoland in Billund, Denmark each year. This year was no exception and I was thrilled when Mogens asked me while in attendance at RMOUG’s Training Days if I would come to Denmark and do my presentation on EM12c, (then let me choose one more topic to speak on, which turned out to be ASH Analytics.)
I’d never been to Denmark and it sounded like a wonderful opportunity, but there were clashes in schedules personally and I wasn’t sure if I’d be able to attend at first, but Tim was adamant about me going to MOW this year and stayed home to take care of responsibilities so I could speak in Denmark.
Upon reaching Copenhagen, Mogens picked me up at the airport, (still impressed he was able to locate me in the chaos that is any airport!) and after a short time to recover from the long fight at Mogen’s house, I loaded up into the car, driven by Mogens and accompanied by Cary Millsap, his wife, Mindy and their five year old daughter, Cat.
I have to give a lot of credit to young, Miss Cat. She was so well behaved and content to just ride along, watching movies and playing games, etc. She’s very close to both her parents and was quite enjoying her *special* trip to Denmark. It’s a 3 ½ hour trip to Billund from the town near Copenhagen where Mogens resides and the trip was pleasant, good conversation and humor when Cary attempted to calculate the miles per hour of the windmills by circumference, length and speed of the blades.
Upon arriving in Billund, we toured the Hotel Legoland for a bit, but I was glad to have the Millsap’s drop me off at the house at Lilandia and let me recuperate. Lilandia is a huge waterpark across from Hotel Legoland with what looks like small cul de sac’s of houses, different sizes and designs. The one I was in was four bedrooms and I was to share my room with Heli Helskyaho, who I was so looking forward to catching up with since I hadn’t seen her since RMOUG training days! My fellow house guests were Alex Gorbachev, Christian Antognini and Jonathan Lewis.
Most of the folks attend the party house and I heard it was quite the event, but I won’t lie, I tried to catch up on some sleep after being up for 36 hrs straight! Not much jet lag but I was up and spoke to Jonathan when he came in at around 8pm, Alex when he showed up at Midnight and then chatted with Christian when he was up at 2am working on his presentation slides. Jet lag is a funny thing… 🙂
I did get enough sleep to be up and ready before 7am and Jonathan happened to be up at the same time. He asked if I would like some company on my walk over to the conference site and I was happy to have such an excellent fellow along for the 1 mile walk. As much as I enjoy Jonathan’s presentations, there has got to be something said for one on one discussions with him. He can converse on any number of subjects and we were at the hotel Legoland in no time at all.
I appreciate Cary Millsap and his daughter, Cat allowing me to sit with them at breakfast. This helped alleviate some of my separation anxiety from my own children just watching Cat interact with her father. I ran into Oyvind Isene from Norway’s Oracle User Group, who I’d had the pleasure of meeting last year at Oracle Open World and he was someone I could always count on to put up with my incessant chatting for the two days of the MOW conference… 🙂
Choosing sessions was more difficult for me than I think for most other folks at the conference. The thing that really impressed me about MOW was that it was a mixed platform conference. This doesn’t mean there were a few MySQL sessions scattered among the Oracle, but that there was a full set of SQL Server presentations. For me, having as many years in SQL Server as I do Oracle, it was a real treat. I missed out on a few I would have liked to attend, but as always happens, conflicted with others I had promised attendance to. To attend Ron Crisco’s session, (someone I had spoken to and emailed with working with the Method R tool suite, but had never actually met…) meant I missed Thomas Kejser’s “SQL 2012 OLTP Improvements” session. This went on for most of the day even my own presentations competing with a few sessions I wanted to attend.
Christian Antognini’s “End to End Response Time Analysis” was engaging- anything to do with waits and response is going to interest me. His data was flawless and everyone in the room left with a few more ways to address performance challenges after seeing his examples and demos.
I then attended Dan Norris presentation on Exa-environment platform integration techniques. Dan didn’t have a large crowd in his session but this did allow for the conversation to be very specific between the attendees and Dan, which in turn satisfied those that attended his session greatly. Dan has a lot of experience and insight and I was impressed with the level of interest from those that had questions about Exa* products.
I proceeded to attend a SQL Server session next by Alexei Khalyako on SQL 2012 High Availability and Disaster Recovery. I hadn’t worked in this area of SQL Server for a couple years and was quite impressed with some of the new features Microsoft has introduced into the SQL Server product, including Availability Groups Multiple Secondary’s for HA and DR, Advanced Replication and new clustering features.
The next session, by Thomas Kejser, I found very intriguing. It was Hadoop and Big Data vs. Datawarehousing from a SQL Server perspective. I’ve heard plenty of presentations and read a number of papers on it from the Oracle side, but really enjoyed hearing a view of it via SQL Server world. The data behind the presentation was accurate and Thomas is a solid presenter, so the session was one of my favorites. I made enough of an impact, (can you say mouthy?) that Thomas came over promptly after his presentation was done and we continued to talk in a small group about big data and what options DBA’s had to handle it, no matter what the platform or technology choice.
My ASH Analytics session was at 4pm, last session of the day and it went as well as I could have expected. I was missing my demo for this session, the server I’d set it up on was down for maintenance, (I know, why did I trust a server to be up or even available??) I’d already run into the complication when I discovered much of my data I had been collecting over the last couple months missing from my external drives. I unfortunately didn’t realize this until I went to enter all of the data I thought I had, on slides just two weeks prior to the conference. I came up with challenges recollecting this data as my current EM12c environments are on 10g RAC databases. Anyone who has attempted to use ASH Analytics on a 10g environment will learn- it’s not going to happen. You can install the package to bring up the ASH Analytics page, you just won’t have any data in 95% of the panes, so nice try. Lucky for me, I was able to capture most of the data I needed to come up with a presentation just in time- still not the quality I would have liked.
Of course, my ASH Analytics session was attended by Cary Millsap, Alex Gorbachev, Uri Shaft, John Beresniewicz and other folks, many on the DBA God list… 🙂 I still appreciated their time, I was thrilled to have them attend, even if it was not my best session. Afterwards, we talked for quite some time, (missing demos have a tendency to grant that time… ) and Cary asked if I would like to attend his “Mastering Trace Data” Class that he was giving the next day. The opportunity to take it offsite was on the table for me, but to take it in person was too much to pass up, so I agreed.
The afternoon ended with after-first-day-conference drinks at Hotel Legoland’s bar while waiting for dinner to be served. Heli Helskyaho had arrived at that point, was happy to see her, (and this also meant I was no longer the only female presenter at the conference! :)) I hung out with her, Oyvind Isene and Christian Antognini, speaking to many others throughout the time there until they informed us dinner was ready.
Dinner was a fun affair, great food, great company and again, Cary and Mindy Millsap’s daughter, Cat was well-behaved, (more so than some of the adults? :)) Alex Gorbachev, along with our common banter, discussed his recent election to the IOUG Board of Directors and had a good conversation about RMOUG’s relationship with the IOUG.
Post dinner, Heli Helskyaho and I went over to the “Party House” which was four doors down from our own. There was eating and drinking, although not as much eating and drinking as the first night, as I heard there was a roast pig that I chose to miss to catch up on sleep. We spent most of the evening talking with John Beresniewicz, Tuomas Pystynen and Uri Shaft. There were many others, but so many, I gave up on remembering faces, let alone names. Alex Gorbachev took my “hoppy” beer off my hands at one point and replaced it with red wine, which turned into my drink of choice for the evening.
The second day started with a lovely breakfast with Heli, Tuomas Pystynen, Jonathan Lewis and others. I took the first hour off, prepped for my EM12c presentation in a quiet location and it was worth the time. My session was in full attendance and I was content with the outcome. The Q&A was not as intensive as my RMOUG session, but the questions were well thought out and discussion was actively participated in. The presentation was well received and only makes me more anxious for KSCOPE 2012 in San Antonio come June!
I attended Cary Millsap’s “Mastering Trace Data” class for the rest of the day. This was a great refresher course for me after taking the extended class over a year ago and reviewing the book used for the class back in December. Cary goes over the basic information so that anyone can easily utilize the Method R tool suite along with offering clear reasons to trace, showing how having this knowledge can make us better DBA’s.
The conference ended with a speech by Mogens Noorgard, awarding participants and those that came up with a creative way to explain the huge pool that had been a hit with the sauna partiers at the party house to Lilandia management.
Dan Norris had arranged with Mogens that I would drive back with him and his group. It was a good drive back to Malov, Denmark, near Copenhagen. His friend Anne is lovely, easy to talk to and Tuomas Pystynen is fun to be around, (except for those salted, black licorice fish candy he bought and had me try! :))
I spent the last 24hrs at the Yellow Mansion, home of the Oak Table. Dan, Anne and Tuomas made sure I arrived at the airport on time to catch my plane and upon arriving at my connection at London/Heathrow, I entered the lift and heard a familiar voice. Looking over the crowd entering, I noticed Mark Rittman and yes, the person that was missing at MOW was on her way to Calloborate in Las Vegas- Debra Lilley. We shared a few words, hugs and kisses, then I was off on my last leg of my flight home to Denver.
My only regret regarding Miracle Oracle World is that I didn’t have more time in Denmark. Upon returning, viewed some of the pictures Dan Norris’ friend Anne took in Copenhagen after they dropped me off at the airport. Even one more day in the city would have been wonderful!
~ The least questioned assumptions are often the most questionable ~ Paul Broca
I’ve always found assumptions to be one of the most common cause of failures in software releases/maintenance windows.
If I had a dime for every time I’ve heard, “I thought you were going to take care of/do that…” or “I didn’t involve you earlier because I thought the steps you were responsible for were so easy…”, well, you know the saying and I’d be rich.
Assumptions causing participation of the DBA too late into a project, release or maintenance is widespread enough when you are onsite, but as a remote DBA, can take on a whole new dimension. Where being in the office area might allow you some over-heard conversation or privy to meetings that you realize you should be part of, working off-site can really set you up to miss out on important prep time to offer the best level of support.
It’s nothing new, not rare and its most obvious in hindsight, after the release or maintenance has completed. As paranoid as I think I am, causing me to involve myself pretty well, (I’m not a fan of surprises… :)) I did experience it this last weekend as a new DBA for a client. Acclimating to a client, as well as they becoming comfortable and involving you as their new DBA takes time. Something we just didn’t have the opportunity to do much of, nor was it anyone’s fault. Enkitec was unaware of this year-end maintenance, so they assumed I would easily take-over ownership of the client from the previous DBA.
Friday there was some concern, after they sent an email with the tasks they needed my time allocated for that night and my “real” first time on the client’s systems, that there might be a disk space issue for the required backup post the special, once-a-year release upon completion.
I did some quick research after this was discovered and offered an option but the client’s Unix admin cleared off some disk space and assumed the space would be enough. Now the estimated space usage for the release was not that big, definitely not that large when you consider what I’m used to. we are talking gigabytes, not terabytes. Only being in the system for one day, I made my first mistake and assumed the problem was taken care of and proceeded to perform the duties I had been assigned me for that evening and let them work through the weekend.
The client had assumed the tasks were quite simple for a DBA- the previous DBA had been there the entire time they had been clients and the database growth had been of minimal concern. It was taken into consideration that I may require a little more time to find my way around the environment, become familiar with the specifics of design, jobs and backup scenarios, etc., but I had no issues with the pre-release work, so why would “reversing” the process for the post work result in any difficulties?
Post the weekend work, they contacted me and asked me to start the tasks for after year-end processing. Everything worked out well until close to midnight when the backup failed. We didn’t have enough space.
The backup strategy is not RMAN backup files, but image copies, level 1 incremental and the size of the database due to the release ALONG with additional UNDO, etc. caused the database to be too large to fit on the volume. Different strategies hadn’t helped, even splitting across multiple channels to multiple volumes was not enough, now I was having a formatting issue on the apply to the incremental. It did not like the change one bit and yes, it was after midnight, (have we discussed when a DBA’s horse-drawn carriage turns back into a pumpkin yet? :))
The unique configuration and my newness to the environment meant that it did take me a bit longer to work and investigate issues, (although I do think this may be the best way to retain knowledge about an environment, it’s just more painful for everyone involved!) I finally had the answers I needed in the wee morning hours-
– how to retain the existing backup from before the release from the same volume as I needed more space on.
– change from an image copy incremental to a level 0, rman compressed backup.
– what parallelism was acceptable during business hours.
– what jobs had to be stopped to not impact production while all this occurred.
Now the second level of the problem- I’ve been up two nights of the last three, had been ill on Saturday and I was starting to feel my IQ slip away like the free space on the backup volume. Enkitec beleives in giving their clients valuable resources that are able to give them their best and I was in no way close to that. I really appreciate it that my secondary DBA to this client, Miranda was so helpful, so willing to take what I, as the brand new DBA, had and put the plan to action, (and make it sound so easy to me who had so little IQ left at that point! :)) I promptly notified the client after I transitioned to her the information and then collapsed to a deep slumber.
Now we come to the moral of our story.
This should have been simple work for the DBA. It was assumed to be so by BOTH parties: the DBA and the client. This was our downfall in that we really should make only one assumption when it comes to maintenance and releases- If we assume, especially on the simple stuff, it will most likely be what causes our biggest challenges. The DBA should be involved from the beginning of any project, maintenance or release and then from there, once both sides have inspected the tasks/level of difficulty, can they both decide that the DBA is not required to be heavily involved. An open invitation should be available to the DBA to return if any “red flags” arise and all communication should still include the DBA to ensure that there are as few surprises as possible.
Chris Shaw from Colorado Springs SQL Server SQLPass group invited me to come speak at this wonderful group last week and I promised a few folks that I would upload my slides to my site, (they are also available via Chris, too…)
The group is a small, close knit group that I was very pleased to have the opportunity to speak to and look forward to having more interaction with in the future!
Thank you to Chris and the rest of Springs SQLPass!
Two things to be happy about today!
1st- Enkitec did a lovely announcement on Enkitec regarding my coming on board. I just arrived last night after three days at the main office in Irving, Tx, (Dallas area is lovely with all the fields of Blue Bonnet flowers this time of year…) and am psyched about working remotely for them from my home, northwest of Denver.
2nd- I have a wonderful opportunity to speak this evening at Colorado Springs SQL Pass group on “Oracle for the SQL Server DBA”. SpringsSQL
It’s only going to get crazier the next two months from here, so stay tuned! 🙂