Archive for November, 2008
UNIX/LINUX REFERENCE CARD -2
Saturday, November 29th, 2008
Disks and Filesystems
df …………………………. Show free disk space
mount …………………….. Make a disk accessible
fcsk ……………………... Check a disk for errors
sync ………. Synchronizes filesystem buffers and disk
quota …………... Check disk quota for current user
Backups and Remote Storage
mt …………………………..Control a tape drive
dump ……………………………..Back up a disk
restore ………………………... Restore a dump
tar ………... Read/write (compressed) tape archives
rsync ……………………….. Mirror a set of files
dar ……………………………... Archive a disk
Environment
env ………………... Display environment variables
echo ……………………………... Print variable
export ………... Write environment variables (Bash)
set …. Write environment variables with more options
unset ……………….. Unset environment variables
Scheduling Jobs
sleep ……………………. Delay for specified time
watch ………………. Run programs at set intervals
at ………………………………. Schedule a job
cron …………………………….. Clock daemon
crontab …………... Schedule repeated jobs for cron
expect ….Automates tasks using interactive programs
Printing
lpr ………………………………….. Print files
lpq …………………………... View print queue
lprm …………………………. Remove print jobs
Processes
ps …………………………….. List all processes
w …………………………... List users’ processes
uptime ……………………... View system uptime
top …………………………... Monitor processes
xload ………………………. Monitor system load
kill ……………………….. Terminate processes
nice …………... Run process with modified priority
renice …………….. Alter running process’ priority
Hosts
uname ………………….. Print system information
hostname ……………. Print the system’s hostname
ifconfig ………….Set/display network information
host ……………………………... Look up DNS
whois ………………... Look up domain registrants
ping ... Check reachability and response time of a host
traceroute ………….. View network path to a host
File Editing
vim ………………………………... Text editor
gvim ………………….Forks a GUI version of ViM
emacs ………………………………. Text editor
sed ……………………... GNU stream text editor
Spelling Operations
ispell ……………….. Check spelling interactively
look …………………………... Look up spelling
Networking
ssh ………………... Securely log into remote hosts
scp ……………... Securely copy files between hosts
sftp …………….. Securely copy files between hosts
wget ………………………. Retrieve a url to disk
curl ………………………. Retrieve a url to disk
gaim …………………………..Instant messaging
talk ………………………….. Linux/Unix Chat
write ……………….. Send messages to a terminal
mesg ………………….. Enable/prohibit talk/write
finger …………... Display information about users
who ………………………..Show who is logged in
last ………... Displays login and logout information
Email, News and Web Browsing
pine ……... Terminal-based email and news program
mutt ………………. Terminal-based email program
mail ………………………... Minimal mail client
links …………………….. Text-only web browser
firefox ………………………. GUI web browser
Text Processors and Viewers
latex ………………. Compiles LaTeX TeX DVI
pdflatex ………………..Compiles LaTeX PDF
bibtex …………………….Compiles BiBTeX files
gv ……………………..View Postscript/PDF files
xdvi ………………………... View TeX DVI files
dvips ……………….Prints/converts TeX DVI files
ps2pdf ………………. Converts Postscript PDF
Image Manipulation/Display
xv …………………………... Image viewer for X
qiv ……………. Fast gdk/imlib image viewer for X
feh ……………….. Fast imlib2 image viewer for X
display ……………... ImageMagick: display image
convert …………….. ImageMagick: convert image
identify …….. ImageMagick: display file image info
import ….ImageMagick: save screen/window as image
compare …………... ImageMagick: compare images
xfig …………………….. Tool for drawing figures
transfig ……. Converts fig portable LaTeX figure
Development
cscope ………... Interactively examine a C program
gcc ……………………Compiles C and C++ code
gdb ……………………. Debugger for C and C++
javac ………………………..Compiles Java code
jdb ………………………….. Debugger for Java
awk ……... Pattern scanning and processing language
perl …………………. Perl programming language
python ……………. Python programming language
ruby …………………Ruby programming language
matlab …………….. Technical computing language
mathematica ……. Mathematical computing language
Encryption
pgp ……………….. Public key encryption program
gpg ………….. GnuPG: an encryption tool like PGP
Terminal Emulators
xterm …………... Standard terminal emulator for X
rxvt …………. Lightweight terminal emulator for X
mrxvt …………... Multi-tab enabled version of rxvt
Tags: Linux
Posted in Linux | No Comments »
UNIX/LINUX REFERENCE CARD -1
Saturday, November 29th, 2008
Basic File and Directory Manipulation
ls ……………………….. List directory contents
cp …………………………………... Copy files
mv …………………………….Move/rename files
rm ………………………………... Remove files
shred ………………………. Destroy data in files
ln …………………………………….Link files
cd ……………………………..Change directory
pwd ………………. Print present working directory
mkdir …………………………... Make directory
rmdir …………………………. Remove directory
File Viewing
cat ………….. Concatenate files and print to stdout
more …………………………. Page through files
less …………………………. Page through files
nl …………………………. Number lines of files
od …………... Prints file in octal and other formats
File Text Manipulation
grep ……………. Search text for matching patterns
cut ………….Remove sections from each line of files
paste ………………………... Merge lines of files
tr …………………. Translate or delete characters
join ………….. Join lines of files on a common field
split ……………………….. Split file into pieces
csplit ……... Split file into sections by context lines
sort …………………………………. Sort lines
uniq ……….. Remove duplicate lines from sorted file
fmt ………………... Simple optimal text formatter
File Properties
stat …………………………..Display file status
wc ……………………... Count bytes/words/lines
du ………………………….. Estimate disk usage
file …………………... Manipulate file attributes
touch ……………………. Change file timestamps
chown ………………………... Change file owner
chgrp ………………………….Change file group
chmod ……………………. Change file protections
File and Commands Location and Help
find ……………………………….. Locate files
locate …………………….. Locate files via index
which ………………………... Locate commands
apropos ………Locate commands by keyword lookup
File Compression
gzip …………... Compress/decompress files (LZ77)
bzip2 ………….. Compress/decompress files (BWT)
[un]zip ….. (De-)Compress files (PKZIP compatible)
File Comparison and Patching
diff …………………... Compare files line by line
patch ………………. Apply changes from a diff file
comm ……………………….. Compare sorted files
cmp …………………... Compare files byte by byte
md5sum …….Compute and check MD5 message digest
Tags: Linux
Posted in Linux | No Comments »
Oracle database Backup and Recovery FAQ
Friday, November 28th, 2008
Why and when should I backup my database?
Backup and recovery is one of the most important aspects of a DBAs job. If you lose your company’s data, you could very well lose your job. Hardware and software can always be replaced, but your data may be irreplaceable!
Normally one would schedule a hierarchy of daily, weekly and monthly backups, however consult with your users before deciding on a backup schedule. Backup frequency normally depends on the following factors:
- Rate of data change/ transaction rate
- Database availability/ Can you shutdown for cold backups?
- Criticality of the data/ Value of the data to the company
- Read-only tablespace needs backing up just once right after you make it read-only
- If you are running in archivelog mode you can backup parts of a database over an extended cycle of days
- If archive logging is enabled one needs to backup archived log files timeously to prevent database freezes
- Etc.
Carefully plan backup retention periods. Ensure enough backup media (tapes) are available and that old backups are expired in-time to make media available for new backups. Off-site vaulting is also highly recommended.
Frequently test your ability to recover and document all possible scenarios. Remember, it’s the little things that will get you. Most failed recoveries are a result of organizational errors and miscommunications.
What strategies are available for backing-up an Oracle database?
The following methods are valid for backing-up an Oracle database:
- Export/Import – Exports are “logical” database backups in that they extract logical definitions and data from the database to a file. See the Import/ Export FAQ for more details.
- Cold or Off-line Backups – shut the database down and backup up ALL data, log, and control files.
- Hot or On-line Backups – If the database is available and in ARCHIVELOG mode, set the tablespaces into backup mode and backup their files. Also remember to backup the control files and archived redo log files.
- RMAN Backups – while the database is off-line or on-line, use the “rman” utility to backup the database.
It is advisable to use more than one of these methods to backup your database. For example, if you choose to do on-line database backups, also cover yourself by doing database exports. Also test ALL backup and recovery scenarios carefully. It is better to be safe than sorry.
Regardless of your strategy, also remember to backup all required software libraries, parameter files, password files, etc. If your database is in ARCHIVELOG mode, you also need to backup archived log files.
What is the difference between online and offline backups?
A hot (or on-line) backup is a backup performed while the database is open and available for use (read and write activity). Except for Oracle exports, one can only do on-line backups when the database is ARCHIVELOG mode.
A cold (or off-line) backup is a backup performed while the database is off-line and unavailable to its users. Cold backups can be taken regardless if the database is in ARCHIVELOG or NOARCHIVELOG mode.
It is easier to restore from off-line backups as no recovery (from archived logs) would be required to make the database consistent. Nevertheless, on-line backups are less disruptive and doesn’t require database downtime.
Point-in-time recovery (regardless if you do on-line or off-line backups) is only available when the database is in ARCHIVELOG mode.
What is the difference between restoring and recovering?
Restoring involves copying backup files from secondary storage (backup media) to disk. This can be done to replace damaged files or to copy/move a database to a new location.
Recovery is the process of applying redo logs to the database to roll it forward. One can roll-forward until a specific point-in-time (before the disaster occurred), or roll-forward until the last transaction recorded in the log files.
SQL> connect SYS as SYSDBA SQL> RECOVER DATABASE UNTIL TIME '2001-03-06:16:00:00' USING BACKUP CONTROLFILE;
RMAN> run {
set until time to_date('04-Aug-2004 00:00:00', 'DD-MON-YYYY HH24:MI:SS');
restore database;
recover database;
}
My database is down and I cannot restore. What now?
This is probably not the appropriate time to be sarcastic, but, recovery without backups are not supported. You know that you should have tested your recovery strategy, and that you should always backup a corrupted database before attempting to restore/recover it.
Nevertheless, Oracle Consulting can sometimes extract data from an offline database using a utility called DUL (Disk UnLoad – Life is DUL without it!). This utility reads data in the data files and unloads it into SQL*Loader or export dump files. Hopefully you’ll then be able to load the data into a working database.
Note that DUL does not care about rollback segments, corrupted blocks, etc, and can thus not guarantee that the data is not logically corrupt. It is intended as an absolute last resort and will most likely cost your company a lot of money!
DUDE (Database Unloading by Data Extraction) is another non-Oracle utility that can be used to extract data from a dead database. More info about DUDE is available at http://www.ora600.nl/.
How does one backup a database using the export utility?
Oracle exports are “logical” database backups (not physical) as they extract data and logical definitions from the database into a file. Other backup strategies normally back-up the physical data files.
One of the advantages of exports is that one can selectively re-import tables, however one cannot roll-forward from an restored export. To completely restore a database from an export file one practically needs to recreate the entire database.
Always do full system level exports (FULL=YES). Full exports include more information about the database in the export file than user level exports. For more information about the Oracle export and import utilities, see the Import/ Export FAQ.
How does one put a database into ARCHIVELOG mode?
The main reason for running in archivelog mode is that one can provide 24-hour availability and guarantee complete data recoverability. It is also necessary to enable ARCHIVELOG mode before one can start to use on-line database backups.
Issue the following commands to put a database into ARCHVELOG mode:
SQL> CONNECT sys AS SYSDBA SQL> STARTUP MOUNT EXCLUSEVE; SQL> ALTER DATABASE ARCHIVELOG; SQL> ARCHIVE LOG START; SQL> ALTER DATABASE OPEN;
Alternatively, add the above commands into your database’s startup command script, and bounce the database.
The following parameters needs to be set for databases in ARCHIVELOG mode:
log_archive_start = TRUE log_archive_dest_1 = 'LOCATION=/arch_dir_name' log_archive_dest_state_1 = ENABLE log_archive_format = %d_%t_%s.arc
NOTE 1: Remember to take a baseline database backup right after enabling archivelog mode. Without it one would not be able to recover. Also, implement an archivelog backup to prevent the archive log directory from filling-up.
NOTE 2:’ ARCHIVELOG mode was introduced with Oracle 6, and is essential for database point-in-time recovery. Archiving can be used in combination with on-line and off-line database backups.
NOTE 3: You may want to set the following INIT.ORA parameters when enabling ARCHIVELOG mode: log_archive_start=TRUE, log_archive_dest=…, and log_archive_format=…
NOTE 4: You can change the archive log destination of a database on-line with the ARCHIVE LOG START TO ‘directory’; statement. This statement is often used to switch archiving between a set of directories.
NOTE 5: When running Oracle Real Application Clusters (RAC), you need to shut down all nodes before changing the database to ARCHIVELOG mode. See the RAC FAQ for more details.
I’ve lost an archived/online REDO LOG file, can I get my DB back?
The following INIT.ORA/SPFILE parameter can be used if your current redologs are corrupted or blown away. It may also be handy if you do database recovery and one of the archived log files are missing and cannot be restored.
NOTE: Caution is advised when enabling this parameter as you might end-up losing your entire database. Please contact Oracle Support before using it.
_allow_resetlogs_corruption = true
This should allow you to open the database. However, after using this parameter your database will be inconsistent (some committed transactions may be lost or partially applied).
Steps:
- Do a “SHUTDOWN NORMAL” of the database
- Set the above parameter
- Do a “STARTUP MOUNT” and “ALTER DATABASE OPEN RESETLOGS;”
- If the database asks for recovery, use an UNTIL CANCEL type recovery and apply all available archive and on-line redo logs, then issue CANCEL and reissue the “ALTER DATABASE OPEN RESETLOGS;” command.
- Wait a couple of minutes for Oracle to sort itself out
- Do a “SHUTDOWN NORMAL”
- Remove the above parameter!
- Do a database “STARTUP” and check your ALERT.LOG file for errors.
- Extract the data and rebuild the entire database
User managed backup and recovery
This section deals with user managed, or non-RMAN backups.
How does one do off-line database backups?
Shut down the database from sqlplus or server manager. Backup all files to secondary storage (eg. tapes). Ensure that you backup all data files, all control files and all log files. When completed, restart your database.
Do the following queries to get a list of all files that needs to be backed up:
select name from sys.v_$datafile; select member from sys.v_$logfile; select name from sys.v_$controlfile;[/code]
Sometimes Oracle takes forever to shutdown with the "immediate" option. As workaround to this problem, shutdown using these commands:
alter system checkpoint; shutdown abort startup restrict shutdown immediate
Note that if you database is in ARCHIVELOG mode, one can still use archived log files to roll forward from an off-line backup. If you cannot take your database down for a cold (off-line) backup at a convenient time, switch your database into ARCHIVELOG mode and perform hot (on-line) backups.
How does one do on-line database backups?
Each tablespace that needs to be backed-up must be switched into backup mode before copying the files out to secondary storage (tapes). Look at this simple example.
ALTER TABLESPACE xyz BEGIN BACKUP; ! cp xyfFile1 /backupDir/ ALTER TABLESPACE xyz END BACKUP;
It is better to backup tablespace for tablespace than to put all tablespaces in backup mode. Backing them up separately incurs less overhead. When done, remember to backup your control files. Look at this example:
ALTER SYSTEM SWITCH LOGFILE; -- Force log switch to update control file headers ALTER DATABASE BACKUP CONTROLFILE TO '/backupDir/control.dbf';
NOTE: Do not run on-line backups during peak processing periods. Oracle will write complete database blocks instead of the normal deltas to redo log files while in backup mode. This will lead to excessive database archiving and even database freezes.
My database was terminated while in BACKUP MODE, do I need to recover?
If a database was terminated while one of its tablespaces was in BACKUP MODE (ALTER TABLESPACE xyz BEGIN BACKUP;), it will tell you that media recovery is required when you try to restart the database. The DBA is then required to recover the database and apply all archived logs to the database. However, from Oracle 7.2, one can simply take the individual datafiles out of backup mode and restart the database.
ALTER DATABASE DATAFILE '/path/filename' END BACKUP;
One can select from V$BACKUP to see which datafiles are in backup mode. This normally saves a significant amount of database down time. See script end_backup2.sql in the Scripts section of this site.
From Oracle9i onwards, the following command can be used to take all of the datafiles out of hotbackup mode:
ALTER DATABASE END BACKUP;
This command must be issued when the database is mounted, but not yet opened.
Does Oracle write to data files in begin/hot backup mode?
When a tablespace is in backup mode, Oracle will stop updating its file headers, but will continue to write to the data files.
When in backup mode, Oracle will write complete changed blocks to the redo log files. Normally only deltas (change vectors) are logged to the redo logs. This is done to enable reconstruction of a block if only half of it was backed up (split blocks). Because of this, one should notice increased log activity and archiving during on-line backups.
To solve this problem, simply switch to RMAN backups.
RMAN backup and recovery
This section deals with RMAN backups:
What is RMAN and how does one use it?
Recovery Manager (or RMAN) is an Oracle provided utility for backing-up, restoring and recovering Oracle Databases. RMAN ships with the database server and doesn't require a separate installation. The RMAN executable is located in your ORACLE_HOME/bin directory.
In fact RMAN, is just a Pro*C application that translates commands to a PL/SQL interface. The PL/SQL calls are stallically linked into the Oracle kernel, and does not require the database to be opened (mapped from the ?/rdbms/admin/recover.bsq file).
RMAN can do off-line and on-line database backups. It cannot, however, write directly to tape, but various 3rd-party tools (like Veritas, Omiback, etc) can integrate with RMAN to handle tape library management.
RMAN can be operated from Oracle Enterprise Manager, or from command line. Here are the command line arguments:
Argument Value Description ----------------------------------------------------------------------------- target quoted-string connect-string for target database catalog quoted-string connect-string for recovery catalog nocatalog none if specified, then no recovery catalog cmdfile quoted-string name of input command file log quoted-string name of output message log file trace quoted-string name of output debugging message log file append none if specified, log is opened in append mode debug optional-args activate debugging msgno none show RMAN-nnnn prefix for all messages send quoted-string send a command to the media manager pipe string building block for pipe names timeout integer number of seconds to wait for pipe input -----------------------------------------------------------------------------
Here is an example:
[oracle@localhost oracle]$ rman Recovery Manager: Release 10.1.0.2.0 - Production Copyright (c) 1995, 2004, Oracle. All rights reserved. RMAN> connect target; connected to target database: ORCL (DBID=1058957020) RMAN> backup database; ...
How does one backup and restore a database using RMAN?
The biggest advantage of RMAN is that it only backup used space in the database. RMAN doesn't put tablespaces in backup mode, saving on redo generation overhead. RMAN will re-read database blocks until it gets a consistent image of it. Look at this simple backup example.
rman target sys/*** nocatalog
run {
allocate channel t1 type disk;
backup
format '/app/oracle/backup/%d_t%t_s%s_p%p'
(database);
release channel t1;
}
Example RMAN restore:
rman target sys/*** nocatalog
run {
allocate channel t1 type disk;
# set until time 'Aug 07 2000 :51';
restore tablespace users;
recover tablespace users;
release channel t1;
}
The examples above are extremely simplistic and only useful for illustrating basic concepts. By default Oracle uses the database controlfiles to store information about backups. Normally one would rather setup a RMAN catalog database to store RMAN metadata in. Read the Oracle Backup and Recovery Guide before implementing any RMAN backups.
Note: RMAN cannot write image copies directly to tape. One needs to use a third-party media manager that integrates with RMAN to backup directly to tape. Alternatively one can backup to disk and then manually copy the backups to tape.
How does one backup and restore archived log files?
One can backup archived log files using RMAN or any operating system backup utility. Remember to delete files after backing them up to prevent the archive log directory from filling up. If the archive log directory becomes full, your database will hang! Look at this simple RMAN backup scripts:
RMAN> run {
2> allocate channel dev1 type disk;
3> backup
4> format '/app/oracle/archback/log_%t_%sp%p'
5> (archivelog all delete input);
6> release channel dev1;
7> }
The "delete input" clause will delete the archived logs as they as backed-up.
List all archivelog backups for the past 24 hours:
RMAN> LIST BACKUP OF ARCHIVELOG FROM TIME 'sysdate-1';
Here is a restore example:
RMAN> run {
2> allocate channel dev1 type disk;
3> restore (archivelog low logseq 78311 high logseq 78340 thread 1 all);
4> release channel dev1;
5> }
How does one create a RMAN recovery catalog?
Start by creating a database schema (usually called rman). Assign an appropriate tablespace to it and grant it the recovery_catalog_owner role. Look at this example:
sqlplus sys SQL> create user rman identified by rman; SQL> alter user rman default tablespace tools temporary tablespace temp; SQL> alter user rman quota unlimited on tools; SQL> grant connect, resource, recovery_catalog_owner to rman; SQL> exit;
Next, log in to rman and create the catalog schema. Prior to Oracle 8i this was done by running the catrman.sql script.
rman catalog rman/rman RMAN> create catalog tablespace tools; RMAN> exit;
You can now continue by registering your databases in the catalog. Look at this example:
rman catalog rman/rman target backdba/backdba RMAN> register database;
One can also use the "upgrade catalog;" command to upgrade to a new RMAN release, or the "drop catalog;" command to remove an RMAN catalog. These commands need to be entered twice to confirm the operation.
How does one integrate RMAN with third-party Media Managers?
The following Media Management Software Vendors have integrated their media management software with RMAN (Oracle Recovery Manager):
- Veritas NetBackup - http://www.veritas.com/
- EMC Data Manager (EDM) - http://www.emc.com/
- HP OMNIBack/ DataProtector - http://www.hp.com/
- IBM's Tivoli Storage Manager (formerly ADSM) - http://www.tivoli.com/storage/
- EMC Networker - http://www.emc.com/
- BrightStor ARCserve Backup - http://www.ca.com/us/data-loss-prevention.aspx
- Sterling Software's SAMS:Alexandria (formerly from Spectralogic) - http://www.sterling.com/sams/
- SUN's Solstice Backup - http://www.sun.com/software/whitepapers/backup-n-storage/
- CommVault Galaxy - http://www.commvault.com/
- etc...
The above Media Management Vendors will provide first line technical support (and installation guides) for their respective products.
A complete list of supported Media Management Vendors can be found at: http://www.oracle.com/technology/deploy/availability/htdocs/bsp.htm
When allocating channels one can specify Media Management spesific parameters. Here are some examples:
Netbackup on Solaris:
allocate channel t1 type 'SBT_TAPE' PARMS='SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so.1';
Netbackup on Windows:
allocate channel t1 type 'SBT_TAPE' send "NB_ORA_CLIENT=client_machine_name";
Omniback/ DataProtector on HP-UX:
allocate channel t1 type 'SBT_TAPE' PARMS='SBT_LIBRARY= /opt/omni/lib/libob2oracle8_64bit.sl';
or:
allocate channel 'dev_1' type 'sbt_tape' parms 'ENV=OB2BARTYPE=Oracle8,OB2APPNAME=orcl,OB2BARLIST=machinename_orcl_archlogs)';
How does one clone/duplicate a database with RMAN?
The first step to clone or duplicate a database with RMAN is to create a new INIT.ORA and password file (use the orapwd utility) on the machine you need to clone the database to. Review all parameters and make the required changed. For example, set the DB_NAME parameter to the new database's name.
Secondly, you need to change your environment variables, and do a STARTUP NOMOUNT from sqlplus. This database is referred to as the AUXILIARY in the script below.
Lastly, write a RMAN script like this to do the cloning, and call it with "rman cmdfile dupdb.rcv":
connect target sys/secure@origdb
connect catalog rman/rman@catdb
connect auxiliary /
run {
set newname for datafile 1 to '/ORADATA/u01/system01.dbf';
set newname for datafile 2 to '/ORADATA/u02/undotbs01.dbf';
set newname for datafile 3 to '/ORADATA/u03/users01.dbf';
set newname for datafile 4 to '/ORADATA/u03/indx01.dbf';
set newname for datafile 5 to '/ORADATA/u02/example01.dbf';
allocate auxiliary channel dupdb1 type disk;
set until sequence 2 thread 1;
duplicate target database to dupdb
logfile
GROUP 1 ('/ORADATA/u02/redo01.log') SIZE 200k REUSE,
GROUP 2 ('/ORADATA/u03/redo02.log') SIZE 200k REUSE;
}
The above script will connect to the "target" (database that will be cloned), the recovery catalog (to get backup info), and the auxiliary database (new duplicate DB). Previous backups will be restored and the database recovered to the "set until time" specified in the script.
Notes: the "set newname" commands are only required if your datafile names will different from the target database.
The newly cloned DB will have its own unique DBID.
Can one restore RMAN backups without a CONTROLFILE and RECOVERY CATALOG?
Details of RMAN backups are stored in the database control files and optionally a Recovery Catalog. If both these are gone, RMAN cannot restore the database. In such a situation one must extract a control file (or other files) from the backup pieces written out when the last backup was taken. Let's look at an example:
Let's take a backup (partial in our case for ilustrative purposes):
$ rman target / nocatalog Recovery Manager: Release 10.1.0.2.0 - 64bit Production Copyright (c) 1995, 2004, Oracle. All rights reserved. connected to target database: ORCL (DBID=1046662649) using target database controlfile instead of recovery catalog RMAN> backup datafile 1; Starting backup at 20-AUG-04 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=146 devtype=DISK channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00001 name=/oradata/orcl/system01.dbf channel ORA_DISK_1: starting piece 1 at 20-AUG-04 channel ORA_DISK_1: finished piece 1 at 20-AUG-04 piece handle= /flash_recovery_area/ORCL/backupset/2004_08_20/o1_mf_nnndf_TAG20040820T153256_0lczd9tf_.bkp comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45 channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset including current controlfile in backupset including current SPFILE in backupset channel ORA_DISK_1: starting piece 1 at 20-AUG-04 channel ORA_DISK_1: finished piece 1 at 20-AUG-04 piece handle= /flash_recovery_area/ORCL/backupset/2004_08_20/o1_mf_ncsnf_TAG20040820T153256_0lczfrx8_.bkp comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04 Finished backup at 20-AUG-04[/code]
Now, let's destroy one of the control files:
SQL> show parameters CONTROL_FILES
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string /oradata/orcl/control01.ctl,
/oradata/orcl/control02.ctl,
/oradata/orcl/control03.ctl
SQL> shutdown abort;
ORACLE instance shut down.
SQL> ! mv /oradata/orcl/control01.ctl /tmp/control01.ctl</pre>
Now, let's see if we can restore it. First we need to start the databaase in NOMOUNT mode:
SQL> startup NOMOUNT ORACLE instance started. Total System Global Area 289406976 bytes Fixed Size 1301536 bytes Variable Size 262677472 bytes Database Buffers 25165824 bytes Redo Buffers 262144 bytes</pre>
Now, from SQL*Plus, run the following PL/SQL block to restore the file:
DECLARE
v_devtype VARCHAR2(100);
v_done BOOLEAN;
v_maxPieces NUMBER;
TYPE t_pieceName IS TABLE OF varchar2(255) INDEX BY binary_integer;
v_pieceName t_pieceName;
BEGIN
-- Define the backup pieces... (names from the RMAN Log file)
v_pieceName(1) :=
'/flash_recovery_area/ORCL/backupset/2004_08_20/o1_mf_ncsnf_TAG20040820T153256_0lczfrx8_.bkp';
v_pieceName(2) :=
'/flash_recovery_area/ORCL/backupset/2004_08_20/o1_mf_nnndf_TAG20040820T153256_0lczd9tf_.bkp';
v_maxPieces := 2;
-- Allocate a channel... (Use type=>null for DISK, type=>'sbt_tape' for TAPE)
v_devtype := DBMS_BACKUP_RESTORE.deviceAllocate(type=>NULL, ident=>'d1');
-- Restore the first Control File...
DBMS_BACKUP_RESTORE.restoreSetDataFile;
-- CFNAME mist be the exact path and filename of a controlfile taht was backed-up
DBMS_BACKUP_RESTORE.restoreControlFileTo(cfname=>'/app/oracle/oradata/orcl/control01.ctl');
dbms_output.put_line('Start restoring '||v_maxPieces||' pieces.');
FOR i IN 1..v_maxPieces LOOP
dbms_output.put_line('Restoring from piece '||v_pieceName(i));
DBMS_BACKUP_RESTORE.restoreBackupPiece(handle=>v_pieceName(i), done=>v_done, params=>null);
exit when v_done;
END LOOP;
-- Deallocate the channel...
DBMS_BACKUP_RESTORE.deviceDeAllocate('d1');
EXCEPTION
WHEN OTHERS THEN
DBMS_BACKUP_RESTORE.deviceDeAllocate;
RAISE;
END;
/
Let's see if the controlfile was restored:
SQL> ! ls -l /oradata/orcl/control01.ctl -rw-r----- 1 oracle dba 3096576 Aug 20 16:45 /oradata/orcl/control01.ctl[/code]
We should now be able to MOUNT the database and continue recovery...
SQL> ! cp /oradata/orcl/control01.ctl /oradata/orcl/control02.ctl
SQL> ! cp /oradata/orcl/control01.ctl /oradata/orcl/control03.ctl
SQL> alter database mount;
SQL> recover database using backup controlfile;
ORA-00279: change 7917452 generated at 08/20/2004 16:40:59 needed for thread 1
ORA-00289: suggestion :
/flash_recovery_area/ORCL/archivelog/2004_08_20/o1_mf_1_671_%u_.arc
ORA-00280: change 7917452 for thread 1 is in sequence #671
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/oradata/orcl/redo02.log
Log applied.
Media recovery complete.
Database altered.
SQL> alter database open resetlogs;
Database altered.
See Metalink Note 60545.1 for detailed examples.
Tags: oracle backup
Posted in ORACLE-eng | 2 Comments »
Oracle Licensing
Friday, November 28th, 2008
Oracle database software can be very expensive or very cheap (even free), depending on what you buy/use:
* Oracle Enterprise Edition is very expensive – and it should be: It is the most powerful database management system on the planet! [Note: The neutrality of this statement is disputed!]
* Oracle Standard Edition costs about the same as Microsoft SQL Server. It can only be licensed on servers, or server clusters, that have a maximum capacity of 4 processor sockets.
* Oracle Standard Editon One is less expensive than SQL Server. It may only be licensed on servers that have a maximum capacity of 2 processor sockets.
* Oracle PE is very inexpensive, full-featured version of Oracle DB, but is restricted to one user per database (server, not instance, most likely). The license however allows a developer to use all of the features of the EE (with the exception of the Options and Management Packs).
* Oracle XE is provided free of charge.
* Oracle Enterprise Manager (OEM) Database Control and Grid control is provided free of charge, however, the management packs needs to be licensed for the number of users or CPU’s that you “monitor” with it.
* Oracle Application Server (iAS) Standard Edition One may only be licensed on servers that have a maximum capacity of 2 processor cores.
A great comparison document showing what is included and what isn’t for all of the editions of the Database is available at Oracle.com. See page 10 for the beginning of the comparison table.
More information on oracle licensing at:
http://www.orafaq.com/wiki/Oracle_Licensing
Posted in ORACLE-eng | No Comments »
DB block size VS File system block size
Friday, November 28th, 2008
As I read through I came up with the conclusion that
DB block size = File system block size
and the db block size should be 8K on windows.
How do you find what file system block size you system is using on windows.
On dos prompt enter
1. chkdsk partition (ie. c:, d:)
the result may be something similar to this
20482874 KB total disk space.
8898184 KB in 12301 files.
5652 KB in 461 indexes.
0 KB in bad sectors.
116126 KB in use by the system.
65536 KB occupied by the log file.
11462912 KB available on disk.
4096 bytes in each allocation unit.
5120718 total allocation units on disk.
2865728 allocation units available on disk.
the 4096 bytes in each allocation unit, third last row is the one telling what file system block size is.
or you could use
2. fsutil fsinfo ntfsinfo partition (ie. c:, d:)
the result may be something similar to
NTFS Volume Serial Number : 0×8aec1303ec12e8e9
Version : 3.1
Number Sectors : 0×0000000002afd736
Total Clusters : 0×000000000055fae6
Free Clusters : 0×000000000013f71b
Total Reserved : 0×0000000000000040
Bytes Per Sector : 512
Bytes Per Cluster : 4096
Bytes Per FileRecord Segment : 1024
Clusters Per FileRecord Segment : 0
Mft Valid Data Length : 0×00000000102cc000
Mft Start Lcn : 0×00000000000c0000
Mft2 Start Lcn : 0×00000000002afd73
Mft Zone Start : 0×0000000000253980
Mft Zone End : 0×0000000000253a00
Bytes Per Cluster is the one telling what file system block size your system is using.
To find out what db_block_size your oracle uses use the following command.
log in as sysdba and enter
show parameter db_block_size.
Resource:
buffered_block_size.htm- http://asktom.oracle.com
- db_block_size.html
- block-size-does-matter-just-not-in-the-way-you-think
- multiple_blocksizes_summary.htm
Posted in ORACLE-eng | 1 Comment »
Mount CD Rom/DVD Rom for installing Oracle Database
Friday, November 28th, 2008
Most of the linux distros these days automount their CDs with the noexec switch set. In other word no-one apart from root is allowed to execute programs from the mounted media.To work around this login as root and unmount cdrom using this command
umount /dev/cdrom
then remount it with this command
mount -o loop /dev/cdrom /media/cdrom
Posted in ORACLE-eng | No Comments »
Oracle Import Utility
Friday, November 28th, 2008
Import extracts data from an export file and puts it back into an Oracle database. Import is command line not SQL command.Table objects are imported from the export file in the following order:1. Table definitions
2. Table data
3. Table indexes
4. Integrity constraints and triggers
Here are the list of import process order
1. New tables are created
2. Data is imported.
3. Indexes are built.
4. Triggers are imported,
5. Integrity constraints are enabled.
Note: Tablespace need to be create from the first place(if not exist), otherwise the object on the specific tablespace would not be able to be created.
To list exp parameter enter “exp HELP=y” .
More Information on Oracle Export at
- http://www.orafaq.com/wiki/Import
- http://www.orafaq.com/wiki/Import_Export_FAQ
Tags: Oracle
Posted in ORACLE-eng | 1 Comment »
oracle error code
Friday, November 28th, 2008
| ORA-06431 | : | Ssaio: Invalid Block number |
| Cause | : | The file block number is out of range of the file. The additional information returns the block number. |
| Action | : | Verify that the block number is correct. Run dbfsize and check if the block number is in that range. Contact your Oracle Customer Support Representative. |
| ORA-00997 | : | TNS:no listener |
| Cause | : | A value of datatype LONG was used in a function or in a DISTINCT, WHERE, CONNECT BY, GROUP BY, or ORDER BY clause. A LONG value can only be used in a SELECT clause. |
| Action | : | Remove the LONG value from the function or clause |
| More Information | ||
| LONG datatypes cannot be used for Insert with selects or CTAS (create table as select)The ORA-00997 error is due to a know restriction where you cannot do an insert with select or Create table as select involving tables with LONG datatypes. We can however do the data transfer using the COPY command. Here’s an example:
– You can set long to any large value as long as it is larger than the max length of any — long column in the table. Exception is that sqlplus commands cannot handle a long – copy is a SQL*Plus command and needs the continuation character “-” for multiple lines. SQL> copy from REMOTE_USER/REMOTE_USER_PASSWORD@remotedb - Related Link: |
||
Tags: oracle error code
Posted in ORACLE-eng | No Comments »
Antivirüsler hakkında kısa bilgi
Tuesday, November 25th, 2008
Antivirüs bilgisayarınızın zararlı programlardan korumak için hazırlanan güvenlik yazılımlarına denir. Bazı virüslerin verdiği zararlar geri dönüşümü mümkün olmayan hatalara neden olabilir, bu yüzden her bilgisayarda güncel ve lisanslı bir antivirüs programı bulunması gerekmektedir. Yani bilgisayarınzda sadece antivirüsün olması sizi her zaman korumaz.
Antivirüs programları tek başlarına tam bir güvence sağlayamazlar bunun yanında, antispyware, firewall gibi güvenlik yazılımlarıda kurulmuş ve güncel tutuluyor olması gerekmektedir.
En çok kullanılan antivirüs programları şunlardır.
Trend Micro Antivirüs, McAfee Antivirüs, AntiVir Antivirüs, Norton Antivirüs, AVG Antivirüs, Panda Antivirüs, F-Secure Antivirüs, ClamAV Antivirüs, Avast Antivirüs, BullGuard Antivirüs, Eset Antivirüs, eturst ez Antivirüs, Sophos Antivirüs, Norman Antivirüs, NOD32 Antivirüs, BitDefender Antivirüs, Kaspersky Antivirüs
Online virüs temizleme yapabileceüiniz siteler:
Kaspersky http://www.kaspersky.com/virusscanner
Trend Micro: http://housecall.trendmicro.com/
Symantec: http://security.symantec.com
Panda Software: http://www.pandasoftware.com/products/ActiveScan.htm
Bitdefender: http://www.bitdefender.com/scan8/ie.html
eTurst: http://www3.ca.com/securityadvisor/virusinfo/scan.aspx
McAffee: http://us.mcafee.com/root/mfs/default.asp
Nod32 :http://www.nod32.com.tr/onlinescan/index.asp
Panda :http://www.pandasecurity.com/activescan/index/?track=1&Lang=en-US&IdPais=63
Eğer antivirüs için kişisel olarak ayırabileceğiniz bütçeniz yoksa; bir çok antivirüs programının en az 30 günlük deneme sürümlerini indirerek bedava kullanabilirsiniz. Aşağıda bazı antivirüs programlarının deneme sürümlerini indirebileceğiniz sitelerin adresleri mevcut.
Kaspersky : http://www.kaspersky.com/trials
Trend Micro: http://emea.trendmicro.com/emea/downloads/sb/index.html?id=homepage_tab
Symantec: http://www.symantec.com/norton/downloads/index.jsp
Panda : http://www.pandasecurity.com/homeusers/downloads/evaluation/?sitepanda=particulares
Avast: http://www.avast.com/eng/download-avast-home.html
Posted in Security | No Comments »
Active Directory Database Mounting Tool Step-by-Step Guide
Friday, November 21st, 2008
Active Directory snapshot alma ve geri dönme ile ilgili en iyi dökümanlardan birisi olan Microsoft’un kendi dökümanına aşağıda ulaşabilirsiniz.
This guide shows how you can use an improved version of Ntdsutil and a new Active Directory® database mounting tool in Windows Server® 2008 to create and view snapshots of data that is stored in Active Directory Domain Services (AD DS) or Active Directory Lightweight Directory Services (AD LDS), without restarting the domain controller or AD LDS server. A snapshot is a shadow copy—created by the Volume Shadow Copy Service (VSS)—of the volumes that contain the Active Directory database and log files.
|
|
|
During product development, this feature has also been known by previous codes names, including Snapshot Viewer and Active Directory data mining tool. |
The Active Directory database mounting tool (Dsamain.exe) can improve recovery processes for your organizations by providing a means to compare data as it exists in snapshots that are taken at different times so that you can better decide which data to restore after data loss. This eliminates the need to restore multiple backups to compare the Active Directory data that they contain.
This guide provides step-by-step instructions for using the Active Directory database mounting tool, including creating, listing, and mounting snapshots of AD DS; preparing them for viewing as a Lightweight Directory Access Protocol (LDAP) server; and viewing the data itself.
For more information about VSS snapshots, see Shadow Copies and Shadow Copy Sets (VSS) (http://go.microsoft.com/fwlink/?LinkId=90631).
Who should use this guide?
The following individuals should review this information about the Active Directory database mounting tool:
- Information technology (IT) planners and analysts who are technically evaluating the product
- Enterprise IT planners and designers for organizations
- Administrators, operators, and managers who are responsible for IT operations, including recovery of deleted Active Directory data
Scenarios for using the Active Directory database mounting tool
This section describes common scenarios in which you can use the Active Directory database mounting tool.
Simplifying the forest recovery process
For organizations that have domain controllers running Windows Server® 2003, the forest recovery process requires a determination of which backup is best to use for recovery. In general, you must consider whether to restore a recent backup of your data or an older backup that you believe may be safer. Choosing a more recent backup recovers more useful data, but it might increase the risk of reintroducing dangerous data into the restored forest.
To determine which backup is best, you must restore it to a domain controller to view its contents. Each restore operation requires that you restart the domain controller in Directory Services Restore Mode.
For some organizations, the loss of productivity caused by the time required for such restore operations is great. These organizations often must keep detailed logs about the Active Directory health state on a daily basis so that, in case of a failure throughout the forest, the approximate time of failure can be identified.
In a forest recovery scenario, the ability to precisely determine which backup contains the best data to recover can drastically reduce downtime.
Auditing modified and deleted objects
Dsamain.exe helps you examine any changes that are made to Active Directory data. For example, if an object is accidentally modified, you can use this tool to examine the changes and to help you better decide how to correct them if necessary.
By scheduling a task to regularly create snapshots of the AD DS database, you can keep detailed records of AD DS data as it changes over time. You can create AD DS snapshots without devoting as much time and storage space as Windows Server Backup requires for critical-volume backups.
Requirements for using the Active Directory database mounting tool
You do not need any additional software to use the Active Directory database mounting tool. All the tools that are required to use this feature are built into Windows Server 2008 and are available if you have the AD DS or the AD LDS server role installed. These tools include the following:
- A new Ntdsutil snapshot operation that you can use to create, list, mount, and unmount snapshots of AD DS or AD LDS data
|
|
|
You are not required to run the ntdsutil snapshot operation to use Dsamain.exe. You can instead use a backup of the AD DS or AD LDS database or another domain controller or AD LDS server. The ntdsutil snapshot operation simply provides a convenient data input for Dsamain.exe. |
- Dsamain.exe, which you can use to expose the snapshot data as an LDAP server
- Existing LDAP tools, such as Ldp.exe and Active Directory Users and Computers
By default, only members of the Domain Admins group and the Enterprise Admins group are allowed to view the snapshots because they contain sensitive AD DS data. If you want to access snapshot data from an old domain or forest that has been deleted, you can allow nonadministrators to access the data when you run Dsamain.exe.
All permissions that apply to the data in the snapshot are enforced when you view the data. For example, suppose that members of the Domain Admins groups are explicitly denied Read permission for an object in AD DS. If you supply credentials for a member of that group when you try to view the snapshot data for that object, access is denied.
Moreover, you cannot change the existing permission to grant Read access in the snapshot that you are viewing because the Active Directory data is read-only. Any add, modify, or delete operations will fail.
However, a malicious user might be able to copy sensitive data that might be stored in AD DS snapshots to another forest and then use privileged credentials from that forest to examine the data. Therefore, you should protect them in a manner that is similar to how you protect domain controller backups. Use encryption or other data security precautions with AD DS snapshots to help mitigate the chance of unauthorized access to them.
Steps for using the Active Directory database mounting tool
You are not required to use the Ntdsutil snapshot operation to create the snapshots. You can use any backup of an AD DS or AD LDS database that uses VSS, including non-Microsoft backup solutions. The database must be in a consistent state; that is, the logs must be replayed. If you use Ntdsutil.exe or Windows Server Backup on a server running Windows Server 2008, the resulting snapshot or backup will be consistent.
|
|
|
A domain controller backup contains more data than an AD DS snapshot because it also includes files that are needed to restore the operating system. |
You can use either Ntdsutil.exe to mount the snapshot or use Windows Server Backup to restore the backup to an alternative location or to another computer. Then, you can use a tool such as Ldp.exe to view the data.
You can use the following process to use the Active Directory database mounting tool:
1. Although it is not a requirement, you can schedule a task that regularly runs Ntdsutil.exe to take snapshots of the volume that contains the AD DS or AD LDS database.
2. Run Ntdsutil.exe to list the snapshots that are available and then mount the snapshot that you want to view.
3.
· AD DS or AD LDS database (Ntds.dit) full file path. By default this file is opened as read-only. Only ASCII paths are supported. Network share paths are not supported.
· Log path. This can be a temporary path, but you must have write access. This parameter is optional. If you do not specify the log path, logs and a temporary database are created in the Temp folder.
· Four port numbers for LDAP, LDAP-SSL, Global Catalog, and Global Catalog–SSL. Only the LDAP port is required. If the other ports are not specified, they will use LDAP+1, LDAP+2, and LDAP+3, respectively. For example, if you specify LDAP port 41389 without specifying other port values, the LDAP-SSL port will use port 41390 by default, and so on.
You can stop Dsamain by pressing CTRL+C in the Command Prompt window or, if you are running the command remotely, by setting the stopservice attribute on the rootDSE object.
4.
5. Browse the snapshot just as you would with any live domain controller.
If you specify different ports for each snapshot when you run Dsamain.exe, you can browse multiple snapshot instances on the same domain controller (or on the same workstation if you are browsing a restored backup) at the same time and easily compare their data.
If you have some idea which organizational unit (OU) or objects were deleted, you can look up the deleted objects in the snapshots and record the attributes and back-links that belonged to the deleted objects. You can reanimate these objects by using the tombstone reanimation feature on a domain controller in your production environment. Then, you must manually repopulate these objects with the stripped attributes and back-links as identified in the snapshots. For more information about tombstone reanimation, see Reanimating Active Directory Tombstone Objects (http://go.microsoft.com/fwlink/?LinkID=116204).
Although you must manually re-create the stripped attributes and back links, the Active Directory database mounting tool makes it possible for you to re-create deleted objects and their back-links without rebooting the domain controller into Directory Services Restore Mode. You can also use the tool to look up previous configurations of AD DS as well, including permissions that were in effect.
Step 1: Create, mount, and list snapshots
Administrative credentials
To create a snapshot, you must be a member of the Enterprise Admins groups or the Domain Admins group or you must have been delegated the appropriate permissions.
To create an AD DS or AD LDS snapshot
1. Log on to a domain controller as a member of the Enterprise Admins groups or the Domain Admins group.
2. Click Start, right-click Command Prompt, and then click Run as administrator.
3. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.
4. At the elevated command prompt, type the following command, and then press ENTER:
ntdsutil
5. At the ntdsutil prompt, type the following command, and then press ENTER:
snapshot
6. At the snapshot prompt, type the following command, and then press ENTER:
activate instance ntds
7. At the snapshot prompt, type the following command, and then press ENTER:
create
The command returns the following output:
Snapshot set {GUID} generated successfully.
Where GUID is the globally unique identifier (GUID) for the snapshot.
8. At the snapshot prompt, type the following command, and then press ENTER:
mount {GUID}
9. As an option, to see a list of all mounted snapshots, you can type the following command, and then press ENTER:
list mounted
The output lists each mounted snapshot and a corresponding index number. You can use the index number instead of the GUID to subsequently mount, unmount, or delete the snapshot.
10. To unmount the snapshot after you have finished viewing the data, type either of the following commands, and then press ENTER:
unmount index #
-or-
unmount {GUID}
11. Delete old snapshots that you are no longer using because they consume disk space. To delete a snapshot, type either of the following commands, and then press ENTER:
delete index #
-or-
delete {GUID}
12. After you are done with snapshot operations, type quit to return to the ntdsutil menu, and then type quit again to return to the command prompt.
After you create and mount a snapshot, you can run Dsamain.exe to expose the AD DS or AD LDS data in the snapshot as an LDAP server.
Step 2 (Optional): Schedule a task that creates AD DS snapshots
You have the option to schedule a task that runs Ntdsutil.exe regularly to create snapshots.
Administrative credentials
To schedule a task to create AD DS or AD LDS snapshots, you must be a member of the Enterprise Admins group or the Domain Admins group.
To schedule a task to create AD DS or AD LDS snapshots
1. Log on to a domain controller as a member of the Enterprise Admins group or the Domain Admins group.
2. Click Start, click Administrative Tools, and then click Task Scheduler.
3. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.
4. Click Action, and then click Create task.
5. On the General tab, type a name for your task, and then select the appropriate security options to run the task.
6. On the Triggers tab, click New.
7. In New Trigger, select the appropriate settings for the task, and then click OK.
8. On the Action tab, click New.
9. In New Action, type the name or browse to the file path that contains Ntdsutil.exe and in Add arguments (optional), type the following command, and then press ENTER:
ntdsutil “activate instance ntds” snapshot create quit quit
10. On the Conditions tab and the Settings tab, select any additional settings that you want to apply to the task, and then click OK.
11. If you are prompted, enter the password for a member of the Enterprise Admins group or the Domain Admins group, and then click OK.
Step 3: Expose an AD DS or AD LDS snapshot as an LDAP server
Administrative credentials
By default, you must be a member of the Enterprise Admins groups or the Domain Admins group to run Dsamain.exe and to access the Active Directory data that it exposes. If the snapshot is taken from a domain that no longer exits, you can specify the /allowNonAdminAccess parameter.
To expose an AD DS or AD LDS snapshot as an LDAP server
1. Log on to a domain controller as a member Enterprise Admins groups or the Domain Admins group.
2. Click Start, right-click Command Prompt, and then click Run as administrator.
3. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.
4. At the elevated command prompt, type the following command, and then press ENTER. Be sure to include a space between the name of the parameter and the value that you specify.
dsamain /dbpath <path_to_database_file> /ldapport <port_#>
If you plan to view the snapshot data on a domain controller, specify ports that are different from the ports that the domain controller will use. For example, type:
dsamain /dbpath E:\$SNAP_200704181137_VOLUMED$\WINDOWS\NTDS\ntds.dit /ldapport 51389
A message indicates that Active Directory Domain Services startup is complete.
Allow Dsamain.exe to continue running in the command prompt window while you use an LDAP tool such as Ldp.exe or Active Directory Users and Computers to view the AD DS or AD LDS data in the snapshot.
Step 4: Access Active Directory data that is stored in snapshots
Administrative credentials
To use Ldp.exe or Active Directory Users and Computers to access the AD DS or AD LDS data, you must be a member of the Enterprise Admins groups or the Domain Admins group or you must have been delegated permission.
To use Ldp.exe to access AD DS or AD LDS data that is stored in snapshots
1. Click Start, click Run, type ldp, and then click OK.
2. Click Connection, and then click Connect.
3. In Server, type the name of the server, or type localhost and, in Port, type a port number that you specified previously with dsamain. For example, type 51389. Click OK.
4. Click Connection, and then click Bind.
5. In Bind type, click Bind as currently logged on user or click Bind with credentials and type a name, password, and domain for a user account that has permission to access the Active Directory data. Click OK.
6. Click View, and then click Tree.
7. In BaseDN, type the distinguished name of the parent container for the data that you want to view, and then click OK. For example, to view all objects in the Contoso domain, type:
dc=contoso,dc=com
8. Double-click the appropriate containers for the object that you want to view, and then double-click that object to view its properties.
To use Active Directory Users and Computers to access Active Directory data that is stored in snapshots
1. Click Start, click Administrative Tools, and then click Active Directory Users and Computers.
2. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.
3. In the console tree, right-click Active Directory Users and Computers [FQDN], and then click Change Domain Controller.
4. Click <Type a Domain Controller name or an IP Address here>, type the following, and then press ENTER:
hostname:port
where hostname is the name of the server where the snapshots are stored and port is the LDAP port number that you specified previously with dsamain. For example, type the following, and then click OK:
DC1:51389
5. Double-click the appropriate containers for the object that you want to view, and then double-click that object to view its properties
Tags: Active Directory, Windows
Posted in Kategorilenmemiş | 1 Comment »