Skip to main content

Posts

Setting up Network on Database server using the Command Line

Sometimes as a DBA you may find yourself in a database server environment without any graphical interface and you are forced to use the command line to setup the network. The procedure below shows you how to do that:- You setup a dynamic IP by editing the file: /etc/sysconfig/network-scripts/ifcfg-eth0 as root user It should look like this: DEVICE=eth0 HWADDR=08:00:27:37:A4:23 -------- ( ! replace with your network device macc addr ) TYPE=Ethernet UUID=6c8852cb-7819-46a3-9d ------- ( ! must not be the same) ONBOOT=yes --- ( ! very important) NM_CONTROLLED=yes BOOTPROTO=dhcp For static ip edit the same file if you are using the device eth0 and just add the following: DEVICE=eth0 BOOTPROTO=STATIC IPADDR=192.168.0.5 NETMASK=255.255.255.0 GATEWAY=192.168.0.1 ONBOOT=yes After saving the changes, you need to restart the network daemon using the following command:- $ sudo /etc/init.d/network stop $ sudo /etc/init.d/network start This should provide IP address...

AUTOMATING STARTING AND STOPPING THE DATABASE AND LISTENER ON LINUX

It is sometime desirable by most DBAs to have the oracle database and listener automatically shutdown and startup when the server reboots. The following steps shows you how to automate your database and listener shutdown and startup. Please note that this demonstration is linux centric (I am working on OEL 6.8), so if you are working with a different Unix platform, refer to the Oracle Database Admin’s Guide. 1. Edit the /etc/oratab file, and place a Y at the end of the entry for the database you want to restart automatically when the system reboots. You will need root priv to edit the file: 2. Paste within the file a line similar to the one below, for your environment: db11g:/u01/app/oracle/product/11.2.0/dbhome_1:Y Note: The entries are of the form: #   $ORACLE_SID:$ORACLE_HOME:N|Y: 3. As root, navigate to the /etc/init.d directory, and create a file named dbora: Paste the following lines in the dbora file. Make sure you...

Aspects of Implementing and Maintaining Indexes

There are various aspects of implementing and maintaining indexes. The table below summarizes some to the guidelines and techniques for creating indexes. Guideline Reasoning Create as many indexes as you need, but try to keep the number to a minimum. Add indexes judiciously. Test first to determine quantifiable performance gains. Indexes increase performance, but also consume disk space and processing resources. Don’t add indexes unnecessarily. The required performance of queries you execute against a table should form the basis of your indexing strategy. Indexing columns used in SQL queries will help performance the most. Consider using the SQL Tuning Advisor or the SQL Access Advisor for indexing recommendations. These tools provide recommendations and a second set of "eyes" on your indexing decisions. Create primary key constraints for all tables. This will automatically create a B-tree index (if the colu...

Differences between Oracle and Mysql

Some key differences for DBAs between Oracle and MySQL database servers include: Oracle architecture is process based, MySQL architecture is thread based. Different tools used for backup and recovery. Database specific SQL syntax. Database specific SQL functions. Different  syntax for stored routines. MySQL has no packages. MySQL  routines are not compiled and run in each session thread and not in global memory. MySQL  only supports row-level triggers. Different  tools used to manage and monitor database servers. Different  startup and shutdown processes. Oracle  RAC is a shared disk solution while MySQL Cluster is a shared nothing solution. The  default configuration for MySQL is very lenient in terms of data integrity. A MySQL DBA must tighten down data integrity for it to work like traditional databases. With  Oracle, the CREATE DATABASE command is used to create the physical storage for...

How to Read PGA Memory Advisory Section in AWR and Statspack Reports

APPLIES TO: Oracle Database - Enterprise Edition - Version 9.0.1.0 and later Information in this document applies to any platform. ***Checked for relevance on 12-Nov-2013*** GOAL The goal of this note is to illustrate how to read/interpret the PGA Memory Advisory section in AWR and Statspack reports, and tune the PGA_AGGREGATE_TARGET instance parameter based on the findings. SOLUTION The preferred and easiest way of monitoring and setting the PGA_AGGREGATE_TARGET instance parameter is by examining the 'PGA Memory Advisory' section in an AWR or Statspack report. PGA Memory Advisory for DB: AAA Instance: aaa End Snap: 20555 Estd Extra Estd P Estd PGA   PGA Target    Size       W/A MB   W/A MB Read/      Cache  Overalloc      Est (MB)     Factr     Processed Written to Disk     Hit %  ...

Oracle vs. Microsoft SQL Server

Many Similarities, But Different? RDBMSs: There are allot of different relational database management systems (RDBMS) out there. You may have heard about Microsoft Access, Sybase, and MySQL but the two most famous and widely used are MS SQL Server and Oracle. Although there are many common things between the two RDBMSs there are also a number of key differences.  In this blog, I will take a look at several in peculiar, in the areas of their command language, how they manage transaction control and their management of database objects. LANGUAGE: Perhaps the foremost obvious distinction between the 2 RDBMS is the language they use. Though each systems use a version of Structured Query Language, or SQL, MS SQL Server uses Transact SQL, or T-SQL, which is an extension of SQL originally developed by Sybase and used by Microsoft. Oracle, meanwhile, uses PL/SQL, or Procedural Language/SQL. Both are different "flavors" or dialects of SQL and both languag...

CUSTOMIZING YOUR SQL PROMPT

I recently read an article that have an SQL prompt displyaing "user@hostname". As DBAs we frequently use SQL*Plus to perform daily administrative tasks. Often, you'll work on servers that contain multiple databases. Obviously, each database contains multiple user accounts. When connected to a database, you can run the following commands to verify information such as your username, database connection, and hostname:   SQL> show user;  SQL> select name from v$databae;   A more efficient way to determine your username and SID is to set you SQL prompt to display that information; for example,   SQL> SET SQLPROMPT '&_USER.@&_CONNECT_IDENTIFIER.> '   An even more efficient way to configure your SQL prompt is to have it automatically run the SET SQLPROMPT command when you log in to SQL*Plus.   Follow these steps to fully automate this:  1. Create a file named login.sql, and place in it the SET SQLPRO...