Posted by Mir Sayeed Hassan on December 31st, 2017
Monitoring any table operation from your own schema in Oracle database
SQL> conn mir/mir123;
Connected.
SQL> select table_name from user_tables;
TABLE_NAME
------------
TEST1
SQL> conn sys/sys as sysdba
Connected.
SQL> alter table mir.test1 monitoring;
Table...
Read more..
Posted in DBA Administration | Comments Off on Monitoring any table operation from your own schema in Oracle database
Posted by Mir Sayeed Hassan on December 31st, 2017
How to release deleted file size without reboot of server
Check the size of the disks:
[root@DB ~]# df –h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_db-root 22G 16G 5.0G 76% /
tmpfs 20G ...
Read more..
Posted in MISCELLANEOUS | Comments Off on How to release deleted file size without reboot of server
Posted by Mir Sayeed Hassan on December 25th, 2017
How to delete duplicate rows from the table in oracle database
Now create new table & insert some records init with duplicate:
SQL> create table test_del_dup_rows(eno number(20),name varchar2(20));
Table created.
SQL> insert into test_del_dup_rows values(1,'mir');
1 row created.
Read more..
Posted in DBA Administration | Comments Off on How to delete duplicate rows from the table in oracle database
Posted by Mir Sayeed Hassan on December 25th, 2017
Change the table with Read only in oracle database by using trigger
In this below scenario, Create a table & insert some data in it before restrict then create a trigger to restrict any insert/update/delete statement on table
SQL> conn mir/mir123;
Connected
SQL> create table test_read_only(eno...
Read more..
Posted in DBA Administration | Comments Off on Change the table with Read only in oracle database by using trigger
Posted by Mir Sayeed Hassan on December 25th, 2017
Run SQL Query from Linux command as shown below:
Method 1:
[oracle@testdb ~]$ echo "select table_name from user_tables;" | sqlplus -s mir/mir123
TABLE_NAME
------------------------------
TEST1
TEST2
[oracle@testdb ~]$ echo "select * from test1;" | sqlplus -s mir/mir123
ENO
----------
1
2
Read more..
Posted in MISCELLANEOUS | Comments Off on Run SQL Query from Linux command as shown below:
Posted by Mir Sayeed Hassan on December 25th, 2017
Copy OS files from one location to another by sql*plus using Oracle function UTL_FILE.FCOPY
Overview:
Create the sample 2 directories for test & create 1 file in one of the directory therefore create a user for new test or use existing user. Grant the appropriate privilege to the user and copy the files from one folder to another using the Oracle...
Read more..
Posted in MISCELLANEOUS | Comments Off on Copy OS files from one location to another by sql*plus using Oracle function UTL_FILE.FCOPY