11. Nov. 2008

Sooner or later it will come to a situation in which we have to transfer data between different database. Given the fact we have to do a normal database upgrade Oracle Export/Import will help us to do as long we will go with a full database export and all users, priviledges, permissions and quota will get transfered.

Now given the case that we based on schedules or migration plans just have to overtake single schemas world does look different. Oracle Import will expect theuser schema already exisiting and even try to create all database objects in relation to their old location within the former database.

Now I’m not going to explain you how to change tablespace or storage information within this posting … perhaps in another one … but will try to help you with pre-setting up the schema and additional security information before importing the data.

As for we work with some database system all data can for sure get queried and even stored within directly executable sql statement. Since years I’m working with an easy to use set of scripts collecting these information for me.

Feel free to download it from here and using it for your own pleasure.  When unpacked you can call the script 0_capture_security_information.sql within SQLPLUS and you will get generated another result set of scripts containing all users, roles and granted system and role priviledges stored with the database you are connected too.

Connecting now to the new target database and executing the scripts full or in parts will allow you to set up security there again.

10. Nov. 2008

For security reason you should change the root password of your MySQL installation immediately! Unfortunately and even it is very easy many users leave it untouched though.

There are several way to do and a lot of MySQL tools will assist nad help you with that. But to give you a helping hand with your security we will share the most two common ways to do with you here.

First there is the possibility to directly change it on your server prompt by entering a simple command forcing the MySQL engine to ask for a root password further on:

To change your the MySQL root password to PaSsWoRd, use:

mysqladmin -u root password PaSsWoRd

Another way to succeed could be changing it by SQL statement:

grant all on database.* to username@’%’  identified by “password”;
grant all on database.* to username@’localhost’  identified by “password”;

With this given example you can do both, either create a new user or change the password for an already existing user.

Please take care about to substitute the given variable within the SQL statement for database, username and password with appropriate values though. As also be aware that based on MySQL is differencing between local and remote traffic you have to do for both sources!

Already set a password and later on, you have to use the following command:
mysql -u root -p and at command login prompt password:  “type in your password” to then go on executing the statements above.

4. Nov. 2008

Sooner or later with a permanent growing database we will end up in a situation that our night isn’t just long enough anymore to backup our database completely.

Now you might wonder about what size of database I’m talking about right now. But seriously, database at a size of several terrabyte are nothing uncommon today anymore. Especially when it comes to SAP or similar applications working on them databases can grow exceptional sizes..

The Oracle Database Version 10g now comes along with some new feature helping us to deal with that situation. It is a feature called Block Change Tracking and marks down all modified database blocks changed by all transactions within an additional external file.

When a commit is issued against a data block, the block change tracking information is copied to a shared area in Large Pool called the CTWR buffer and during the next checkpoint, the CTWR process writes down the information from the CTWR RAM buffer to the former defined change-tracking file.

Now doing an incremental backup with Oracle 10g, RMAN has a mechanism to identify and bypass those data blocks which have not changed by just easily following the list of changed blocks within this file.

The syntax for Oracle block level change tracking is simple:

    ALTER DATABASE
    ENABLE BLOCK CHANGE TRACKING
    USING FILE os_file_name;

By default, Oracle does not record block change information!

To enable this feature, we need to issue the following command:

SQL> alter database enable block change tracking;

To disable this feature, we issue this command:

SQL> alter database disable block change tracking;

So it’s an absolutely easy to configure mechanism, being able to speed up our nightly incremental backups dramatically. Leaving the full backups for the weekends, customers then hopefully don’t mind.

The only thing we have to be aware about is the space this file later on will need to get written. Based on our databases transaction load this change-tracking file can reach some serious size for sure.

« previousnext »