create _oracle_ user &

2
Create "oracle" User and Directories This section covers the steps required to create the UNIX groups (oinstall , dba , and oper ) and user (oracle ) that will be used to install the Oracle Database 11g software.The following O/S groups will be created: Description Oracle Privilege Oracle Group Name UNIX Group name Oracle Inventory and Software Owner oinstall Database Administrator SYSDBA OSDBA dba Database Operator SYSOPER OSOPER oper ASM Administrator SYSASM OSASM asm OSDBA Group for ASM asmdba Note that members of the UNIX group oinstall are considered the "owners" of the Oracle software. Members of the dba group can administer Oracle databases, for example starting up and shutting down databases. New to Oracle 11g is the SYSASM privilege that is specifically intended for performing ASM administration tasks. Using the SYSASM privilege instead of the SYSDBA privilege provides a clearer division of responsibility between ASM administration and database administration. OSASM is a new operating system group that is used exclusively for ASM. Members of theOSASM group can connect as SYSASM using operating system authentication and have full access to ASM. The final group (asmdba ) is the OSDBA Group for ASM. You must create an OSDBA group for ASM to provide access to the ASM instance. This is necessary if OSASM and OSDBA are different groups. In this article, we are creating the oracle user account to have all responsibilities! Note that although we will be creating the ASM O/S group and granting it to the oracle user account, this article does not make use of ASM. Any mention of ASM in this article is for documentation purposes only! The UNIX group oinstall is used by organizations that have separate teams responsible for maintaining the Oracle software and the database(s). In situations like this, the group membership prevents unauthorized access to the database by personal who only maintain the Oracle software. At the same time, it also prevents database administrators from making modifications to the database software and the installation's Inventory directory. If you intend to use the oinstall group during the installation process, then you must set the default group to the one that will be maintaining the database before creating the database or permission problems will arise. In this article, we will be taking care of this issue when we install the database software. The thing to keep in mind is that the UNIX oinstall group (as well as oper , and asm ) is completely optional and is not required if the same individuals will be maintaining the Oracle software, database, and ASM (if used). Some consider it unnecessary work which adds another layer of complexity to the maintenance of the installation. In this type of scenario, all that would be required is the UNIX group dba (and assigning dba as the primary UNIX group for the "oracle" user account). This article (along with other Oracle installation guides on this site) adhere to the Optimal Flexible Architecture (OFA) and create both the oinstall and dba UNIX groups. This guide adheres to the Optimal Flexible Architecture (OFA) for naming conventions used in creating the directory structure. Create Group and User for Oracle Lets start this section by creating the UNIX O/S groups and oracle user account: # groupadd -g 501 oinstall # groupadd -g 502 dba # groupadd -g 503 oper # groupadd -g 504 asm # groupadd -g 506 asmdba # useradd -m -u 501 -g oinstall -G dba,oper,asm -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle # id oracle uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(oper),504(asm) Set the password for the oracle account: # passwd oracle Changing password for user oracle. New UNIX password: xxxxxxxxxxx Retype new UNIX password: xxxxxxxxxxx passwd: all authentication tokens updated successfully. Verify That the User nobody Exists Before installing the Oracle software, complete the following procedure to verify that the user nobody exists on the system: 1. To determine if the user exists, enter the following command: # id nobody uid=99(nobody) gid=99(nobody) groups=99(nobody) If this command displays information about the nobody user, then you do not have to create that user. 2. If the user nobody does not exist, then enter the following command to create it: # /usr/sbin/useradd nobody Create "oracle" User & .bash_profile file

Upload: pravin2projects

Post on 04-Oct-2015

224 views

Category:

Documents


0 download

DESCRIPTION

gfgf

