Create a Export Directory:
##########################
On Solaris:
-----------
SQL> create or replace directory sys_dmp as '/u02/expdp';
Directory created.
On Windows:
-----------
SQL> create or replace directory sys_dmp as 'D:\expdp';
Directory created.
Create a separate export user:
##############################
SQL> Connect /as sysdba
SQL> CREATE USER expdpadmin IDENTIFIED BY expdp default tablespace users;
User created.
Grant Export and Import Privileges.
###################################
SQL> GRANT CONNECT,RESOURCE TO expdpadmin;
Grant succeeded.
SQL> GRANT exp_full_database to expdpadmin;
Grant succeeded.
SQL> alter user expdpadmin quota unlimited on USERS;
User altered.
SQL> GRANT READ, WRITE ON DIRECTORY SYS_DMP to expdpadmin;
Grant succeeded.
To check on which directories you have privilege to read & write:
#################################################################
SQL> SELECT privilege, directory_name
2 FROM user_tab_privs t, all_directories d
3 WHERE t.table_name(+)=d.directory_name
4 ORDER BY 2,1;
Exporting Full Database:
########################
expdp expdpadmin/XXXXXX full=y directory=sys_dmp dumpfile=full_db_expdp.dmp logfile=full_db_expdp.log
Update: Take a look at my other post on "How to perform a full database export using original export/import utility?"
http://sabdarsyed.blogspot.com/2008/08/how-to-perform-full-database-export.html
Regards,
Sabdar Syed.
Saturday, December 16, 2006
Wednesday, December 13, 2006
Group and User Creation in Solairs.
This post is for creating an Unix Group and a User.
Solaris 5.10
--------------------------------------
Creating a Group:
--------------------------------------
For instance: Group - dba
Login as ROOT User
login: root
Password:
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
#
To Check whther the group is already created.
# grep dba /etc/group
or
# cat /etc/groupgrep dba
If dba group info is not displayed, then
To create a Group:
# groupadd dba
Syntax: groupadd -g
# cat /etc/groupgrep dba
dba:103:
Note: The gid, which needs to be changed, should be not being the gid of other group.
Example:
# usermod -g 333 dba
UX: groupmod: ERROR: 103 is already in use. Choose another.
To remove a Group:
# groupdel dba
# cat /etc/groupgrep dba
Commands:
---------
Create Group - groupadd
Modify Group - groupmod
Remove Group - groupdel
For more details, check the man pages i.e. man groupadd, man groupmod, and man groupdel
--------------------------------------
Creating a User Account:
--------------------------------------
For instance: User - Oracle
Login as ROOT User
login: root
Password:
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
#
To Check whther the oracle user is already created.
# grep oracle /etc/passwd
Or
# id –a oracle
If Oracle group info is not displayed, then
To create a User:
# useradd –d /export/home/oracle –m -g dba -s /bin/sh oracle
Note: In the above command
Option -Discription -Value
------------- -------------------- --------------------
-d -Home for the Oracle user -/export/home/oracle
-m -For making directory
-g -Primary Group dba
-s -Default Shell for the User -/bin/sh
Login -Name -Oracle
# grep oracle /etc/passwd
oracle:x:100:100::/export/home0/oracle:/bin/sh
To modify a User:
For example: To Comment the user and assing secondray group to the user
# usermod -c "Owner of the Oracle Software 10g" -G oinstall oracle
Note: In the above command
Option -Discription -Value
------------- -------------------- --------------------
-c -Comment -"Owner of the Oracle Software"
-G -econdary -Group oinstall
# grep oracle /etc/passwd
oracle:x:100:100:Owner of the Oracle Software 10g:/export/home0/oracle:/bin/sh
To set a password:
# passwd -r files oracle
New Password: XXXXXXXX
Re-enter new Password: XXXXXXXX
passwd: password successfully changed for oracle
Note: Where XXXXXXXX is the new password for oracle User.
To remove a user:
# userdel -r oracle
Note: The "-r" option is used to remove the user's home directory from the system.
And the Oracle user account should not be removed until and unles required, and
this should not be done on Production Servers.
# grep oracle /etc/passwd
Commands:
---------
Create a user - useradd
Modify a user - usermod
Rmove a user - userdel
seta password to the user- passwd
For more details, please check the man pages in UNIX i.e. man useradd, man usermod, and man userdel
Regards,
Sabdar Syed.
Solaris 5.10
--------------------------------------
Creating a Group:
--------------------------------------
For instance: Group - dba
Login as ROOT User
login: root
Password:
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
#
To Check whther the group is already created.
# grep dba /etc/group
or
# cat /etc/groupgrep dba
If dba group info is not displayed, then
To create a Group:
# groupadd dba
Syntax: groupadd -g
# cat /etc/groupgrep dba
dba:103:
Note: The gid, which needs to be changed, should be not being the gid of other group.
Example:
# usermod -g 333 dba
UX: groupmod: ERROR: 103 is already in use. Choose another.
To remove a Group:
# groupdel dba
# cat /etc/groupgrep dba
Commands:
---------
Create Group - groupadd
Modify Group - groupmod
Remove Group - groupdel
For more details, check the man pages i.e. man groupadd, man groupmod, and man groupdel
--------------------------------------
Creating a User Account:
--------------------------------------
For instance: User - Oracle
Login as ROOT User
login: root
Password:
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
#
To Check whther the oracle user is already created.
# grep oracle /etc/passwd
Or
# id –a oracle
If Oracle group info is not displayed, then
To create a User:
# useradd –d /export/home/oracle –m -g dba -s /bin/sh oracle
Note: In the above command
Option -Discription -Value
------------- -------------------- --------------------
-d -Home for the Oracle user -/export/home/oracle
-m -For making directory
-g -Primary Group dba
-s -Default Shell for the User -/bin/sh
# grep oracle /etc/passwd
oracle:x:100:100::/export/home0/oracle:/bin/sh
To modify a User:
For example: To Comment the user and assing secondray group to the user
# usermod -c "Owner of the Oracle Software 10g" -G oinstall oracle
Note: In the above command
Option -Discription -Value
------------- -------------------- --------------------
-c -Comment -"Owner of the Oracle Software"
-G -econdary -Group oinstall
# grep oracle /etc/passwd
oracle:x:100:100:Owner of the Oracle Software 10g:/export/home0/oracle:/bin/sh
To set a password:
# passwd -r files oracle
New Password: XXXXXXXX
Re-enter new Password: XXXXXXXX
passwd: password successfully changed for oracle
Note: Where XXXXXXXX is the new password for oracle User.
To remove a user:
# userdel -r oracle
Note: The "-r" option is used to remove the user's home directory from the system.
And the Oracle user account should not be removed until and unles required, and
this should not be done on Production Servers.
# grep oracle /etc/passwd
Commands:
---------
Create a user - useradd
Modify a user - usermod
Rmove a user - userdel
seta password to the user- passwd
For more details, please check the man pages in UNIX i.e. man useradd, man usermod, and man userdel
Regards,
Sabdar Syed.
Tuesday, December 12, 2006
Subscribe to:
Posts (Atom)