1.透過ASMCMD 存取 ASM disk group
可以透過Oracle asmcmd 此command 去存取ASlM diskgroup,並可刪除檔案
#su – oracle
$export ORACLE_SID=+ASM1
$export ORACLE_HOME=/oracle/asm
$asmcmd
|
ASMCMD> help
asmcmd [-p] [command]
The environment variables ORACLE_HOME and ORACLE_SID determine the
instance to which the program connects, and ASMCMD establishes a
bequeath connection to it, in the same manner as a SQLPLUS / AS
SYSDBA. The user must be a member of the SYSDBA group.
Specifying the -p option allows the current directory to be displayed
in the command prompt, like so:
ASMCMD [+DATAFILE/ORCL/CONTROLFILE] >
[command] specifies one of the following commands, along with its
parameters.
Type "help [command]" to get help on a specific ASMCMD command.
commands:
--------
cd
du
find
help
ls
lsct
lsdg
mkalias
mkdir
pwd
rm
rmalias
|
ASMCMD> lsct
|
DB_Name Status Software_Version Compatible_version Instance_Name
db CONNECTED 10.2.0.4.0 10.2.0.3.0 db1
|
ASMCMD> lsdg
|
State Type Rebal Unbal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED EXTERN N N 512 4096 1048576 307185 301947 0 301947 0 DATA/
|
ASMCMD> mkalias
usage: mkalias <filename> <alias>
|
檢查diskgroup 已佔用空間
ASMCMD> du
|
Used_MB Mirror_used_MB
5142 5142
|
檢視filesystem
|
ASMCMD> ls
DATA/
ASMCMD> cd DATA
ASMCMD> ls
DB_UNKNOWN/
ORCL/
ASMCMD> cd ORCL
ASMCMD> ls
ARCHIVELOG/
CONTROLFILE/
DATAFILE/
ONLINELOG/
TEMPFILE/
arch/
spfileorcl.ora
|
移除某檔案
ASMCMD> rm file_name
|
2.以ftp 方式連過去asm disk group
以ftp 經由XML DB 連至 diskgroup “+DATA”,port 為7787存取檔案,觀察其檔案結構
帳號 system
密碼 oracle
C:\Documents and Settings\Jui>ftp
ftp> open 10.1.149.48 7787
Connected to 10.1.149.48.
220- db1
Unauthorised use of this FTP server is prohibited and may be subject to civil an
d criminal prosecution.
220
db1 FTP Server (Oracle XML DB/Oracle Database) ready.
User (10.1.149.48:(none)): system
331 pass required for SYSTEM
Password:
230 SYSTEM logged in
ftp> cd /sys/asm
250 CWD Command successful
ftp> ls
200 PORT Command successful
150 ASCII Data Connection
DATA
226 ASCII Transfer Complete
ftp: 6 bytes received in 0.13Seconds 0.05Kbytes/sec.
ftp> cd DATA
250 CWD Command successful
ftp> ls
200 PORT Command successful
150 ASCII Data Connection
ORCL
DB_UNKNOWN
226 ASCII Transfer Complete
ftp: 19 bytes received in 0.00Seconds 19000.00Kbytes/sec.
ftp>disconnect
|
PS
另外還有Oracle 所附的兩個工具可以使用,管理方法跟一般oracle database 類似
- Oracle Enterprise Manager(web)
啟動enterprise manager:
#su – oracle
$emctl start dbconsole
檢查狀態
#su – oracle
$emctl status dbconsole
停止enterprise manager
#su - oracle
$emctl stop dbconsole
- Oracle Enterprise Manager console
沒有留言:
張貼留言