Delete sitecollection with content Database programaticaly

Hi All,
I have created Site collection with separate content database by  programmatically.
in the same manner
1) I want to delete the site collection and it's Content database.
   or
2)User wants to delete the site collection from settings , after deleted the sitecollecton from settings page then it's content db not deleted.
how can user can delete the site collection content db from user interface(user means - admin user, have full permission)
Please assist on this.
Thanks in advance.

Regarding #2, when a site collection is deleted, SharePoint will NEVER delete the content database as well... SP has no way of knowing whether the CDB will be used for other site collections in the future, and CDB maintenance is an ADMIN task, not a USER
task.
Delete the content database with SPSite.ContentDatabase.Delete() - more or less
Scott Brickey
MCTS, MCPD, MCITP
www.sbrickey.com
Strategic Data Systems - for all your SharePoint needs

Similar Messages

  • Delete Parameter with Oracle Database Lite API Specification

    Hi,
    Is there any function or way to remove a parameter with a API function?
    Regards

    Is this subscription parameter causing a problem?
    unless the subscription parameter name is referenced in the select statements for any of the publication item definitions, it will be ignored by the processing as the subsetting parameters are just used to supply values for bind variables at query time
    If you have other valid subsetting parameters for the user, then try (if all your set up is done via APIs and you do not have an APPLICATION, only a PUBLICATION, this may not work)
    1) go into the mobile manager > users
    2) search for user name, and click on the link under the user name
    3) go to subsetting parameters and pick a valid one
    4) select the data and do cntrl C cntrl V (cut and paste)
    5) press the save button
    The above has the effect of resetting the user account, and refreshes sequence values, c$all_client_items etc.
    If you can do the above steps, but this does not remove the subsetting variable, you should be able to go to it and set the value to NULL
    I do not think that there is a delete function due to the dependancy to the select statements which would be complex to validate

  • How to delete the complete contents of database table ? should be empty !!

    Hi Guys,
    I have requirement where i have delete the contents of database table..i have make it empty (no records at all) and then i have to fill it with the records from the excel sheet.
    I can upload data from the excel sheet.
    Please tell me how to delete the complete contents of the database table ??
    Regards
    Rahul

    hi ,
    just write like this,
    delete from <database table>.
    commit work.
    sample code, here edpar is database table.
    delete from edpar." FROM TABLE g_tab_delete.
      call function 'DB_COMMIT'.
      loop at g_tab_edpar into g_wa_edpar.
        insert into edpar values g_wa_edpar.
        if sy-subrc  eq 0.
          move-corresponding g_wa_edpar to g_wa_edpar1.
          append g_wa_edpar1 to g_tab_edpar1.
        else.
          move-corresponding g_wa_edpar to g_wa_edpar2.
          append g_wa_edpar2 to g_tab_edpar2.
        endif.
      endloop.
    that's all it works.
    reward points if helpful.
    regards,
    seshu.

  • Unable to delete a SharePoint 2010 My Sites content Database and IIS Web Site even after changing timeout

    Hi,
    I am currently having issues with deleting a content database for mysites which has web application http://<servername>:11100. The database was migrated from sharepoint 2010, but on creating web app it timed out (was corrupt due to this).  Problem
    is I cannot delete now as I get "Request Timed Out". Even when I try just deleting the Web App or the Content Database individually. I have already updated the timeout on the Central Admin App Pool to 300. This used to work, but no joy now. Seems
    like ever since I added this My Sites Web App I am getting this problem.
    The setup is 1 Database Server (64GB), 1 Admin Server (24GB) and 3 WFE Servers (12GB each) - all VMS. System is also running PowerPivot. Central Admin is running on a WFE server. Is this setup OK for just one user? Reason I have 3 WFE is this already existed
    and App Servers will be scaled out when we start testing. Running 11 Web Applications.
    Help appreciated - any ideas?
    Thanks.
    John.
    OH - I tried to delete with powershell and it tells me it requires SHarePoint Administration Service to be running, but the problem is it is already running on the WFE with Central Admin on.

    Hi John,
    The timeout may cause this issue. But would you let me know the error message when we delete the database?
    However, you can delete the web application(my site host) and click delete database and IIS web site option.
    Also, you can try to clean cache and check if issue persists:
    Please stop SharePoint Timer Service.
    Please navigate to the cache.ini file location:                  
    Delete all the .xml file and only leave cache.ini in the file location.                  
    Edit the Cache.ini file and set it to 1.                 
     Save the Cache.ini file
      Start SharePoint Timer Service. The cache file will be created autumnally.
    Any questions, please let me know.
    Best Regards,
    Dats Luo

  • Create feature for generate new collection having separate content database by using custom coding with C#

    Hi all My self ArunDarly .Iam using share point 2010 ,I want below task solve by  using custom coding with
    C#
    I have one task that create new site collection having separate content database. and that content database site collection limit  should be only one  (it must contain one site collection and note more than one  )
    This total functionality should happen when I am saving one list item (dynamically generate new site collection ) 
    If any body know this Please give me your guidance  
    Thanking  You,
    Arun Darly

    Hey Arun,
    I have done the same job. Hope this code will help you.
    using (SPSite siteCollectionOuter = new SPSite("Any SC url in which u want to create site."))
    SPWebApplication webApp = siteCollectionOuter.WebApplication;
    SPSiteCollection siteCollection = webApp.Sites;
    SPContentDatabase contentDatabase =
    siteCollection.WebApplication.ContentDatabases.Add(ServerName, New Database Name, Admin Name,
    "Admin Password",25,50, 0);
    //Above line will create new content DB
    contentDatabase.Update();
    siteCollection.WebApplication.Update();
    SPSite newSite = contentDatabase.Sites.Add("New SC Url", "SC Title", SC Desctipyion, 1033,
    15, "STS#0", "SC Admin", "Admin", "admin password",
    "User 2", "User NAme", "Password");
    //Ablove line will create new SC in to the Content DB
    //add the upper limit for the site collection
    SPQuota quota;
    quota = new SPQuota {StorageMaximumLevel = 2510220};
    newSite.Quota = quota;
    // And update the site collection and the content database
    newSite.RootWeb.Update();
    contentDatabase.Update();

  • Workflow status column in AllUserData Table with wrong coded in Content Database?

    I would like to write a stored procedure to find out all workflow instances with errors, directly from content database.
    I go to dbo.alllists to find out the workflow status column, and query AllUserData and find out not readable text
    like:
    쳀曩쌙䂻֞鼥
    㖦巀䐝义颹暲ﻇൿ
    ﱰ臨臸䋖ហ嬀ᨵ瘉
    鄌幀鴏䔖튅㐻⩷揬
    묨ή姖䩡ꊎ鉛۬浶
    ⟯봨飮䙕잳摕盜⣢
    屑䳬鑥䶵岿珽磯Â
    ꬁᆈ䀥䓝䶲紀篰䟫
    蓏ꋦ䥌肃瘓⯈᭄
    뵎㎙䈸䪿蔀ࢴ
    ෬꧋辂䘀馻ࡲ琓
    ꞎ鵫䬺ࢬ䀒✫ꡱ
    any ideas?

    Hi,
    Thanks to share your post.
    For the issue, I think it may due to the wrong handling of the encoding type “UTF-8”, please refer to the followed article, they may give you a hand:
    http://blogs.sun.com/shankar/entry/how_to_handle_utf_8.
    http://devlog.info/2008/08/24/php-and-unicode-utf-8/.
    Hope this could help you!
    Leo

  • I am trying to delete duplicate content in my iTunes library. I have stopped the download and I can see them on VIEW Displaying Duplicates, but cannot delete them with the Delete button. Can anyone assist?

    I am trying to delete duplicate content in my iTunes library. I have stopped the download and I can see them on VIEW>Displaying Duplicates, but cannot delete them with the Delete button. Can anyone assist?

    If you've paused the download (they are partially greyed out on the duplicates screen ?) then you will need to delete them from download window, you can't (as far as I know) delete partially downloaded items from that screen. When you have items downloading, or downloads that are paused, you should have a downward pointing arrow at the top right of the iTunes screen
    If you click that arrow you should get a popup window with the items that are downloading/paused - and you should be able to select and delete them (or resume their download) from there.

  • I have a new imac how do i connect my phone to this computer if its registered with another without deleting all my content

    i have a new imac how do i connect my phone to this computer if its registered with another without deleting all my content. when i go on itunes it says that i can sync but will erase all the content and replace it with whats on the mac.

    Read this and follow carefully:
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive

  • Reduce Size or delete unwanted entries from tables AllDocStreams,AllDocVersions,EventCache,EventLog of Sharepoint 2010 content database

    Size or delete unwanted  entries from tables AllDocStreams,AllDocVersions,EventCache,EventLog  of Sharepoint 2010 content database:
    We using  powershell  scripts to migrate data between   two  sharepoint  2010 sites .
    While  doing migration  we  delete all  document libraries  & list  form  destination  site  and then run  powershell to migrate data from  source to destination. We following this  process
    twice in a week.
    But in doing  so  we found the above mention tables (AllDocStreams,AllDocVersions,EventCache,EventLog ) of destination Sharepoint Content database  are growing at an alarming rate. 
    Wish to know  how  could get rid of  unwanted  data stored in these tables.

    Hi,
    This is old thread but here is your answer for some of the tables you mentioned
    http://blogs.msdn.com/b/sowmyancs/archive/2012/06/29/alldocversions-amp-alldocstreams-table-size-after-upgrading-to-sharepoint-2010.aspx
    Cheers

  • Content database integration with EBS(IProcurement)

    Hi All,
    We are trying to save purchasing attachment to content database. Normally, It goes to EBS database. We have installed content suite and was able to intergrate with EBS. Now we are trying to save attachment to content database instead of EBS database. This we are trying to achieve for Iprocurement.
    Does any body has worked upon this kind of requirment?
    Please help.
    Thanks in advance

    Eureka,
    Basically to acheieve your requirement, you have to use Content db java apis, which is available by oracle. There is also a separate forum for content db .
    The idea is make a jsp page which will be the upload docs in content db.Here you have to implement content db java api s'. From oaf page you have to forward to this jsp , here user will upload his docs and then redirect him back to oaf page.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Workflow issue with new WSP, "Unable to locate the content database"

    I deployed a wsp last night. The farm is 1 WFE, 1 APP, 1 SQL. The workflow can be started manually, but isn't being triggered by a timer job. Workflow timer services are started on WFE and APP.
    03/03/2015 18:25:19.62 OWSTIMER.EXE (0x1870)                              0x1F50 
    Job Monitoring Logging Service Job                                          
    1              Unexpected       Microsoft.SharePoint.SPException: Unable to locate the content database named 'IntranetContent'     at SharePoint.IT.JobMonitoring.Jobs.DashboardJob.Execute(Guid
    targetInstanceId)                a3f74c85-4a11-4654-9869-67e1d2e712d9
    Any suggestions on troubleshooting?
    Thanks,
    Scott

    Hi scogordo,
    What is the wsp? Is it a migrated workflow?
    Whether the wsp has the relationship with the problematic workflow.
    You said that the workflow isn't being triggered by a timer job, what is the time job? Or, you mean the workflow cannpt be triggered automatically when an item is added or changed or other.
    If the workflow cannot start automatically when an item is added or changed, you need to make sure you are not using the System Account.
    Best Regards,
    Wendy
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Powershell script for deleting sitecollection and its content db

     want to know whether any powershell script is avlble for deleting the sitecollection and its content db at oneshot!
    i have created sitecollection specific content db and i wanna delete the same.

    Hi,
    Below link will help to delete site collection
    http://technet.microsoft.com/en-us/library/cc262392(v=office.15).aspx
    Thanks
    Somnath Matere

  • HT1766 After I backed up my new iPhone with content from my old iPhone, all of my new content was deleted. How do I retrieve it?

    After backing up my new iPhone with content from my old iPhone, all of my new content (photos, voice memos, etc) was deleted. How do I retreive this?

    If you just bought the iPhone today, the first time you connect a new iPhone or iOS device to iTunes the first time that is used to sync with another iOS device, you are prompted to transfer the backup for the other iOS device to the new iOS device, or set up the new device as a new device.
    Sounds like you did the former and if so, this did not include backing up the new iPhone first. All data on the iPhone was replaced with the backup for the iPod Touch. The data that was on the iPhone at that time is gone.

  • Upgrade large farm with Service Pack detaching all content databases?

    Hi,
    Whenever we upgrade one of our farms (with a Cumulative Update, Language Pack, or Service Pack), the corresponding PSConfig usually yields in error due to the huge time taken to upgrade all the content databases at the same time.
    We have heared about the possibility of detaching all content databases previous to the update (just CONTENT databases), then proceed with the installation and PSConfig, and finally a gradual upgrade by attaching one by one the content databases.
    After searching online I have not found a relevant or precise official documentation detailing whether this procedure is recommended or viable, and have some additional questions:
    - Can all he content database be disconnected (including the ones containig myprofiles, top level sites...) during the upgrade?
    Thanks in advance

    In my understanding, the patching involves (at least) two steps:
    Patching binaries on all servers of the farm
    Upgrading the database schema of Service Applications DBs, Configuration & Admin DBs, and content databases.
    If during the upgrade the database is not attached to the farm, SharePoint does not know about it, and does nothing with itm just like if it was physically detached from the SQL Server instance. But when, after patching, you reattach the database, SharePoint
    detects the difference in the schema version and the patched farm version, and upgrades the database accordingly. As far as I understand, this is automatically done by
    Mount-SPContentDatabase:
    "The Mount-SPContentDatabase cmdlet attaches an existing content database to the farm. If the database being mounted requires an upgrade, this cmdlet will cause the database to be upgraded.
    The default behavior of this cmdlet causes an upgrade of the schema of
    the database and initiates upgraded builds for all site collections within the specified content database if required. To prevent initiation of upgraded builds of site collections, use the
    NoB2BSiteUpgrade parameter. This cmdlet does not trigger version-to-version upgrade of any site collections."
    If you decide not to upgrade, you can later run Upgrade-SPContentdatabase.
    The point is, that if you keep attached all the content databases, the PSConfig needs to do a massive upgrade of all the content databases before finishing, thus considering that the farm is ok. On the detach/attach approach, the first PSConfig ends quite
    soon so your farm is up and running sooner (although, that's for sure, without the data being available until attached and upgraded - but you can gradually start giving service instead of waiting for the whole process).
    So far, so good. But what I was trying to ask in my question, is whether there is a detailed procedure to follow for this approach, or if there is any particular constraint regarding this approach (like "databases containing top level site collections
    should not be detached", or "pay attention to the my site host web application", or "that patching method is not supported").
    Thanks.

  • SP 2013 Upgrade error - web application is configured with claims authentication mode however the content database you are trying to attach is intended to be used against a windows classic authentication mode.

    Hi there,
    I get this error when I perform a DB Attach upgrade from SharePoint 2010 to SharePoint 2013. 
    "web application is configured with claims authentication mode however the content database you are trying to attach is intended to be used against a windows classic authentication mode."
    Any help is appreciated. Thanks.

    There is other way of fixing this issue apart from what Amit mentioned. Create a classic based web application in SP 2013 using PowerShell.
    New-SPWebApplication -Name "TestApplication" -ApplicationPool "TestApplicationAppPool" -AuthenticationMethod "NTLM" -ApplicationPoolAccount (Get-SPManagedAccount "sppoc\spfarm") -Port 100 -URL "http://sp2013demo"
    Now mount the content database from SP 2010 on to the web application created above 
    Mount-SPContentDatabase WSS_Content_100 -DatabaseServer SQL2012Demo -WebApplication http://sp2013demo:100
    Once the mount is complete, convert the web application to use claims and migrate the user to use claims identity.
    Convert-SPWebApplication -Identity "http://sp2013demo:100" -To Claims –RetainPermissions -Force
    $w = Get-SPWebApplication "http://sp2013demo:100"
    $w.MigrateUsers($True)
    See my blog post about it: http://www.sharepointnadeem.com/2014/01/upgrade-from-sharepoint-2010-classic.html
    Please remember to up-vote or mark the reply as answer if you find it helpful.

Maybe you are looking for