{
  "date": "2016-03-08T15:30:44",
  "slug": "easy-transport-of-sql-tuning-sets-with-oem",
  "link": "https://www.dbi-services.com/blog/easy-transport-of-sql-tuning-sets-with-oem/",
  "title": {
    "rendered": "Easy transport of SQL Tuning Sets with OEM"
  },
  "content": {
    "rendered": "<h2>By Franck Pachot</h2>\n<p>.<br />\nWhen you want to transport a SQL Tuning Set between production and test for example, you have to pack it into a table, then export the table, import it into the target database, and unpack the STS. This is a case where Enterprise Manager can help to do it quickly.<br />\n<!--more--></p>\n<p>First I create a SQL Tuning Set</p>\n<p><a href=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture001.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture001.png\" alt=\"Capture001\" width=\"1295\" height=\"539\" class=\"alignnone size-full wp-image-7346\" /></a></p>\n<p>Not showing all details here. Just loading the Top-5 queries from library cache:</p>\n<p><a href=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture002.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture002.png\" alt=\"Capture002\" width=\"1295\" height=\"539\" class=\"alignnone size-full wp-image-7345\" /></a></p>\n<p>Here is my STS that I maned &#8216;TEST&#8217; and I can export it to a DataPump dump file:</p>\n<p><a href=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture003.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture003.png\" alt=\"Capture003\" width=\"1295\" height=\"539\" class=\"alignnone size-full wp-image-7344\" /></a></p>\n<p>I can choose or create a directory from there and there&#8217;s a default name for the dump file with the name of my STS within:</p>\n<p><a href=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture004.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture004.png\" alt=\"Capture004\" width=\"1295\" height=\"539\" class=\"alignnone size-full wp-image-7343\" /></a></p>\n<p>For the example I use the same database. I have to drop the old one because I cannot rename the STS while importing.<br />\nIn Enterprise Manager the buttons on the left are related with the object that is selected, but the import is on the right, like the &#8216;create&#8217; one as it creates a new STS. You cannot import to an existing STS.</p>\n<p><a href=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture005.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture005.png\" alt=\"Capture005\" width=\"1295\" height=\"539\" class=\"alignnone size-full wp-image-7342\" /></a></p>\n<p>Now enter the impdp parameters:</p>\n<p><a href=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture006.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture006.png\" alt=\"Capture006\" width=\"1295\" height=\"539\" class=\"alignnone size-full wp-image-7341\" /></a></p>\n<p>and run the job:</p>\n<p><a href=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture007.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture007.png\" alt=\"Capture007\" width=\"1295\" height=\"539\" class=\"alignnone size-full wp-image-7340\" /></a></p>\n<p>Then here is the STS imported:</p>\n<p><a href=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture008.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2022/04/Capture008.png\" alt=\"Capture008\" width=\"1295\" height=\"539\" class=\"alignnone size-full wp-image-7339\" /></a></p>\n<p>Note that there is also a &#8216;copy to database&#8217; button that run all that. However, because it includes file transfer, you have to provide host credentials.</p>\n<p>For this example, I&#8217;ve used the EM13<em>c</em> VirtualBox and have added the emrepus target. I didn&#8217;t find the SQL Tuning Set Menu at the place I expected it. Thanks to Twitter friend Hatem Mahmoud I know why:</p>\n<blockquote class=\"twitter-tweet\" data-width=\"500\" data-dnt=\"true\">\n<p lang=\"en\" dir=\"ltr\"><a href=\"https://twitter.com/FranckPachot?ref_src=twsrc%5Etfw\">@FranckPachot</a> I faced this case when i add new target,The first time i access the menu is missing entry but after that every thing is ok</p>\n<p>&mdash; Hatem Mahmoud (@Hatem__Mahmoud) <a href=\"https://twitter.com/Hatem__Mahmoud/status/707193998297927680?ref_src=twsrc%5Etfw\">March 8, 2016</a></p></blockquote>\n<p><script async src=\"https://platform.twitter.com/widgets.js\" charset=\"utf-8\"></script></p>\n<p>Don&#8217;t forget you need Tuning Pack for SQL Tuning Sets.</p>\n",
    "protected": false
  }
}
