Mohamed Azar Shaj

Oracle DBA, azarmohds@gmail.com, Riyadh Kingdom Of Saudi Arabia

Oracle Certification ** Oracle-Base ** Export and Import ** Charater set migration

About Me

My photo
Database Administrator and like to read about hackers and them activities...and completed Oracle 10g Certified associate. Active member of Oracle Forum

Full Database Export

4:51 PM / Posted by Azar Mohamed Shaj / comments (0)

When and why to perform a full database export.

* Export/import is only the possible way to construct a similar database on remote servers regardless of Operating System compatibility i.e. cross platform (Export on Linux and Import on Windows Systems).

* To migrate the database from one Operating System to another i.e. (Linux/Unix to Windows), and to upgrade the database from one version to another i.e. 8i-9i or 9i-10g, but not vice versa.

* If you are on Oracle 10g, above two points can be possible, using RMAN Convert Commands i.e. to construct or move a database from one OS to another OS i.e. Cross platform.

* When there is a requirement to clone a database on another test or development server, then take a full database mode export dump and create a database with the similar settings of target database, and import the dump in source database.

Simple Steps: how to perform a full database export using export utility.

* Use either system user or any other database user who has the EXP_FULL_DATABASE privilege.
* Set the NLS_LANG environment variable according the database character set and language details.
SQL> select * from nls_database_parameters
2 where parameter in ('NLS_LANGUAGE','NLS_TERRITORY','NLS_CHARACTERSET');

PARAMETER VALUE
------------------------------ ----------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CHARACTERSET WE8ISO8859P1

Windows (Dos Prompt):
C:\> set NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1

Unix/Linux:
$ export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1

* Start the export with following command and options.

exp system/password@mydb file=c:\exportdmp\exp_fulldb_MYDB_27Aug08.dmp
full=y log= c:\exportdmp\exp_fulldb_MYDB_27Aug08.log

Note: This is just a simple export command to perform the full database export. I would request and suggest you to refer Oracle Documentations on export/import and their options. Check the references.

Help on Export and Import:

Windows:
C:\> exp help=y
C:\> imp help=y

Change Oracle password

1:49 PM / Posted by Azar Mohamed Shaj / comments (1)

Location of Oracle Password hashes

* Database -sys.user$ -password
*Oracle Password File
*Data File of the system Tablespace
*(full) Export Files
*archive logs

Show oracle password hashkey

sql>select username,password from dba_users;

sql>select name,password from sys.user$ where password is notnull.

How to change an Oracle Password?

You should always use the pasword because the password is sent unencrypted over the net If you use the alter user syntax.

* alter user myuser identified bu my!supersecretpassword;

*grant connect to myuser identified by my!supersecretpassword

*update sys.user$ set password='F894844C34402B67' WHERE name='SCOTT';restart the database necessary

*sql*plus command:password or password username.

How to change an Oracle password temporarily?

In Oracle it is possible to change a password temporarily. This can be useful for DBA which act as a different user.

SQL> select username,password from dba_users where username='SCOTT';

USERNAME PASSWORD-------- ----------------SCOTT F894844C34402B67

SQL> alter user scott identified by mypassword;

Now login with the following credentials: scott/tigerAfter doing your work you can change the password back by using an undocumented feature called "by values"

SQL> alter user scott identified by values 'F894844C34402B67';

http://www.red-database-security.com/whitepaper/oracle_passwords.html

Oracle Database created as 32bit or 64bit

7:33 PM / Posted by Azar Mohamed Shaj / comments (0)

We can check the Database Created as 32bit Or 64bit Platform through below sql query


SQL> select metadata from sys.kopm$ ;METADATA
-----------------------------------------------------------0000006001240F050B0C030C0C0504050D0609070805050505050F05050505050A050505050504050607080823472323081123081141B023008300B207D00300000000000000000000000000000000000000000000000000000000000000000000000000


If above Colored Character Is "B023" means 32bit


Or
If it is "B047" means 64bit.

HWM -High Water Mark

7:19 PM / Posted by Azar Mohamed Shaj / comments (0)

Oracle, stores data in segments. Segments has free and used space. The mark(a logical mark) between free and used space can be called as high water mark(HWM). When new data filled, the mark moves. On deleting records, oracle does not move back HWM. That is, you have unused data but, HWM sees as if it were filled data. When you shrink table such as alter table move command, this HWM refreshes itself.

When you delete from a table, a DML operation, oracle undos the changing. That is you can move back, with some additional works. But when you truncate a table, a DDL operation, oracle moves back the HWM. So this is faster than normal delete clause. With delete, you will fire existing triggers whereas truncate does not.

Truncate is especially is used instead of dropping and recreating tables. with truncate, no objects will become invalid and grants are remains the same

What Is Bottleneck ?

Bottleneck is the slowest operations of the set of operations. It is important to identify in the bottleneck in the system to know what needs to be turned to be better Performance and scalabilty.

Some Examples :-

The I/O system may become a bottleneck on large database system.

If a database used more memory than what’s available,paging and swapping will become a bottleneck.

In a RAC system the interconnect may be overloaded (cannot handle all data transfers

Connect sysdba

7:09 PM / Posted by Azar Mohamed Shaj / comments (0)

There is two method to connect sysdba user :-

with password

without password

sql> conn / as sysdba ------ without password

* Oracle database user must have sysdba privileges.
* Os user must add in dba group.
* In sqlnet.ora file must content "NTS" in below line

sqlnet.authentication_services = (NTS)
****************************************************
with password

sql>conn sys/pwd as sysdba ------- with password

prevent to connect without password.
* remove os user from dba group.
* edit sqlnet.ora file and change "none" to "nts" in below line.
sqlnet.authentication_services =(none)
Default value is nts when sqlnet.ora file created.
***************************** DBA ******************

IMPORT DUMPFILE WITHOUT KNOW EXPORT USER NAME

6:45 PM / Posted by Azar Mohamed Shaj / comments (0)

cmd>imp file= log= full=y show=y indexfile=<> userid=system/password

for example

cmd>imp file=d:\test.dmp log=d:\tb\test.log full=y show=y indexfile=d:\tb\test.sql system/manager

after execute this commands,you should go to check indexfile and logfile.

Remove Linux Partition

9:11 PM / Posted by Azar Mohamed Shaj / comments (0)

Hi..You would like to uninstall linux ... Do the follow steps

  1. Before removing a partition, boot rescue mode
  2. Start parted ,where /dev/hda is the device on which to remove the partition
  3. In command mode
  4. >list hard-drives
  5. >parted /dev/hda or /dev/sda
  6. >print
  7. >rm 2
  8. exit and then you can install another OS on your system like windows xp or any.