Menghapus archive log dengan paksa Februari 24, 2009
Posted by setijoagus in Oracle Administration, oracle.Tags: archive log
add a comment
1. dimana letak archive log ?
[oracle@stby11g ~]$ sqlplus / as sysdba
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/archive/stby11g
Oldest online log sequence 0
Next log sequence to archive 0
Current log sequence 15
2. hapus
[oracle@stby11g ~]$ cd /u01/archive/stby11g
[oracle@stby11g stby11g]$ ls
1_14_679442351.arc 1_11_679442351.arc 1_9_679442351.arc
1_12_679442351.arc 1_10_679442351.arc 1_13_679442351.arc
[oracle@stby11g stby11g]$ rm *
[oracle@stby11g stby11g]$ ls
3. periksa archive log lewat rman menggunakan crosscheck copy
[oracle@prmr11g prmr11g]$ rman target /
RMAN> crosscheck copy;
Starting implicit crosscheck backup at 24-FEB-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=115 device type=DISK
Finished implicit crosscheck backup at 24-FEB-09
Starting implicit crosscheck copy at 24-FEB-09
using channel ORA_DISK_1
Finished implicit crosscheck copy at 24-FEB-09
searching for all files in the recovery area
cataloging files…
cataloging done
List of Cataloged Files
=======================
File Name: /u01/app/oracle/flash_recovery_area/stby11g/STBY11G/archivelog/2009_02_20/o1_mf_1_3_4sx7gsl5_.arc
File Name: /u01/app/oracle/flash_recovery_area/stby11g/STBY11G/archivelog/2009_02_20/o1_mf_1_4_4sxj42j8_.arc
File Name: /u01/app/oracle/flash_recovery_area/stby11g/STBY11G/archivelog/2009_02_20/o1_mf_1_2_4sx6k6kl_.arc
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=115 device type=DISK
validation failed for archived log
archived log file name=/u01/archive/stby11g/1_9_679442351.arc RECID=3 STAMP=679675797
validation failed for archived log
archived log file name=/u01/archive/stby11g/1_10_679442351.arc RECID=5 STAMP=679675812
validation failed for archived log
archived log file name=/u01/archive/stby11g/1_11_679442351.arc RECID=2 STAMP=679675797
validation failed for archived log
archived log file name=/u01/archive/stby11g/1_12_679442351.arc RECID=4 STAMP=679675806
validation failed for archived log
archived log file name=/u01/archive/stby11g/1_13_679442351.arc RECID=6 STAMP=679675821
validation failed for archived log
archived log file name=/u01/archive/stby11g/1_14_679442351.arc RECID=1 STAMP=679675771
Crosschecked 6 objects
4. hapus data archive log lewat rman menggunakan delete noprompt expired copy
RMAN> delete noprompt expired copy;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=115 device type=DISK
List of Archived Log Copies for database with db_unique_name STBY11G
=====================================================================
Key Thrd Seq S Low Time
——- —- ——- – ———
3 1 9 X 23-FEB-09
Name: /u01/archive/stby11g/1_9_679442351.arc
5 1 10 X 23-FEB-09
Name: /u01/archive/stby11g/1_10_679442351.arc
2 1 11 X 23-FEB-09
Name: /u01/archive/stby11g/1_11_679442351.arc
4 1 12 X 23-FEB-09
Name: /u01/archive/stby11g/1_12_679442351.arc
6 1 13 X 24-FEB-09
Name: /u01/archive/stby11g/1_13_679442351.arc
1 1 14 X 24-FEB-09
Name: /u01/archive/stby11g/1_14_679442351.arc
deleted archived log
archived log file name=/u01/archive/stby11g/1_9_679442351.arc RECID=3 STAMP=679675797
deleted archived log
archived log file name=/u01/archive/stby11g/1_10_679442351.arc RECID=5 STAMP=679675812
deleted archived log
archived log file name=/u01/archive/stby11g/1_11_679442351.arc RECID=2 STAMP=679675797
deleted archived log
archived log file name=/u01/archive/stby11g/1_12_679442351.arc RECID=4 STAMP=679675806
deleted archived log
archived log file name=/u01/archive/stby11g/1_13_679442351.arc RECID=6 STAMP=679675821
deleted archived log
archived log file name=/u01/archive/stby11g/1_14_679442351.arc RECID=1 STAMP=679675771
Deleted 6 EXPIRED objects
5. periksa ulang
RMAN> crosscheck copy;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=115 device type=DISK
specification does not match any archived log in the recovery catalog
RMAN> exit
jika anda jalankan perintah sql, seperti dibawah ini maka isi v$archived_log, seolah – olah masih ada
SQL> select name from v$archived_log;
NAME
——————————————————————————–
6 rows selected.
hal ini berhubungan dengan :
1) V$ARCHIVED_LOG
2) V$CONTROLFILE_RECORD_SECTION
deatil bisa diperiksa di
http://forums.oracle.com/forums/thread.jspa?threadID=621999&start=0&tstart=0
Moving Tablespaces Oracle Januari 2, 2009
Posted by setijoagus in Oracle Administration, oracle.Tags: move tablespace, oracle
add a comment
source : http://home.galileo.edu/~obonilla/writing/oracle/
Kadangkala pada saat kita membuat / install database, create tablespace-nya pakai default tablespace “USERS”, tetapi kemudian hari karena suatu hal (tablespace users berkembang tanpa kendali) maka diinginkan untuk memindahkan tablespaceke suatu tablespace baru. Atau alasan lain seperti memisahkan skema tablespace “PRODUCTION” ke “DEVELOPMENT”.
Test….test….
1. create tablespace
$ sqlplus / as sysdba
sql> CREATE TABLESPACE development DATAFILE
‘/u01/oradata/test/datafile/development01.dbf’ SIZE 50M AUTOEXTEND OFF
LOGGING
ONLINE
PERMANENT
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;
2. create user
sql> CREATE USER development IDENTIFIED BY password
DEFAULT TABLESPACE development
TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT
ACCOUNT UNLOCK;
sql> GRANT RESOURCE TO development;
sql> GRANT CONNECT TO development;
sql> ALTER USER development DEFAULT ROLE ALL;
sql> GRANT CREATE ANY VIEW TO development;
sql> GRANT UNLIMITED TABLESPACE TO development;
sql> GRANT ALTER SESSION TO development;
sql> GRANT SELECT ANY DICTIONARY TO development;
sql> EXIT;
3. export dmp
$ exp userid=production/password file=test.dmp log=test.txt
4. edit dmp pada file test.dmp
dimana setiap kata “PRODUCTION” harus diganti “DEVELOPMENT”, tetapi karena keterbatasan untuk membuka file besar, maka harus displit dulu.
$ split -b100m test.dmp
$ ls
test.dmp xad xah xal xap xat xax xbb xbf xbj xbn xbr
xaa xae xai xam xaq xau xay xbc xbg xbk xbo xbs
xab xaf xaj xan xar xav xaz xbd xbh xbl xbp
xac xag xak xao xas xaw xba xbe xbi xbm xbq
a. LINUX editor : emacs
b. Windows editor : NOTEPAD++
atau :
c. Windows Tools : A.F.9 http://www.fauland.com
tools cari dan replace, tanpa open file, tools ini yang saya sarankan
thank’s u/ rekanku (Eko Yuliantoro R) atas info nya

