Linux: Errors on FAT32 and NTFS partitions

Linux: Errors on FAT32 and NTFS partitions

Recently I have discovered interesting Linux feature (personally I am using Mint) – partitions with errors are mounted as read only. There are different ways of dealing with errors, depending of file system. FAT32 Install dosfscktools:

To use Dosfsck, you have to indicate the device address you want (Ex. /dev/sdb1, /dev/sdb2, or other device.). To know your device address, open the terminal (CTRL+ALT+T), then run this command:

If your partition is /dev/sdb1, for example, then unmount it first…

Read More Read More

Software: SuperPuTTY

Software: SuperPuTTY

Are you using PuTTY? Why don’t you try SuperPuTTY? Features Docking user interface allows personalized workspace and managing multiple PuTTY sessions easy Export/Import session configuration Upload files securely using the scp or sftp protocols Layouts Supports PuTTY session configurations including Private Keys Supports SSH, RLogin, Telnet and RAW protocols Supports local shell via MinTTY or puttycyg Supports KiTTY Project website SuperPuTTY

PL/SQL: Multiply rows

PL/SQL: Multiply rows

Sometimes we need to insert to the database data that is only slightly different than currently existing data set. For example: we have table called network_elements with column software_version. We want to add new software_version for all current rows and also keep existing ones. The idea is we want to copy all rows with software_version=1.0 but modify field software_version to 2.0.

 

Oracle: tablespace size

Oracle: tablespace size

Tablespace size and freespace can be checked with a following query:

which vs whereis vs locate vs find

which vs whereis vs locate vs find

There multiple search commands in linux and it is good to know when use of particular command is relevant. which Shows the full path of (shell) commands. For example:

  whereis Locate the binary, source, and manual page files for a command.

  locate Find files by name. For example let’s locate where is my system storing backup of /etc/passwd:

  find Search for files in a directory hierarchy. Let’s find all files in my home directory…

Read More Read More

Oracle: fetch DDL for objects

Oracle: fetch DDL for objects

Getting schema (DDL) for Oracle objects (for example a table) is simple.

Valid arguments for function get_dll are: TABLE VIEW FUNCTION TABLESPACE Further information: psoug.org

XML: file formatting

XML: file formatting

xmllint is a command line XML tool. It can be used to format XML files (for example long one-liners, making them more readable for human reader). Sample usage: xmllint --format file.xml > formatted_file.xml Manual is available also online: xmlsoft.org/xmllint.html

Oracle: clear buffer cache

Oracle: clear buffer cache

The FLUSH BUFFER_CACHE clause lets you clear all data from the buffer cache in the system global area (SGA). ALTER SYSTEM FLUSH BUFFER_CACHE; This clause is useful if you need to measure the performance of rewritten queries or a suite of queries from identical starting points. Caution: This clause is intended for use only on a test database. Do not use this clause on a production database, because as a result of this statement, subsequent queries will have no hits, only misses. Source:…

Read More Read More

Oracle: killing sessions

Oracle: killing sessions

Sometimes when things go wrong it is necessary to kill  user session. There are multiple ways to do it. First of all, you need to identify your session with &sid and &serial numbers. select * from v$session where lower(username) = 'my_user_name';   KILL SESSION command asks the session to kill itself. ALTER SYSTEM KILL SESSION '&sid,&serial';   DISCONNECT SESSION command kills the dedicated server process. Syntax is following: ALTER SYSTEM DISCONNECT SESSION '&sid,&serial' POST_TRANSACTION; The POST_TRANSACTION clause waits for ongoing transactions to complete before disconnecting the session. ALTER SYSTEM DISCONNECT SESSION '&sid,&serial' IMMEDIATE; The IMMEDIATE clause disconnects the session and ongoing…

Read More Read More

Oracle: create database link

Oracle: create database link

Database link is a schema object in one database that enables you to access objects on another database. You can create dblink using following syntax:

Example:

Now you can easily copy data from tables from one database to another.