SQL Developer source control option - sql

I have switched from Toad to Sql Developer and was just looking for certain features in SQL developer which I really found beneficial in Toad.
It had a team coding viewer option which is nice to keep a check on the source codes and versioning, though it had nothing to do with subversion.
Do we have any such feature in SQL developer. How can we manage team coding in SQL developer?
Thanks a lot.

SQL Developer allows the source code control feature which can full fill your requirements, here are the steps:
1. First connect to oracle database(using sql developer) by providing following info:
username, password, hostname, port(1521 by default), sid (orcl by default)
2. Create a repository:
versioning>create local repository>give local folder for the repository path and also provide connection name that you have created in sql developer application.
Next, expand the subversion node in the versioning navigator.
Next, right click on connection and choose new remote directory and provide sql files then click on Ok.
3. Import the files to be versioned:
In the files navigator, select the directory where you unzipped the files from the prerequisites under the files tab.
Next, versioning > import files
4. veiw the files which you want to be versioned:
view> files> choose the file for inside the navigator> then click on Next.
Now, confirm that connection name is mapped to the local directory and select the node sql files, then click on Next.
Click Browse and select the directory where you unzipped the files from the Prerequisites as the source directory, then click Next.
in the filter page, click next.
In the Options page, deselect the Perform Checkout check box and click Next.
Review the options for the Import operation and click Finish.
In the Versioning Navigator, expand hr_orcl > SQLFiles.
Please follow the link for the details along with the pictorial reference: http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/11g/r2/prod/appdev/sqldev/srccodexmlext/srccode_otn.htm
Thanks.

There are commercial options such as Red Gate's Source Control For Oracle if your employer is willing to stump up some hard cash (and it is well worth the money IMO). But failing that, I've found another guide which is for SQL Developer 3 - it's probably not that different to Suresh's but it is specifically for 3 which is the version you are more likely to be using so I'll include it here. The author seems to be anonymous, but kudos to them for writing it up. I haven't been able to find a guide for version 4 and I haven't used it yet so I can't say if it's changed much.
The essence of this guide is as follows. Note that I have omitted anything relating to setting up an SVN repo as that information is easily available elsewhere.
Integrating SQL developer with SVN
In sql developer, choose, View > Team > Version Navigator
In Version Navigator, right click on Subversion, and select New Repository Connection and Provide the following details:
Repository URL -> http://ipaddress/svn-repos/project-repos
Connection Name -> Any user defined name.
User Name -> User name of user who is allowed to login into the repository.
Password -> Password of the above user.
Click Test Read Access, to ensure that connection to repository was successful.
Adding Files to repository.
Initially the repository (project-repos) is empty. To add files to the repository follow the steps below.
Choose View > Files. Files tab will appear in Sql developer.
In the Files tab, expand My Computer and select the folder which contains the files to be added.
Choose Versioning > Import Files. Follow the six steps of the import files wizard, by selecting destination(svn repository), source (your hard disk files), filters, options.In step 5 of the wizard (options step), check the “Perform Checkout” check box.
Finally click Finish. All the files of the selected folder (step 2) will be imported to svn repository.
In the versioning Navigator, select the connection name for the repository and click the refresh button. All the files that you have added will appear with their version number in brackets.
Accessing the repository.
Now the repository has been created and files have been imported to repository, other users will need to access the repository.
Create the connection to repository as shown in section 1.
In Version Navigator,expanding the connection name will show all the files imported in Section 2.
Under the connection name select the folder containing the files.
Right click the folder and select Check-out.
Select the destination folder where you want the files to created on your hard drive.
Click ok.
Go to Files tab and click refresh.
Expand the tree and look for the folder the you selected in Step 5. This folder will now contain all the files that you have exported from the repository to your hard drive.
Making changes to files and committing changes to repository.
Any user can make changes to files (files that he has checked out (exported) from repository in section 3 or he has added to repository in section 2).
From the Files tab, go to the folder that you have imported/exported to/from the repository.
Select the file to modify,by double-clicking.
File will open in edit mode. Make the required changes and save it. After you save the file, an asterik(*) will appear near the name of file in Files tab.
Right click the file/folder that contains modified files, and choose Versioning > Commit.
In the dialog box, give your comments for the changes and click Ok. When the commit is successful, the version number of the file will increase by one. All the changes made are now saved in the repository and other users can take these changes as explained in next Section.
Updating changes from the repository.
If a file has been changed and committed by any other user, you can update your local file from the repository version of the file.
In the Files tab, select the file/folder to update.
Right click and choose Versioning > Update.
In the dialog box, choose required options and click ok. Now the file on your hard drive is in sync with the repository file.

