Is there a way to find ddl scripts for creating users in Oracle Sql Developer - oracle

In Toad, it's easy to look for a ddl script that creates a user with all its grants and roles:
In Oracle SQL Developer, I find a similar option but it's not complete:
Is there a way to have same Toad's information in Oracle SQL Developer?

It's a bit more convoluted, and might make more sense with pictures but I can't create those right now... but if you go to the 'View' menu and choose 'DBA' you get a second panel on the left (titled 'DBA', unsurprisingly).
Click the green + button and pick your connection from the drop-down list in the dialog box; it will then appear under 'Connections' in that panel. Expand that connection, then 'Security', then 'Users'. You'll see all the database users listed.
Right-click on a user and choose 'Create like...' from the contextual menu, which will give a new dialog that's very similar to the one you already found.
Enter a user name and password to make the next step make more sense, then go go the 'SQL' tab, and you'll see something similar to what Toad produced.
You can also use the DBMS_METADATA package to extract the DDL manually; that has been covered here and on DBA.SE.

Related

Generate ER diagram from SQL Script

I have some SQL scripts written in a .sql file
I need to generate ER diagram using those scripts, so that I can verify the relationships and then get them executed in the DB.
Can anyone help me on how I can achieve this?
I would prefer doing this in SQLDeveloper
EDIT: As ismetguzelgun suggested me in his answer to execute the scripts first and then export the diagram through data modeler. I do not have the permission to execute DML commands in the Database and I do not have any other database as well where I can execute this. So that option is not going to work out for me.
Just use the import feature.
File - Data Modeler - Import - DDL Script
Point to one or more .sql files.
A dialogue will appear showing what's about to be added to your design. Make sure everything's checked and hit the Merge button.
Your new/existing design is ready!
If you don't see anything in the diagram area, zoom out or use the Navigator window to make sure you're in an area with your tables. Or use the tree on the left, pick a table, and right click, 'Go to Diagram' - it will take you directly to that object in the diagram.

OleDbException Cannot open file dbf

After I run a query, SELECT SomeColumn FROM SomeTable, via the command window in VFP, I'm unable to access that table from C# using the OleDb Provider until I close VFP.
System.Data.OleDb.OleDbException: 'Cannot open file \\some-server\some-share\SomeTable.dbf.'
It's like VFP is not closing the file handle after executing the query.
How do tell VFP to close the file/table w/o having to close VFP?
use
without any argument closes the table\cursor in current work area.
use in (select('SomeTable'))
closes it in any work area, only if it is open.
Both commands are scoped to current data session. If you are using any sessions other than the default one, then you need to loop those sessions and close in there.
An easier way would be to execute:
set exclusive off
in VFP before opening any tables. Then the tables would be opened shared, and you could open them both from VFP and outside.
Or make that a permanent setting by going to Tools -> Options -> Data and unchecking "Open Exclusive":
BTW, I replied thinking about any table that you would open by using "use" or "select ... from thatTable".
Your question is vague though, maybe you mean the table is created as a result of the query (your query doesn't have that destination though). If that is the case, then the created table is in exclusive use until you close it (using one the commands at top).

Export table dump using SQL DEVELOPER

I need export table dump using SQL DEVELOPER
I do: View->DBA then right click on data pump and then data pump export wizard
In opened export wizard window, I choose Tables type, then click next and in second step, there are not displayed any tables:
Though, I have several tables in current connection (under this user).
What is problem here? why I cant see table list for exporting?
SQL DEVELOPER version: 4.0.3
Click the 'Lookup' button.
By default it will export all tables for your user. Use this page if you only want to export certain tales.
Click the 'More' button if you want to browse by user.

Query Designer does not recognize quotation marks in the name of synonym (Oracle)

I need to get access to a synonym on a Oracle database.
What I have done so far is:
-Create a DataSet.
-Open the server explorer.
-Open the dataset designer and put the synonym (let's say it's name is "abc") in the dataset designer.
-Right click on 'add query' and then open the query designer.
The problem is when I try to write:
SELECT * FROM myschema."abc"
the system automatically delete the quotation marks so it will end in an Oracle's exception (ORA-00942) which tells me that the table or view does not exist.
There is no way I can rename the synonym.
Is there a way to turn off the autocorrection feature?
I can also get access through DataReader but I want to use the dataset designer.
I am using Visual Studio 2010.
Thx
Edit:
This problem does only appear when I am using Oracle provider.
I created a synonym with the same name in a MSSQL database and the system automatically recognize the synonym with quote marks.
It seems that it's a bug in the oracle provider.
You need to put quotation mark around your table name also. Try this:
SELECT * FROM "myschema"."abc"
It worked for me

PL/SQL Developer: How to find variable references?

In a Oracle package, How can I find out all the references for a variable? Like you would do it in Eclipse or Visual Studio.
Is this feature supported in any Oracle IDEs like TOAD, Sql Developer or PL/SQL Developer? I am using PL/Sql developer?
In PL/SQL Developer I'd use the "Find Database Objects" tool (Tools menu, "Find Database Objects", or hit the binoculars button on the browser). Enter the text you want to find (e.g. the name of your variable) in the "Text to find" box, enter the schema name of the object you're interested in in the Owner box, and enter the package name you're interested in in the "Name" box. Select the objects types you want to search (Functions, Procedures, etc) and then click the Search button.
If you're interested in fully-qualified uses of a variable you can just enter something like SCHEMA_NAME.PACKAGE_NAME.VAR_NAME - or try PACKAGE_NAME.VAR_NAME for partially-qualified uses.
Share and enjoy.
Two ways, you can find
1) hit the binoculars button
2) Using Query(Works for Oracle)
select * from ALL_SOURCE where text like '%some string%';
There is PL/Scope, but to be honest it's a bit of a beast and I've never tried it myself.
Of course you can search within the current package and see all occurrences highlighted, but that isn't ideal as a text search doesn't take scope into account and there could be more than one variable with the same name.
PL/SQL Developer's Refactor option can parse variable scope, so I don't see why it couldn't highlight all references in the current package at least. maybe you could propose it on the Allround Automations PL/SQL Developer forum and get one of marco's famous 'I have added this to the list of enhancement requests' answers. (Be sure to remind him about it with a follow-up post every 5 years or so.)

Resources