Unix Commands for DBAs. This article contains a brief list of commands that most UNIX DBAs will. File and Directory Navigation. The "pwd" command displays the current. The "ls" command lists all files and. If no location is defined it acts on the current directory. The "- a" flag lists hidden "." files. The "- l" flag lists file details. More Examples: ls - al | pg do a full directory listing. ORACLE_HOME/reports. Verify that. the spoolcmd. List files with hidden. Active Directory Terminal Server Profile Location RegistryAs you all know by now there are several areas you can elevate pictures from Active Directory. What I mean is that you can add a picture to the thumbnailphoto. Registry Keys for Terminal Services. The relevant configuration options for terminal servers, terminal server sessions, users, and clients can be found in different. Very useful when you cannot delete a file for an unknown. Shows the. files in a list (just. The option "- h" comes handy to. The parameter - r shows the. R The - R operator makes the ls. The "cd" command is used to change. The "touch" command is used to create a new. The "rm" command is used to delete files. The "- R" flag tells the command to recurse through. R /archive. The "mv" command is used to move or rename. The "." represents the current directory. The "cp" command is used to copy files and. The "mkdir" command is used to create new. The "rmdir" command is used to delete. Show all processes owned by. The "find" command can be used to find the.
The "/" flag represents the staring. Wildcards such as "dbms*" can be used for the. Search everywhere for the specified filefind . DISPLAY" {} \; - print | pg Search all files for the text string "DISPLAY" - takes a while to run ! Display only the lines in /etc/oratab where the lines do not (- v. Tip for Oracle Users. Oracle produces many extraneous files: trace files, log files, dump. Unless they are cleaned periodically, they can fill. To ensure that doesn't happen, simply search for the files with. A. simple command does the trick: find . The "which" command can be used to find the. The "which" command searches. PATH setting for occurences of the specified executable. The "PS1"changes your prompt. PS1="Diego_Master: > "Diego_Master: >. You can also place special symbols in the variable to show special. For instance the symbol \u shows the username who logged in and. If we use these symbols, the prompt can be customized to show. PS1="\u@ \@ \w# "oracle@oradba. R2/db. 1# Here are some other symbols you can use in PS1 shell variable: \! The. command number in the history (more on this later)\d. The. date in Weekday Month Date format\HThe. TThe. same as \@ but displaying seconds as well.\AThe. The. same as \A but with the seconds as well; The "wc" utility displays a count of the. The switches for this. README. txt. 85 README. Join. to file. 2 and output to file. The "tail". let you see a specified number of lines from the end of the filetail. The "head". let you see the specified number of lines from the top of the. The "diff". displays the differences between file. Options: diff. - t = ignore white spaces and tabs- i = ignore 'case' letters (A=a)Another option, - y, shows the same output, but side by side: diff. W 1. 20. The "alias". Examples: alias. - al' Alias the command 'ls - al' to lsalias os='echo $ORACLE_HOME'. Here is a list of some very useful aliases I like to define: alias l='ls - d .* - -color=tty'alias ll='ls - l - -color=tty'alias oh='cd $ORACLE_HOME'alias os='echo $ORACLE_SID'alias tns='cd. ORACLE_HOME/network/admin'alias bdump='cd. ORACLE_BASE/admin/$ORACLE_SID/bdump'The "echo". DISPLAY display the. DISPLAY variable to screen. With the "du". commands, you can display hard disk information. Use 1. 02. 4. byte blocks instead of the default 5. Displays. disk space free on each filesystem. Very useful. The "ftp". Invoke the file transfer protocol file exchange program: ftp. Once logged in and at the ftp prompt, you have many options: bin. Change transfer mode to ascii modesend myfile. Transfer 'myfile' from your local machineget fred Receive the. Transfer all files in current directory of the host to your local. Check the. directory of your local machinepwd Check. The "ln". command let you create a link to a file. You use this during the Oracle. Software installationln. K1. 0dboraln - s /etc/init. S9. 9dboraln - s /etc/init. S9. 9dbora. The "sed". It's helpful to do a global search. Place the html command < br> at the end of. Good for formatting the ouptut of unix. The "awk". command it has its own scripting language: For example, to display only the 6th field of the output from 'who am. Field 6 is the IP address of your own terminal session / PC.) you. This can be used to automatically set the DISPLAY environment variable. The "cksum". command provides a checksum of a file. It's very useful for comparing. The"split"command can split up a file into. Splits 'bug. 12. 34. The "gzip". commands allows you to compress files. The gzip. command results in a compressed copy of the original. The gunzip command reverses. The compress command results in a. Z" extension. The uncompress command. The "rsync". is a great file copier or command to SYNC directories, Here are some. Only get diffs. Do multiple times for troublesome downloads rsync - P. Locally copy with rate limit. It's like nice for I/O rsync. Mirror web site (using compression and encryption) rsync - az - e. Synchronize current directory with remote one rsync - auz - e. The "ssh". command lets you connect to a remote box. The "scp" command. Run command on $HOST as $USER (default command=shell) ssh. USER@$HOST command Run GUI command on $HOSTNAME as $USERssh. Y $USER@$HOSTNAME xeyes. Copy with permissions to $USER's home directory on $HOST scp - p - r. USER@$HOST: file dir/ Forward connections to $HOSTNAME: 8. HOST: 8. 0 ssh - g - L. HOST Forward connections from $HOST: 1. HOST File Permissions. The umask value is subtracted from the default permissions (6. Default permission. Owner Group World Permission========= ========= ========= ======================7 (u+rwx) 7 (g+rwx) 7 (o+rwx) read + write + execute. Rx) 5 (g+Rx) 5 (o+Rx) read + execute. Character eqivalents can be used in the chmod command: chmod o+rwx *. Rx *. log. is used to change the ownership of files after creation. The. "- R" flag causes the command ro recurse through any subdirectories. R oinstall. dba *. Finally the "chgrp". The following example changes the ownership on every single file in. OS Users Management. OS users: useradd - G oinstall - g dba - d /usr/users/my_user - m - s /bin/ksh my_user. The "- G" flag specifies the primary group. The "- g" flag specifies the secondary group. The "- d" flag specifies the default directory. The "- m" flag creates the default directory. The "- s" flag specifies the default shell. The "- r" flag removes the. Process Management. OS connections: whowho | head - 5who | tail - 5who | grep - i orawho | wc - l. The "head - 5" command restricts the output to the first 5 lines. The "tail - 5" command restricts the output to the last 5 lines of. The "grep - i ora" command restricts the output to lines. The "wc - l" command returns the number of lines from "who", and. Some users could be just logged on but actually doing nothing. You. can check how long they have been idle, a command especially useful if. HNAME. IDLE PID COMMENToracle. Jan 8. . 1. Jan 8 1. 5: 5. 7. Dec 2. 6. 1. 3: 4. Oct 2. 3. ? 2. The new column IDLE shows how long they have been idle in hh: mm format. Note the value “old” in that column? It means that the user has been. The PID column shows the process ID of their shell connection. The "ps". command lists current process information: psps - ef | grep - i ora. Specific processes can be killed by specifying the process id in the "kill". Let’s see what happens when we want to kill the session of the user SH. SH'. SID SERIAL# STATUS- -- -- -- -- - - -- -- -- -- - - -- -- -- -. INACTIVEalter system kill session. It’s killed; but when you check the status of the session. SID SERIAL# STATUS- -- -- -- -- - - -- -- -- -- - - -- -- -- -. KILLEDIt shows as KILLED, not completely gone. It happens because Oracle. SH gets to his session and attempts to do. ORA- 0. 00. 28: your session. After that time the session disappears from V$SESSION. A faster way to kill a session is to kill the corresponding server. Linux level. To do so, first find the PID of the server. SH'); SPID- -- -- -- -- -- -- -- -- -- -- -- -3. The SPID is the Process ID of the server process. Now kill this process: # kill - 9 3. Now if you check the view V$SESSION, it will be gone immediately. The. user will not get a message immediately; but if he attempts to perform. ERROR at line 1: ORA- 0. Process ID: 3. 09. Session ID: 1. 25 Serial number: 3. Linux HPLINUX 2. 4. ELsmp #1 SMP Wed Aug 1. EDT 2. 00. 4 i. 68. GNU/Linuxuname - a | awk '{ print $2 }'HPLINUXhostname. Users are getting a temporary profile. A bit about current setup: It is windows 2. R2 AD servers (all of them are 2. R2) and couple locations which set as Sites. Each location has DFS on AD server. Roaming profiles are not used nor configured. Users have their home folder configured as mapped S: drive to DFS shared folder. For example: in profile tab user has: Home Folder - > connect - > S: to \\domain. We also have redirected Desktop, Documents and Downloads folders to \\domain. Everything was fine. Suddenly (today), users in most locations lost their local profile (both XP and W7 desktops) and got temporary profiles. Also, it looks like local profile was created today (from folder properties). I checked events at couple machines and there is not errors related to profiles or logon process. I do not see issues in event logs at servers as well. Basically, I run out of ideas what is wrong and why machines lost their local profiles. PS: Laptop users do not have their folders redirected, but lost profiles as well.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2017
Categories |