Skip navigation.

RDBMS Server

Oracle RDBMS Server Articles

Moving multiple tables and indexes between tablespaces at once

David Lozano Lucas's picture

Here I present a simple query to use when we want to move the tables and indexes of several users at once.

To make it one by one:

ALTER TABLE xxxxxx MOVE TABLESPACE TEST;
ALTER INDEX xxxxxx REBUILD TABLESPACE TEST;

To move data from multiple owners.

Saluting. Start - Stop script

David Lozano Lucas's picture

It is an English word that sounds very funny in Spanish, almost unreal.
Well, just wanted to brand the blog with a first entry to introduce myself.
I work as an Oracle and SQL Server DBA (mixed profile, they call it -
concerns twice for the same pay, on me).
Here I will write "how to" articles as they emerge in my day to day.
If you can read Spanish, check out the blog I maintain for a little more time http://blog.davidlozanolucas.com/.

Here is a script to start/stop Oracle databases running in Unix:

[code]
# =======================================================================

The ever expanding UNDO tablespace.

During a quite evening of my last on-call bout I was alerted from our monitors that the UNDO tablespace was running out of free space. Thought of adding of a new data file and be done with it; When I checked the current allocation for this tablespace it was already at 40G - couldn't believe what I was seeing. The undo_retention was set to 7200 and max query length in v$undostat was not that high. One column that did caught my eye was the tuned_undoretention, its value was way very high.

Performing a quick and efficient Performance Tuning audit

Checks to be performed at the machine level (note the example is Red Hat Linux)

run queue should be ideally not more than the number of CPU’s on the machine

At the maximum it should never be more than twice the number of CPU’s.

This is denoted by the column ‘r’ in the vmstat output shown below

vmstat – 5

face:/opt/oracle>vmstat 5
procs memory swap io system cpu
r b swpd free buff cache si so bi bo in cs us sy id wa
4 1 488700 245704 178276 12513572 0 1 10 17 48 1365 40 12 43 5

How to import table with custom type

When importing table that contained custom type, you will encounter an oracle error as shown below:
Import of table containing object type(s) fails with IMP-00061 IMP-00063

cause:
When you import a table that references a type, but a type of that name
already exists in the database. Import attempts to verify that the pre-existing
type is in fact the type used by the table(rather than a different type that
just happens to have the same name).

RMAN checksyntax

RMAN is recommended for backups/restore of oracle databases.It is a very powerful tool and has variety of useful features.There is 'checksyntax' feature in RMAN which allows one to check RMAN scripts syntactically without executing it.This feature is available from 10G release 2.It proves to be useful for checking scriptsfor live databases where one doesnt have leisure to execute scripts any time and any times!!

bash-3.00$ vi rman_bkp.rman

RUN {
ALLOCATE CHANNEL c1 TYPE DISK FORMAT '/data/backup/Hotbkp_Full_%D_%d_%s_%p'; BACKUP database; RELEASE CHANNEL c1;
allocate channel c2 type dis

ORA_ROWSCN for capturing row level changes

I've been working on way to capture changed rows using ora_rowscn for part of an ETL routine. Here are some details of what I've tested and found.

By default, the ora_rowscn pseudo column reports the scn at block level. This means that rows sharing the same block will have the same ora_rowscn, and if one row were to be changed, then scn would be altered for both blocks.

Oracle 10g Data Guard – Quick Switchover with Physical Standby Database

Once the standby database is setup using Data Guard and works properly, you may want to test switchover, or perform switchover to reduce primary database downtime during OS upgrades or hardware upgrades. (To set up a Physical Standby database, please refer to my OraFAQ blog “Oracle 10g – Manually Create a Physical Standby Database Using Data Guard”.)

A switchover allows the primary database to switch roles with its standby database. There is no data loss during a switchover.

How to Identify OS or Oracle 64 bit or 32 bit

How to Identify OS or Oracle 64 bit or 32 bit on Unix
---------------------------------------------------------------
It is very common question which version of oracle I need to install. 32 bit or 64 bit? As a 64-bit operating system can support either a 32-bit database or a 64-bit database. A 32-bit operating system cannot support a 64-bit database. So, version identification of the OS is necessary prior to install oracle.

Oracle 10g - Manually Create a Physical Standby Database Using Data Guard

Step-by-step instructions on how to create a Physical Standby Database on Windows and UNIX servers, and maintenance tips on the databases in a Data Guard Environment.

Oracle 10g Data Guard is a great tool to ensure high availability, data protection and disaster recovery for enterprise data. I have been working on Data Guard/Standby databases using both Grid control and SQL command line for a couple of years, and my latest experience with Data Guard was manually creating a Physical Standby Database for a Laboratory Information Management System (LIMS) half a year ago.