Let's Join and share our day to day activities, Views, Knowledge, Questions and achievements in Oracle Database (8i / 9i / 10g or 11g)
Showing posts with label Utilities. Show all posts
Showing posts with label Utilities. Show all posts

Aug 30, 2010

How to Create and Use OMF


OMF indicates Oracle Managed Files. With the use of Oracle-managed files the administration of an Oracle Database can be simplified. Oracle-managed files eliminate the need for you, the DBA, to directly manage the operating system files comprising an Oracle Database. You specify operations in terms of database objects rather than filenames.

Enable the Creation of OMFs
The following initialization parameters allow the database server to use the Oracle-managed files feature.

1)DB_CREATE_FILE_DEST: Defines the location of the default file system directory where the database creates datafiles or tempfiles when no file specification is given in the creation operation. It is also used as the default file system directory for redo log and control files if DB_CREATE_ONLINE_LOG_DEST_n is not specified.

2)DB_CREATE_ONLINE_LOG_DEST_n:Defines the location of the default file system directory for redo log files and control file creation when no file specification is given in the creation operation. You can use this initialization parameter multiple times, where n specifies a multiplexed copy of the redo log or control file. You can specify up to five multiplexed copies.

3)DB_RECOVERY_FILE_DEST:Defines the location of the default file system directory where the database creates RMAN backups when no format option is used, archived logs when no other local destination is configured, and flashback logs. Also used as the default file system directory for redo log and control files if DB_CREATE_ONLINE_LOG_DEST_n is not specified.

Both of these initialization parameters are dynamic, and can be set using the ALTER SYSTEM or ALTER SESSION statement.

An Example of using OMF :
 
1)Setting the parameter for the session:

SQL> alter session set db_create_file_dest='/oradata';
Session altered.

2)Create Tablespace using OMF:

SQL> create tablespace omf_tbls;
Tablespace created.

3)Check the data file Location:

SQL> select file_name from dba_data_files where tablespace_name='OMF_TBLS';
FILE_NAME
--------------------------------------------------------------------------------
/oradata/ZIYADEV/datafile/o1_mf_omf_tbls_4049w4op_.dbf

Here ZIYADEV is the Database Name.

The dafault location for datafile is Your settings for parameter/Database Name/datafile/Unique Name.dbf

Aug 4, 2010

Oracle Utilities and Tools



ORAPWD

orapwd file=password_file_name_with_complete path password=the_password
orapwd file=password_file_name_with_complete path password=the_password entries = n

n specifies the maximum number of distinct DBAs and OPERs that can be stored in the password file.

Oracle's password file:

If the DBA wants to start up an Oracle instance, there must be a way for Oracle to authenticate this DBA if (s)he is allowed to do so. Obviously, his password can not be stored in the database, because Oracle can not access the database if the instance has not been started up. Therefore, the authentication of the DBA must happen outside of the database. There are two distinct mechanisms to authenticate the DBA: using the password file or through the operating system. The init parameter remote_login_passwordfile specifies if a password file is used to authenticate the DBA or not. If it set either to shared or exclusive a password file will be used.

Deleting a password file:

If password file authentication is no longer needed, the password file can be deleted and the init parameter remote_login_passwordfile set to none.

Password file state:

If a password file is shared or exclusive is also stored in the password file. After its creation, the state is shared. Setting remote_login_passwordfile and starting the database can change the state. That is, the database overwrites the state in the password file when it is started up. A password file whose state is shared can only contain SYS.

Creating a password file:

Password files are created with the orapwd tool.

Adding Users to the password file:

Users are added to the password file when they're granted the SYSDBA or SYSOPER privilege.

show user;
USER is "SYS"
select * from v$pwfile_users;

USERNAME
SYSDB
SYSOP
SYS
TRUE
TRUE

grant SYSDBA to rene;

Grant succeeded.

select * from v$pwfile_users;

USERNAME
SYSDB
SYSOP
SYS
TRUE
TRUE
RENE
TRUE
FALSE

grant SYSOPER to rene;

Grant succeeded.

select * from v$pwfile_users;

USERNAME
SYSDB
SYSOP
SYS
TRUE
TRUE
RENE
TRUE
TRUE

revoke SYSDBA from rene;

Revoke succeeded.

select * from v$pwfile_users;

USERNAME
SYSDB
SYSOP
SYS
TRUE
TRUE
RENE
FALSE
TRUE

SYS@ora10> revoke SYSOPER from rene;

Revoke succeeded.

select * from v$pwfile_users;

USERNAME
SYSDB
SYSOP
SYS
TRUE
TRUE



OraDBA.net