This publication explains how to work with specific methods that are present in the Oracle database, for working with Trees. So, let's get started... --Creating a table for experimenting with trees. create table my_tree ( id nu…
Example of a simple user (schema) creation in Oracle DB: --Create a new user test with a password of 240580 create user test IDENTIFIED BY 240580 default tablespace users temporary tablespace temp --Add a quota for disk space...
To find out which session is blocking a package: SELECT s.*, l.lock_type, l.mode_held, l.mode_requested, l.lock_id1, 'alter system kill session '|| s.sid|| ' '|| s.serial#|| ' ' immediate; kill_sid FROM dba_lock_internal l, v$session…
This script displays the relationships between system processes and sessions in Oracle: select * from v$process p, v$session s where p.addr=s.paddr
This is another method for resolving the error type: ORA-01654: unable to extend. We will learn the tablespace sizes and free space: select file_name,tablespace_name,user_bytes/1024/1024,bytes/1024/1024, maxbytes/1024/1024,autoextensible from dba_data_file
Error when setting up a connection to the server from Oracle SQL Developer: ORA-00604: error occured at recursive SQL level 1ORA-12705: Cannot access NLS data files or invalid enviroment specified To fix, follow these steps: Open the <folder_with_the_environment>\ide\bin\ide.conf file and add the following lines: AddVMOption -Duser.language=en AddVMOption -Duser.region=us And that's it!
A simple email address check looks like this: select * from EMailsTable et where REGEXP_LIKE (et.Email, '[A-z0-9._%-]+@[A-z0-9._%-]+\.[A-z]{2,4}') The script selects from the table with email addresses only those addresses that match the specified regular expression.
For those who have switched from MSSQL to Oracle, like me, it's very uncomfortable to lack such a convenient construction as: select * into #tmp from table1 Where #tmp - temporary table, with which we can further address within the session as with a normal one...
Here is an example of how you can make a script in MSSQL work correctly with dates regardless of regional settings and date format. I personally implemented it in the following way: In the script, write the date as follows: Where data is a string of the following type: - This is the format of the date indicated by the number 120. Therefore, the server will not confuse the month with the day, etc.
It's no secret that when using DISTINCT with SELECT, we get a set of unique records, but it turns out in Oracle, there is another operator for this purpose UNIQUE - and, as experiments have shown, it seems to provide better performance.