This is a blog for DBAs. Various technologies covered here are - Oracle Apps ,Oracle, Mongo DB, AWS-- beginners and experienced. We also provide training on Oracle DBA , Oracle Apps DBA, Mongo. Contact us - fill the "Contact Me" form.
Wednesday, December 10, 2008
Create a user and group in solaris
For adding a group "dba" with groupid "100", the command is->
groupadd –g 100 dba
For adding a user "applmgr" with userid "101" in group "dba" with shell "/bin/sh" and default home directory "/export/home/applmgr", use the following command->
useradd -u 101 -g dba -s /bin/sh -c "applmgr user" -d /export/home/applmgr -m applmgr
The -m option creates the directory if it does not exists.
Saturday, November 15, 2008
How to restore files interactively using ufsrestore in Solaris
First bring the tape to the beginning ->
mt rew
Now move the tape to proper position if required. The following command will move the tape 10 files forward.
mt fsf 10
set the tape in interactive,verbose mode using->
ufsrestore ivf prddb:/dev/rmt/0n
Now we can use "ls" and "cd" command to view what files and directories are there on the tape.
we can now use the add command to add the files for extraction.add <directory/filename>finally we give extract command to extract the files.
extractNow it prompts to "Specify next volume #"Here we can type the volume number and press Return. If you have only one volume, type 1 and press Return.Thursday, November 6, 2008
How to delete old files in solaris
Many times we have a requirement where we want to delete old files. We rather want to delete files based on their creation date-say "n" days old.
For this we have very simple command in solaris->
find /directoryname -mtime +n -exec rm {} \;
example->
find /u9/prddb/9.2.0/admin/PRD_prddb/bdump -mtime +7 -exec rm {} \;
The above command will delete the files which are 7 days old in bdump directory.