Related

how to properly remove files added under "My Project" in solution explorer?

I deleted the file Form1.vb on folder/explorer because I accidentally created it under MyProject in the solutions explorer. but when I tried to rebuild it I'm having below error already.
Severity Code Description Project File Line Suppression State
Error Unable to create a manifest resource name for "My Project\Form1.resx". Could not find file 'C:\Users......\My Project\Form1.vb'.
all data of files is stored in the solution itself, Go to Solution Explorer, Select the file
Either
1.) Right click the folder, Click Delete, Confirm Deletion Process if prompted.
2.) Left click the folder and hit the Delete key on your keyboard.
Do either of these will remove it from your solution and thus, the project. If you have folders being sync'd with git hub it will also update it this way, don't just straight up delete folders from the actual windows explorer though, this could cause pointer issues for reference.
I found the solution.
I created same file with same filename confirmed to replace this with the missing.
then added it again on "MyProject". Project -> Show All Files from the main menu.
I think what I needed was just the Project > show all files.
thank you to everyone who answered above it made me search for this

Monticello - How do I install a package from an online repository (SmalltalkHub) in Pharo?

I can't seem to be able to figure out how to use Monticello with SmalltalkHub. I've used it before to manage local repositories.
Did this:
MCHttpRepository
location: 'http://smalltalkhub.com/mc/BenComan/PointerDetective/main'
user: ''
password: ''
When I opened the Monticello Browser there is no package on the left named PointerDetective.
Do I need to do something extra?
PS. Added a package to the left pane myself and then added the repository from the link to it. If I "Open" it I can install just fine and then a new WhateverPackage appears on the left. Then I just delete my old package.
PS1. Also noticed that when you first open the Monticello Browser, the online repository does appear in the list on the right, and one can Open it. However selecting something on the left changes the right pane, and you can never get back to it unless you quit Monticello and Open it again?
You are right in your 1st PS. To add a repo you need to press "+ Repository" select http and paste there "MCHttp…"
Now on the right side of the inspector you have a dropdown where you select whether you want to see only repos of a selected package or all repos. If you have no package selected you will see all repos anyway (you don't need to reopen browser, you can just deselect package).
Now if you want to associate existing package with a repo, you should either add that repo with having desired package selected, or if the repo is already added, you can right-click it and select "Add to package…"

How do I share IntelliJ Run/Debug configurations between projects?

I have many different versions of my app. Each one is a separate IntelliJ project. Every time I open a new one, the list of configurations starts blank:
The annoying thing about this is I deploy to 1 VM and I have to copy and paste the debug configurations each time I want to test a different version. IntelliJ makes this dialog modal per IntelliJ Instance, so I can't copy and paste the fields between Project Instances.
I end up taking a screenshot of one configuration and copying the fields by hand into the other project. It's a pretty primitive solution. Is there a more convenient way to get a run configuration from one project to another?
I'm using IntelliJ 13 on Windows 7.
Can I share settings for IntelliJ Idea across different projects? may have the answer to this, but the question is different. It's about window layout. Therefore I don't consider it a duplicate.
The best way to do this is to click the "share" checkmark next to Name field when you edit/create the configuration. You can get to this Dialog with Run > Edit Configurations.
The share check-mark pulls the setting out of your workspace.xml and instead puts it in the directory .idea\runConfigurations. This is designed so you can share the setting with others.
You could copy this file and put it in the same location in all your idea projects.
However, in the future, you might want to consider using source control branches for app versions rather than separate projects. IntelliJ handles these very well.
UPDATE (June 2021):
IntelliJ now puts this in the .run folder as its own file, no longer in .idea/runConfigurations.
Run configurations are stored in .idea/workspace.xml by default. First alternative is to share this file but it is not feasible because you also share a lot of unnecessary configurations.
As already said, the first step is to check "share" option to separate run configurations from workspace.xml.
After that, I recommend adding runConfigurations to source control. But the main problem is, probably you have already marked .idea folder as ignored.
You can unignore the folder by configuring your source control system. For example, if you are using git, you can change .gitignore file as follows:
.idea/*
!/.idea/runConfigurations
don't forget adding * after .idea/
As the last step, add your run configurations to source control and enjoy your shared configurations!
goto
Run > Edit Configuration > create or select existing configuration you want to use > click save and persist it on file system > click on share check mark
now copy this file from
PROJECT_ROOT_DIRECTORY/.idea/runConfigurations/ConfigurationName.xml
to your NEW_PROJECT_ROOT_DIRECTORY/.idea/runConfigurations at the same place and it is available now to your run configuration
You should copy the folder
~/your-old-project/.idea/runConfigurations
to
~/your-new-project/.idea/
That's the folder that contains the run configurations.
An update for this question with the new IntelliJ updates:
Now you can "Store as project file" which will create a folder named ".run" and export your setting to that folder. In the example below, I did it for all my test settings. This removes the requirement of editing .gitignore since files are now not outside of ./idea
This is not exactly an answer to your question but it answers a question similar to your question and one that I had, and I'm assuming others might as well.
That is, How to save unit and instrumentation test run configurations? I usually right-click on the test directory which brings up a menu with the option to Run whatever is in that directory. AndroidStudio then creates a run configuration on the fly and in the Run Configuration drop-down menu a new option will appear, "Save new configuration?" or something similar.
Clicking that option brings up the Run Configuration menu and at that point I check the Share box as many others have already mentioned. This then will prompt the version control system to ask me if I want to add this new run configuration file. If you haven't registered your version control system you can find the new files under .idea/runConfigurations.

How to restore a locally deleted file in RTC source control

I deleted a file & package from my local source dir and I'm trying to replace it using RTC. When I view 'pending changes' the file is not appearing so as to add it again. Also when I right click on the project and select 'Compare' there is no option to compare to the latest in the repository. Right clicking and viewing 'Team' also does not seem to have an option to compare. How do I restore a locally deleted file ?
You need to reload your repo workspace, except you can select the part of the project you want to load.
From "Loading Content from a Jazz Source Control Repository in Rational Team Concert 2.0, 3.0 and 3.0.1":
That will restore the latest checked-in version of your file in your local workspace.
You will see more options (for other cases of deletion) in the article "Finding Lost Content with Rational Team Concert".
If its just a few files you need to reload, you can right click on that component and then select Show->Repository File
In the Repository Files browser, you can look for the file to restore. Right click and select "Load" or "Load As" (if you need to specify where to load it.

Moving Reports in Salesforce using Force.com IDE

I'm trying to mass move reports to different folders in salesforce using the Force.com IDE.
I've followed the instructions provided by SarathPM here:
http://success.salesforce.com/questionDetail?qId=a1X30000000IEOSEA4
I update my package.xml, move the corresponding files and then try to save to server.
However, I keep getting the following errors:
When deploying:
Save error: DeveloperName: This Report Unique Name already exists or has been previously used. Please choose a different name.
When saving to server:
Unable to save resource 'All_Leads.report' to server: IllegalArgumentException: Project and/or project package list cannot be null.
There must be a way to move reports in salesforce other than manually saving each report to a different folder. Thanks in advance.
EDIT:
I did a fresh checkout of the reports folder only.
package.xml before
<members>SampleConsultingDashboardReports</members>
<members>SampleConsultingDashboardReports/AvgEngagementLengthByPracticeArea</members
<members>Utility_Reports</members>
<members>Utility_Reports/X10_reports_Account_activities_last_7d</members>
package.xml after
<members>SampleConsultingDashboardReports</members>
<members>Utility_Reports</members>
<members>Utility_Reports/AvgEngagementLengthByPracticeArea</members>
<members>Utility_Reports/X10_reports_Account_activities_last_7d</members>
Save package.xml, move AvgEngagementLengthByPracticeArea.report to Utility_Reports. Refresh in Eclipse, I see the changes. I try to "Save to Server" and it tells me the "Project is not synchronized with the associated Salesforce organization." I bypass the message and try to save anyway, which is when the "Unable to save resource 'Utility Reports' to server" message shows up.
I tried Synchronizing everything with the server before making any changes. Still get the same error messages.
I can confirm that the method described by Sarath, when followed exactly, works. You'll need a more specific repro scenario. I'd suggest trying to move just a single report. Just to be clear, the steps are:
download a fresh copy of your reports metadata via Eclipse
manually edit the package.xml to change the folder of a report. (I think you need to make sure the folder exists on the server, and that you are referring to the developer name of it, e.g. Folder_A/My_report)
in the underlying file system, move that report to a folder of that name
in Eclipse, do a project refresh from the local file system (NOT the server)
in Eclipse, do a save to server
the report should move
If this also does not work, post your package.xml before and after, and the exact steps you followed.