TRANSCRIPT

  • 3/14/2015 Create "oracle" User & .bash_profile file

    data:text/html;charset=utf-8,%3Cdiv%20class%3D%22article-header%22%20style%3D%22margin%3A%200px%3B%20outline%3A%20none%3B%20padding 1/2

    Create "oracle" User and Directories

    This section covers the steps required to create the UNIX groups (oinstall, dba, and oper) and user (oracle) that will be used to install

    the Oracle Database 11g software.The following O/S groups will be created:

    Description Oracle Privilege Oracle Group Name UNIX Group name

    Oracle Inventory and Software Owner oinstall

    Database Administrator SYSDBA OSDBA dba

    Database Operator SYSOPER OSOPER oper

    ASM Administrator SYSASM OSASM asm

    OSDBA Group for ASM asmdba

    Note that members of the UNIX group oinstall are considered the "owners" of the Oracle software. Members of the dba group can

    administer Oracle databases, for example starting up and shutting down databases. New to Oracle 11g is the SYSASM privilege that is

    specifically intended for performing ASM administration tasks. Using the SYSASM privilege instead of the SYSDBA privilege provides a

    clearer division of responsibility between ASM administration and database administration. OSASM is a new operating system group that is

    used exclusively for ASM. Members of theOSASM group can connect as SYSASM using operating system authentication and have full

    access to ASM. The final group (asmdba) is the OSDBAGroup for ASM. You must create an OSDBA group for ASM to provide access to the

    ASM instance. This is necessary if OSASM and OSDBA are different groups. In this article, we are creating the oracle user account to have

    all responsibilities!

    Note that although we will be creating the ASM O/S group and granting it tothe oracleuser account, this article does not make use of ASM. Any mentionof ASM in this article is for documentation purposes only!

    The UNIX group oinstall is used by organizations that have separate teams responsible for maintaining the Oracle software and the

    database(s). In situations like this, the group membership prevents unauthorized access to the database by personal who only maintain

    the Oracle software. At the same time, it also prevents database administrators from making modifications to the database software and

    the installation's Inventory directory.

    If you intend to use the oinstall group during the installation process, then you must set the default group to the one that will be

    maintaining the database before creating the database or permission problems will arise. In this article, we will be taking care of this issue

    when we install the database software.

    The thing to keep in mind is that the UNIX oinstall group (as well as oper, and asm) is completely optional and is not required if the

    same individuals will be maintaining the Oracle software, database, and ASM (if used). Some consider it unnecessary work which adds

    another layer of complexity to the maintenance of the installation. In this type of scenario, all that would be required is the UNIX

    group dba (and assigning dba as the primary UNIX group for the "oracle" user account).

    This article (along with other Oracle installation guides on this site) adhere to the Optimal Flexible Architecture (OFA) and create both

    the oinstalland dba UNIX groups.

    This guide adheres to the Optimal Flexible Architecture (OFA) for namingconventions used in creating the directory structure.

    Create Group and User for Oracle

    Lets start this section by creating the UNIX O/S groups and oracle user account:

    # groupadd -g 501 oinstall

    # groupadd -g 502 dba

    # groupadd -g 503 oper

    # groupadd -g 504 asm

    # groupadd -g 506 asmdba

    # useradd -m -u 501 -g oinstall -G dba,oper,asm -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle

    # id oracle

    uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(oper),504(asm)

    Set the password for the oracle account:

    # passwd oracle

    Changing password for user oracle.

    New UNIX password: xxxxxxxxxxx

    Retype new UNIX password: xxxxxxxxxxx

    passwd: all authentication tokens updated successfully.

    Verify That the User nobody Exists

    Before installing the Oracle software, complete the following procedure to verify that the user nobody exists on the system:

    1. To determine if the user exists, enter the following command:

    # id nobody

    uid=99(nobody) gid=99(nobody) groups=99(nobody)

    If this command displays information about the nobody user, then you do not have to create that user.

    2. If the user nobody does not exist, then enter the following command to create it:

    # /usr/sbin/useradd nobody

    Create "oracle" User &.bash_profile file

    http://esadba.blogspot.in/2011/12/create-oracle-user-bashprofile-file.htmlhttp://esadba.blogspot.in/2011/12/create-oracle-user-bashprofile-file.htmlhttp://esadba.blogspot.com/2011/12/create-oracle-user-bashprofile-file.html

  • 3/14/2015 Create "oracle" User & .bash_profile file

    data:text/html;charset=utf-8,%3Cdiv%20class%3D%22article-header%22%20style%3D%22margin%3A%200px%3B%20outline%3A%20none%3B%20padding 2/2

    Create the Oracle Base Directory

    The next step is to create a new directory that will be used to store the Oracle Database software. When configuring

    the oracle user's environment (later in this section) we will be assigning the location of this directory to

    the $ORACLE_BASE environment variable.After the directory is created, you must then specify the correct owner, group, and

    permissions for it.

    # mkdir -p /u01/app/oracle

    # chown -R oracle:oinstall /u01/app

    # chmod -R 775 /u01/app

    At the end of this procedure, you will have the following:

    /u01 owned by root.

    /u01/app owned by oracle:oinstall with 775 permissions. This ownership and permissions enable the OUI to create

    theoraInventory directory, in the path /u01/app/oraInventory.

    /u01/app/oracle owned by oracle:oinstall with 775 permissions.

    Create Directory for Database Files

    Let's now create the directory that will be used to store the Oracle database files and backup files (on the /u02 file system):

    # mkdir -p /u02/oradata

    # chown oracle:oinstall /u02/oradata

    # chmod 775 /u02/oradata

    # mkdir -p /u02/flash_recovery_area

    # chown oracle:oinstall /u02/flash_recovery_area

    # chmod 775 /u02/flash_recovery_area

    Create Login Script for oracle User Account

    To ensure that the environment is setup correctly for the "oracle" UNIX user account, use the

    following .bash_profile:Login to the database server as the oracle user account:

    # su - oracle

    .bash_profile for Oracle User

    # .bash_profile

    # Get the aliases and functionsif [ -f ~/.bashrc ]; then . ~/.bashrcfi

    alias ls="ls -FA"alias s="screen -DRRS iPad -t iPad"

    export JAVA_HOME=/usr/local/java

    # User specific environment and startup programsexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1export ORACLE_PATH=$ORACLE_BASE/dba_scripts/common/sql:.:$ORACLE_HOME/rdbms/adminexport ORACLE_SID=TESTDB

    export PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/binexport PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/binexport PATH=${PATH}:$ORACLE_BASE/dba_scripts/common/binexport ORACLE_TERM=xtermexport TNS_ADMIN=$ORACLE_HOME/network/adminexport ORA_NLS10=$ORACLE_HOME/nls/dataexport NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"export LD_LIBRARY_PATH=$ORACLE_HOME/libexport LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/libexport LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/libexport CLASSPATH=$ORACLE_HOME/JREexport CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlibexport CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlibexport CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlibexport THREADS_FLAG=nativeexport TEMP=/tmpexport TMPDIR=/tmp

    Posted 30th December 2011 by esadba

    http://esadba.blogspot.in/2011/12/create-oracle-user-bashprofile-file.htmlhttp://www.blogger.com/profile/09177060377577222880