5. restore dmp
$ imp system/password FROMUSER=production TOUSER=development FILE=test.dmp LOG=test.txt
Automatic Startup – Shutdown database ORACLE 11g Desember 9, 2008
Posted by setijoagus in Oracle Administration, Oracle Install, oracle.Tags: oracle 11g, startup shutdown
1 comment so far
1. create script start database
[oracle@mkt ~]$ cd $ORACLE_HOME/bin
[oracle@mkt bin]$ vi startora11g
#!/bin/sh
# Start the oracle database
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1
export ORACLE_SID=mkt
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export ORACLE_TERM=xterm
$ORACLE_HOME/bin/dbstart
exit 0
[oracle@mkt bin]$ chmod u+x startora11g
2. create script stop database
[oracle@mkt ~]$ cd $ORACLE_HOME/bin
[oracle@mkt bin]$ vi stopora11g
#!/bin/sh
# Stop the oracle database
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1
export ORACLE_SID=mkt
export ORACLE_TERM=xterm
$ORACLE_HOME/bin/dbshut
exit 0
[oracle@mkt bin]$ chmod u+x stopora11g
3. create script restart, start & stop
[oracle@mkt ~]$ cd $ORACLE_HOME/bin
[oracle@mkt bin]$ vi oracle11g
#!/bin/sh
#
# chkconfig: 345 51 49
# description: startup and shutdown the Oracle 8i database
#
echo “Oracle 11g database start/stop/restart”
ORA_OWNER=oracle
ORA_BASE=/u01/app/oracle
ORA_HOME=$ORA_BASE/product/11.1.0/db_1
case “$1″ in
’start’)
# Start the database
echo -n “Starting the database for 11g: “
su – $ORA_OWNER -c $ORA_HOME/bin/startora11g
echo
;;
’stop’)
# Stop the database
echo -n “Shutting down database for 11g: “
su – $ORA_OWNER -c $ORA_HOME/bin/stopora11g
echo
;;
‘restart’)
# Restart the Oracle databases:
echo -n “Restarting database for 11g: “
$0 stop
$0 start
echo
;;
*)
echo “Usage: oracle11g [ start | stop | restart }"
exit 1
esac
exit 0
[oracle@mkt bin]$ chmod u+x oracle11g
4. Login root & edit /etc/oratab.
[oracle@mkt bin]$ su – root
Password:
[root@mkt ~]# vi /etc/oratab
mkt:/u01/app/oracle/product/11.1.0/db_1:N
menjadi
mkt:/u01/app/oracle/product/11.1.0/db_1:Y
5. copy script oracle11g to /etc/rc.d/init.d/
[root@mkt ~]# cp /u01/app/oracle/product/11.1.0/db_1/bin/oracle11g /etc/rc.d/init.d/
[root@mkt ~]# chmod 700 /etc/rc.d/init.d/oracle11g
6. test script oracle11g start, stop, restart with login as root
[root@mkt ~]# cd /etc/rc.d/init.d
[root@mkt init.d]# ./oracle11g
Oracle 11g database start/stop/restart
Usage: oracle11g [ start | stop | restart }
[root@mkt init.d]# ./oracle11g start
Oracle 11g database start/stop/restart
Starting the database for 11g: ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage: /u01/app/oracle/product/11.1.0/db_1/bin/dbstart ORACLE_HOME
Processing Database instance “mkt”: log file /u01/app/oracle/product/11.1.0/db_1/startup.log
[root@mkt init.d]# ./oracle11g stop
Oracle 11g database start/stop/restart
Shutting down database for 11g: ORACLE_HOME_LISTNER is not SET, unable to auto-stop Oracle Net Listener
Usage: /u01/app/oracle/product/11.1.0/db_1/bin/dbshut ORACLE_HOME
Processing Database instance “mkt”: log file /u01/app/oracle/product/11.1.0/db_1/shutdown.log
[root@mkt init.d]# ./oracle11g restart
Oracle 11g database start/stop/restart
Restarting database for 11g: Oracle 11g database start/stop/restart
Shutting down database for 11g: ORACLE_HOME_LISTNER is not SET, unable to auto-stop Oracle Net Listener
Usage: /u01/app/oracle/product/11.1.0/db_1/bin/dbshut ORACLE_HOME
Processing Database instance “mkt”: log file /u01/app/oracle/product/11.1.0/db_1/shutdown.log
Oracle 11g database start/stop/restart
Starting the database for 11g: ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage: /u01/app/oracle/product/11.1.0/db_1/bin/dbstart ORACLE_HOME
Processing Database instance “mkt”: log file /u01/app/oracle/product/11.1.0/db_1/startup.log
7. chkconfig pada script oracle11g
[root@mkt init.d]# /sbin/chkconfig –add oracle11g
[root@mkt init.d]# /sbin/chkconfig –list oracle11g
oracle11g 0:off 1:off 2:off 3:on 4:on 5:on 6:off
[root@mkt init.d]# /sbin/chkconfig oracle11g on
Where partitions asm disks ? Oktober 16, 2008
Posted by setijoagus in Oracle Administration, oracle.Tags: oracleasm, partitions, RAC
add a comment
Setelah lama install oracle 11g RAC, kadang – kadang kelupaan dimana ya letak partisi ASM disimpan di harddisk mana ?, di fdisk nggak kelihatan scanddisk juga nggak dapat, berikut tips untuk mengingatkan kembali letak asm disks
1. scandisks Oracleasm
[root@rac1 ~]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
2. listdisks Oracleasm
[root@rac1 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
3. querydisk Oracleasm
[root@rac1 ~]# /etc/init.d/oracleasm querydisk VOL1
Disk “VOL1″ is a valid ASM disk on device [8, 33]
[root@rac1 ~]# /etc/init.d/oracleasm querydisk VOL2
Disk “VOL2″ is a valid ASM disk on device [8, 49]
[root@rac1 ~]# /etc/init.d/oracleasm querydisk VOL3
Disk “VOL3″ is a valid ASM disk on device [8, 81]
4. list partition ?
[root@rac1 ~]# grep “8 33″ /proc/partitions
8 33 524281243 sdc1
[root@rac1 ~]# grep “8 49″ /proc/partitions
8 49 5238597 sdd1
[root@rac1 ~]# grep “8 81″ /proc/partitions
8 81 1571669 sdf1
summary :
VOL1 /dev/sdc1
VOL2 /dev/sdd1
VOL3 /dev/sdf1
oracle 11g RAC – ASM : move / rename datafile Oktober 13, 2008
Posted by setijoagus in Oracle Administration, oracle.Tags: ASM, asmcmd, DATAFILE, MOVE, oracle 11g
add a comment
###########################################
oracle 11g RAC – ASM : move / rename datafile
###########################################
1. list datafile
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 – Production on Mon Sep 29 14:08:24 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 – Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> SELECT file_name FROM dba_data_files;
FILE_NAME
——————————————————————————–
+DATA1/node/datafile/users.259.666184225
+DATA1/node/datafile/undotbs1.258.666184225
+DATA1/node/datafile/sysaux.257.666184225
+DATA1/node/datafile/system.256.666184225
+DATA1/node/datafile/example.267.666184357
+DATA1/node/datafile/undotbs2.268.666184499
+DATA1/node/datafile/soe.dbf
+DATA1/node/datafile/soeindex.dbf
8 rows selected.
2. list diskgroup
SQL> SELECT name FROM v$asm_diskgroup;
NAME
——————————
DATA1
DATA2
DATA3
DATA4
3. move / rename datafile
a. offline datafile
SQL> ALTER DATABASE DATAFILE ‘+DATA1/node/datafile/users.259.666184225′ OFFLINE;
Database altered.
b. rman copy
RMAN> COPY DATAFILE ‘+DATA1/node/datafile/users.259.666184225′ TO ‘+DATA2/users.dbf’;
Starting backup at 29-SEP-08
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=113 instance=node1 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DATA1/node/datafile/users.259.666184225
output file name=+DATA2/users.dbf tag=TAG20080929T141528 RECID=2 STAMP=666713737
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 29-SEP-08
Starting Control File and SPFILE Autobackup at 29-SEP-08
piece handle=+DATA1/node/autobackup/2008_09_29/s_666713738.322.666713747 comment=NONE
Finished Control File and SPFILE Autobackup at 29-SEP-08
RMAN> exit
Recovery Manager complete.
c. list asmcmd
[oracle@node1 ~]$ ORACLE_SID=+ASM1; export ORACLE_SID
[oracle@node1 ~]$ asmcmd
ASMCMD> exit
[oracle@node1 ~]$ asmcmd -p
ASMCMD [+] > ls -la +DATA2/
Type Redund Striped Time Sys Name
Y NODE/
N users.dbf => +DATA2/NODE/DATAFILE/USERS.256.666713737
ASMCMD [+] > exit
[oracle@node1 ~]$ exit
exit
d. Rename datafile
SQL> ALTER DATABASE RENAME FILE
‘+DATA1/node/datafile/users.259.666184225′
TO ‘+DATA2/users.dbf’;
e. rman switch datafile
SQL> host
[oracle@node1 ~]$ rman target /
RMAN> SWITCH DATAFILE ‘+DATA2/users.dbf’ TO COPY;
datafile 4 switched to datafile copy “+DATA2/users.dbf”
RMAN> exit
Recovery Manager complete.
[oracle@node1 ~]$ exit
f. recover datafile (optional)
SQL> RECOVER DATAFILE ‘+DATA2/users.dbf’;
Media recovery complete.
g. online datafile
SQL> ALTER DATABASE DATAFILE ‘+DATA2/users.dbf’ ONLINE;
Database altered.
4. new list datafile
SQL> SELECT file_name FROM dba_data_files;
FILE_NAME
——————————————————————————–
+DATA2/users.dbf
+DATA1/node/datafile/undotbs1.258.666184225
+DATA1/node/datafile/sysaux.257.666184225
+DATA1/node/datafile/system.256.666184225
+DATA1/node/datafile/example.267.666184357
+DATA1/node/datafile/undotbs2.268.666184499
+DATA1/node/datafile/soe.dbf
+DATA1/node/datafile/soeindex.dbf
8 rows selected.
Oracle 11g ASM : FTP and HTTP Access September 28, 2008
Posted by setijoagus in Oracle Administration, oracle.Tags: ASM, http ftp, oracle
add a comment
###########################################
Oracle 11g ASM : FTP and HTTP Access
###########################################
1. run script catxdbdbca
[oracle@node1 ~]$ cd $ORACLE_HOME/rdbms/admin
[oracle@node1 admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 – Production on Sun Sep 28 14:52:18 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 – Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> @catxdbdbca 7787 8080;
SQL> exit;
2. test FTP Access
[oracle@node1 admin]$ ftp node1 7787
Connected to node1.localdomain.
220- node1
Unauthorised use of this FTP server is prohibited and may be subject to civil and criminal prosecution.
220 node1 FTP Server (Oracle XML DB/Oracle Database) ready.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (node1:oracle): system
331 pass required for SYSTEM
Password:
230 SYSTEM logged in
Remote system type is Unix.
ftp> ls
227 Entering Passive Mode (172,20,141,151,13,24)
150 ASCII Data Connection
drw-r–r– 2 SYS oracle 0 AUG 03 01:49 OLAP_XDS
drw-r–r– 2 SYS oracle 0 SEP 23 04:13 home
drw-r–r– 2 SYS oracle 0 AUG 03 02:15 images
drw-r–r– 2 SYS oracle 0 AUG 03 01:49 olap_data_security
drw-r–r– 2 SYS oracle 0 AUG 03 01:35 public
drw-r–r– 2 SYS oracle 0 SEP 23 04:13 sys
-rw-r–r– 1 SYS oracle 0 SEP 28 07:52 xdbconfig.xml
226 ASCII Transfer Complete
ftp> cd sys/asm/DATA1/NODE/DATAFILE
250 CWD Command successful
ftp> ls
227 Entering Passive Mode (172,20,141,151,232,90)
150 ASCII Data Connection
-rw-r–r– 1 SYS oracle 734011392 SEP 28 07:59 SYSTEM.256.666184225
-rw-r–r– 1 SYS oracle 750788608 SEP 28 07:59 SYSAUX.257.666184225
-rw-r–r– 1 SYS oracle 346038272 SEP 28 07:59 UNDOTBS1.258.666184225
-rw-r–r– 1 SYS oracle 5251072 SEP 28 07:59 USERS.259.666184225
-rw-r–r– 1 SYS oracle 104865792 SEP 28 07:59 EXAMPLE.267.666184357
-rw-r–r– 1 SYS oracle 262152192 SEP 28 07:59 UNDOTBS2.268.666184499
-rw-r–r– 1 SYS oracle 2105344 SEP 28 07:59 SENIN_TS.338.666201891
-rw-r–r– 1 SYS oracle 2105344 SEP 28 07:59 senin_ts01.dbf
-rw-r–r– 1 SYS oracle 356524032 SEP 28 07:59 SOE.326.666460349
-rw-r–r– 1 SYS oracle 356524032 SEP 28 07:59 soe.dbf
-rw-r–r– 1 SYS oracle 713039872 SEP 28 07:59 SOEINDEX.321.666460359
-rw-r–r– 1 SYS oracle 713039872 SEP 28 07:59 soeindex.dbf
226 ASCII Transfer Complete
ftp> bye
4. jika instance not running, apakah ftp / http bisa ?
[oracle@node1 admin]$ srvctl stOP database -d node
[oracle@node1 admin]$ srvctl status database -d node
Instance node1 is not running on node node1
Instance node2 is not running on node node2
[oracle@node1 admin]$ ftp node1 7787
ftp: connect: Connection refused
ftp> bye
[oracle@node1 admin]$ ORACLE_SID=node1; export ORACLE_SID
[oracle@node1 admin]$ sqlplus / as sysdba
SQL> startup;
SQL> exit
[oracle@node1 admin]$ ftp node1 7787
Connected to node1.localdomain.
220- node1
Unauthorised use of this FTP server is prohibited and may be subject to civil and criminal prosecution.
220 node1 FTP Server (Oracle XML DB/Oracle Database) ready.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (node1:oracle): system
331 pass required for SYSTEM
Password:
230 SYSTEM logged in
Remote system type is Unix.
ftp> bye
221 QUIT Goodbye.
Oracle 11g RAC – ASM : asmcmd September 28, 2008
Posted by setijoagus in Oracle Administration, oracle.Tags: ASM, asmcmd, oracle
add a comment
###########################################
Oracle 11g RAC – ASM : asmcmd
###########################################
1. mengaktifkan asmcmd, dengan mengaktifkan ORACLE_SID yang benar.
[oracle@node1 ~]$ ORACLE_SID=node1; export ORACLE_SID
[oracle@node1 ~]$ asmcmd
ASMCMD-08103: failed to connect to ASM; ASMCMD running in non-connected mode
ASMCMD> exit
[oracle@node1 ~]$ ORACLE_SID=+ASM1; export ORACLE_SID
[oracle@node1 ~]$ asmcmd
ASMCMD>
ASMCMD> exit
[oracle@node1 ~]$ asmcmd -v
asmcmd version 11.1.0.6.0
2. perintah – perintah di asmcmd (ASM Commands)
cd : Changes the current directory to the specified directory.
cp : Enables you to copy files between ASM disk groups on a local instance and remote instances.
du : Displays the total disk space occupied by ASM files in the specified ASM directory and all of its subdirectories, recursively.
exit : Exits ASMCMD.
find : Lists the paths of all occurrences of the specified name (with wildcards) under the specified directory.
help : Displays the syntax and description of ASMCMD commands.
ls : Lists the contents of an ASM directory, the attributes of the specified file, or the names and attributes of all disk groups.
lsct : Lists information about current ASM clients.
lsdg : Lists all disk groups and their attributes.
lsdsk : Lists disks visible to ASM.
md_backup : Creates a backup of all of the mounted disk groups.
md_restore : Restores disk groups from a backup.
mkalias : Creates an alias for system-generated filenames.
mkdir : Creates ASM directories.
pwd : Displays the path of the current ASM directory.
remap : Repairs a range of physical blocks on a disk.
rm : Deletes the specified ASM files or directories.
rmalias : Deletes the specified alias, retaining the file that the alias points to.
3. perintah dasar asmcmd yang sering digunakan
[oracle@node1 ~]$ asmcmd
ASMCMD> ls
DATA1/
DATA2/
DATA3/
DATA4/
ASMCMD> cd +DATA1/NODE
ASMCMD> pwd
+DATA1/NODE
ASMCMD> ls
AUTOBACKUP/
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfilenode.ora
ASMCMD> exit
[oracle@node1 ~]$
4. menghitung kapasitas disk, dimana
Used_MB – This value does not include mirroring.
Mirror_used_MB – This value includes mirroring.
[oracle@node1 ~]$ asmcmd
ASMCMD> du +DATA1
Used_MB Mirror_used_MB
3829 3829
ASMCMD> du +DATA1/NODE/DATAFILE
Used_MB Mirror_used_MB
3135 3135
ASMCMD> du +DATA1/NODE/CONTROLFILE
Used_MB Mirror_used_MB
48 48
5. informasi asm lainnya
ASMCMD> lsct
DB_Name Status Software_Version Compatible_version Instance_Name Disk_Group
node CONNECTED 11.1.0.6.0 11.1.0.0.0 node1 DATA1
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED EXTERN N 512 4096 1048576 51199 47276 0 47276 0 DATA1/
MOUNTED EXTERN N 512 4096 1048576 51199 51106 0 51106 0 DATA2/
MOUNTED EXTERN N 512 4096 1048576 51199 51106 0 51106 0 DATA3/
MOUNTED EXTERN N 512 4096 1048576 102398 102305 0 102305 0 DATA4/
ASMCMD> lsdsk
Path
/dev/oracleasm/disks/VOL1
/dev/oracleasm/disks/VOL2
/dev/oracleasm/disks/VOL3
/dev/oracleasm/disks/VOL_1
ASMCMD> exit
6. asmcmd tidak mengenal huruf besar / kecil
[oracle@node1 ~]$ asmcmd -p
ASMCMD [+] > ls -la
State Type Rebal Name
MOUNTED EXTERN N DATA1/
MOUNTED EXTERN N DATA2/
MOUNTED EXTERN N DATA3/
MOUNTED EXTERN N DATA4/
ASMCMD [+] > ls -la /data1/node/controlfile
Type Redund Striped Time Sys Name
CONTROLFILE UNPROT FINE SEP 27 09:00:00 Y none => Current.260.666184329
CONTROLFILE UNPROT FINE SEP 27 09:00:00 Y none => Current.261.666184329
ASMCMD [+] > exit
Move Control File ASM IN Oracle 11g RAC September 26, 2008
Posted by setijoagus in Oracle Administration, oracle.Tags: ASM, control file, MOVE, oracle 11g, RMAN
add a comment
Bagaimana cara memindahkan controlfile oracle 11g pada ASM ?
1. periksa letak control_file
[oracle@node1 ~]$ ORACLE_SID=node1; export ORACLE_SID
[oracle@node1 /]$ sqlplus / as sysdba
SQL> startup;
SQL> SHOW PARAMETER CONTROL_FILES;
NAME TYPE VALUE
—————————————————————————–
control_files string
+DATA1/rac/controlfile/current
.264.649098781
SQL> exit;
2. lakukan backup dengan rman
[oracle@node1 ~]$ rman nocatalog target /
RMAN> backup current controlfile format ‘/home/oracle/control.bkp’;
Starting backup at 15-MAR-08
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 15-MAR-08
channel ORA_DISK_1: finished piece 1 at 15-MAR-08
piece handle=/home/oracle/control.bkp tag=TAG20080315T154017 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 15-MAR-08
RMAN> exit
Recovery Manager complete.
3. shutdown database dan startup dengan nomount
[oracle@node1 /]$ sqlplus / as sysdba
SQL> shutdown immediate;
SQL> startup nomount;
SQL> exit;
4. restore controlfile ke lokasi baru
[oracle@node1 ~]$ rman nocatalog target /
RMAN> restore controlfile to
‘+DATA3/rac/controlfile/current.264.649098781′ from
‘+DATA1/rac/controlfile/current.264.649098781′;
RMAN> exit
Recovery Manager complete.
5. periksa apakah file sudah ada di tempat yang baru ?
oracle@node1 ~]$ ORACLE_SID=+ASM1; export ORACLE_SID
[oracle@node1 ~]$ asmcmd -p
ASMCMD [+] > ls -la +DATA3/rac/controlfile/
Type Redund Striped Time Sys Name
CONTROLFILE UNPROT FINE MAR 15 15:00:00 Y none =>
current.258.649439353
ASMCMD [+] >
6. dari hasil no 5 ternyata nama file telah berubah dari :
current.264.649098781
menjadi :current.258.649439353
7. set dengan lokasi baru
SQL> startup nomount;
SQL> alter system set control_files=
‘+DATA3/rac/controlfile/current.258.649439353′ scope=spfile;
SQL> shutdown immediate;
SQL> startup;
8. periksa posisi controlfile sekarang
SQL> SHOW PARAMETER CONTROL_FILES;
NAME TYPE VALUE
—————————————————————————–
control_files string
+DATA3/rac/controlfile/current
.258.649439353

