Skip to main content

Posts

Showing posts from January, 2015

Identity Columns in Oracle 12c

If you are familiar with the database platforms mostly found on Windows platforms, you're know that  you can set a default value for a column. This is commonly referred to as an Identity column. This feature was not available in Oracle, until the release of 12c. Let's see how it's done. 0) set your container (yes, I've been playing with Pluggable Databases). NOTE: before we go any farther, you will need two roles assigned to create a table with an identity column: CREATE TABLE  CREATE SEQUENCE When you thought about it, that was pretty obvious, wasn't it. 1) create table, with a column defined like so: 2) Insert some data like so: NOTE: these statements will cause errors still: The first statement fails, because the order of columns is not specified even though we have a default value specified for the identity column. Identity columns are traditionally the first column, but they don't have to be. The second and third statement fails

Unix Fundamentals: File Manipulation

Being an effective user of Unix likely means modifying, moving, renaming, searching for and deleting files and directories. NOTE: Windows has folders. Unix has directories. Functionally they are the same. Only the icons are different. Unix is meant to be a shared yet secure operating system. The security implementation for unix resolves around user, group and global permissions. Each file and directory has permissions attributes for owner, group, and global users. Types of Permissions Owner Access rights for the owner of the file or directory Group Access rights for the group owner of the file Global Access rights for everyone else Using the ‘ls –l’ command, we can see what the file permissions are for any given file or folder, like so: Let’s take a closer look at the access rights. -                        this is not a directory r w x                 owner access is read a

Unix Fundamentals: VI

VI is a barebone text editor. It’s older than most system admins are, so pay it some respect. VI has two modes, edit mode and read mode. Unless mapped properly (and it’s likely not) arrow keys are not available in edit mode. COMMANDS h,l,j,k Move cursor left, right,up,down i Enter edit mode dd(#) Delete # lines :wq or :x or ZZ Write, quit and exit :# Jump to line number # :q! Quit without saving dw Delete word yw Yank (copy) word yy Yank (copy) line p Put yanked text :w name.txt Write new file called name.txt ESC Enter read mode I keep this table printed and taped to the bottom of my monitor. It saves time. 

Unix Fundamentals: CRON

CRON CRON is a unix utility which allows processes to be executed on a scheduled basis. It’s power is in it’s simplicity. Each user on the server has their own cron table; so user x can’t see the cron table of user y. More concretely, gswadmin doesn’t have access to oracle cron table and vice versa. Jobs and commands can be scheduled in the cron table using the crontab command. Entries into the cron table have three parts; scheduling, command, output redirection. The scheduling piece has allows jobs to be run up to the at any time increment between a minute and a year. An example of a cron table entry is as follows: * * * * * /oracle/bin/example.sh > /tmp/example.log 2>&1 ‘*’ is a wild card that indicates every increment. Here are some scheduling examples, 05 * * * * /oracle/bin/example.sh > output.log Runs every 5 minutes after every hour, every day of the month, every month, every day of the week. * 13 * * *