miercuri, 8 iunie 2016

Oracle DB expdp ORA-39071: Value for SCHEMAS is badly formed solved

If you receive this error ORA-39071: Value for SCHEMAS is badly formed, you can get rid of it by logging in with the schema that you want to export.
Example: Let's say you want to export schema test with the password 1234. You can write:
expdp test/1234
The value for SCHEMAS will be by default test and you will not receive ORA-39071 anymore.

vineri, 3 iunie 2016

Windows check if another's computer/machine port is open

If you want to see if antoher's computer/machine port is accesible from your Windows computer/machine type:
telnet <full_machine_name_or_ip> <port>

Example (scenario: test if the default port for Remote Desktop Connection on test_comp computer is open for your computer/machine ):
telnet test_comp 3389

marți, 5 aprilie 2016

Chrome save/bookmark all opened tabs

If you have many tabs opened in your Chrome browser and you need to close the browser (if you need to shutdown/restart your computer) you probably want to save this opened tabs in order to open them later. To save the opened tabs, you can follow these steps:
1. Right click on one of the opened tabs -> choose Bookmark all tabs
2. In the windows that appears give a name to the folder and click Save. Now you have saved your tabs and you can close the browser.
3. Open Chrome and click the button that looks like this = (but with 3 sticks) in top-right -> Bookmarks -> Bookmark manager








4. In the window that appears right click the folder you created at step 2 and choose Open all bookmarks. Now all the tabs should be restored.

Windows set proxy

If you want to setup a a proxy in Windows, you can follow these steps:
1. Open Internet Explorer (I chose this browser because every Windows comes with it)
2. When you are in browser press Alt (to see the Menu bar)
3. Go to Tools -> Internet options -> choose Connections tab -> LAN settings -> check 'Use a proxy server for your LAN' and fill the fields 'Address' and 'Port'.
If you want to set advanced options click on the Advanced button and fill the fields that you need.

Outlook 2013 disable/stop autocorrect

If you are trying to write an e-mail in Outlook 2013 and you don't want that your text to be autocorrected automatically you should follow this advice:
Go to File -> Options -> Mail (second in top-left) -> Spelling and Autocorrect -> AutoCorrect Options -> and here you can uncheck what you don't need. In my case, I unchecked 'Replace text as you type' because it was annoying me.

SQL Developer see/check/kill sessions

If you want to check/kill opened sessions with the database, you can follow the steps below (your user must be DBA):
1. In SQL Developer go to View -> Reports. This will show you the window with the reports.
2. In the Reports window go to Data Dictionary Reports -> Database Administration -> Sessions -> Sessions . Here you can see informations about each session. If you need to kill a session you have to select a field of the row you want to delete then right click -> Kill Session

marți, 29 martie 2016

Windows The remote session was disconnected because there are no Remote Desktop client access licenses available

If you get this message "The remote session was disconnected because there are no Remote Desktop client access licenses available for this computer" when you are trying to establish a remote desktop connection, you should follow these steps:
1. Open Run
2. Type regedit and press Enter
3. Now you need to backup the registry key that you will delete. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing, right-click it and choose Export. Choose a location on your computer where you want to keep this backup.If you will need to restore this backup you have to select HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft, click File (top left) -> Import and indicate the file from your system where you saved the backup.



4. Delete the registry key that you backed up at step 3
5. Right-click Remote Desktop Connection and choose Run as Administrator. Now, you should not receive the error anymore and if you check in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft you should see that the registry key MSLicensing was created.

Oracle DB SQL search string/text in all objects function/procedure/package/trigger

If you need to search for a string in all objects (functions/procedures/packages/triggers) of your schema you should run one of the following querys:

select  * from all_source where lower(text) like '%<desired_text>%'; - this will search in all schemas of your database

select * from user_source where lower(text) like  '%<desired_text>%'; -this will search only in the schema that you set when you run the query

Windows machine virtual or physical

If you need to know if the machine that you are logged into  (probably remotely) is virtual or physical you can follow these steps:
1. Open cmd
2. Type systeminfo and wait until the results are generated
3. Look for the line with System manufacturer.
If the machine is physical you should find something like Dell, Asus, IBM or other manufacturer.
If the machine is virtual you should find something like VMware, VirtualBox etc

Java version currently installed

If you need to find out what version of Java is currently installed on your computer, follow these steps:
1. Open cmd
2. Type java -version

Oracle DB SQL number of tables in schema

If you need to find out how many tables are in the schema that you are logged into, run the following query:

select count(*) from user_tables;

duminică, 27 martie 2016

SQL Plus query result in xls file

If you need to obtain the result of a query in an Excel file, follow these example:

1. Create an sql file called 'MyScript.sql' (just as example) that will contain somehting like this:
alter session set current_schema = test;

set markup html on
set feedback off
set pagesize 0 embedded on
spool C:\report.xls

select
    'Header1',
    'Header2',
    'Header3'
from dual
union all
select
   <column1>,
   <column2>,
   <column3>
from <table>;

spool off
set markup html off

2. Use SQL Plus to run this .sql file
  a. From cmd type 'sqlplus <schema>/<password>@<server_name>' (find <server_name> in tnsnames.ora file)
  b. Type ' @<full_path_to_your_sql_file>'
3. You will find the generated file in C:\report.xls

Oracle SQL how to find/identify duplicates in a table/result set

If you need to identify duplicates in a table (or a result set) just run the following query:

select <column>,
          count(<column>)
from <table>
group by <column>
having count(<column>) > 1
order by 2 desc;

<column> = the name of the column you know it should be unique
<table> = the result set in which you want to search (could be a table or another select)

sâmbătă, 26 martie 2016

Windows allow remote desktop connections

If you want to allow remote desktop connections on your computer, follow these steps:
1. Right click on My computer or This PC -> Properties -> Advanced system settings and choose the Remote tab (the last in the right)
2. In the Remote Desktop area, check Allow remote connections to this computer

Windows share folder

If you need/want to share a folder with others, follow these steps:
1. Right click on the folder you want to share and choose Properties
2. Click the Sharing tab and then click Share




















3. From the drop-down list choose Everyone or Find people (if you want to share with specific people) and then click Add
4. Finally choose what permissions you want to give on this folder for those you want to share with

vineri, 25 martie 2016

Oracle expdp impdb is not recognized

If you are facing this message 'expdp'/'impdp' is not recognized as an internal or external command, operable program or batch file follow these steps:
1. Right click My Computer (or This PC) -> Advanced system settings -> Environment variables -> look in the System variables screen -> Path
2. Check if exists the path to the oracle client that is installed on your PC. If you don't have the path, add it. It should be something like 'ORACLE_HOME\bin', or the full path e.g. 'C:\app\<your_username>\product\11.2.0\client\bin'
3. Obviously, you have to check if impdp/expdp are present at the path from step 2. If they are not present you need to reinstall your oracle client and don't forget to add this features.

luni, 14 martie 2016

Windows set environment variable JAVA_HOME

If you need to set an environment variable in Windows, follow these simple steps:

1. Right click on My computer (or This PC in case of Windows 10) .
2. In the window that appears, click Advanced system settings.
3. In the window that appears, click Environment Variables.
4. In the lower screen called System variables, click New 
5. In the window that appears, fill Variable name with 'JAVA_HOME' (for this example) and Variable value with the full path to the JDK that you downloaded eg: 'C:\Program Files\Java\jdk1.8.0_45'.