alter database mount;
alter database open;
alter database close;
alter database mount;
alter database dismount;
alter database open read only;
alter database mount exclusive;
alter database mount standby database;
Check oracle users status:
==========================
SELECT username,account_Status from dba_users;
Check Directory Path
====================
SELECT directory_path from dba_directories;
SELECT * from dba_directories;
Create Directory Path
=====================
create directory BACKUP_DIR as '/backup/dailybackup';
grant read, write on directory BACKUP_DIR to system;
Take Expdp Full Backup
======================
expdp system/manager full=y directory=BACKUP_DIR dumpfile='prodbk.dmp' logfile='prodbk.log';
EXPORT Backup of Tablespace
===========================
expdp hr/hr@ORCL DIRECTORY=exp_tblsp DUMPFILE=tablespace.dmp LOGFILE=tblsp_log.log TABLESPACES=USERS,EXAMPLE;
expdp system/manager DIRECTORY=BACKUP_DIR DUMPFILE=tablespace.dmp LOGFILE=tblsp_log.log TABLESPACES= PSIMAGE;
View Data Files
===============
col tablespace_name format a16;
col file_name format a36;
SELECT TABLESPACE_NAME, FILE_NAME, BYTES FROM DBA_DATA_FILES;
Check Tablespace online/offline status
======================================
SELECT TABLESPACE_NAME, STATUS, CONTENTS FROM USER_TABLESPACES;
Bring a Tablespace Offline/online
=================================
ALTER TABLESPACE my_space OFFLINE;
ALTER TABLESPACE my_space ONLINE;
alter database open;
alter database close;
alter database mount;
alter database dismount;
alter database open read only;
alter database mount exclusive;
alter database mount standby database;
Check oracle users status:
==========================
SELECT username,account_Status from dba_users;
Check Directory Path
====================
SELECT directory_path from dba_directories;
SELECT * from dba_directories;
Create Directory Path
=====================
create directory BACKUP_DIR as '/backup/dailybackup';
grant read, write on directory BACKUP_DIR to system;
Take Expdp Full Backup
======================
expdp system/manager full=y directory=BACKUP_DIR dumpfile='prodbk.dmp' logfile='prodbk.log';
EXPORT Backup of Tablespace
===========================
expdp hr/hr@ORCL DIRECTORY=exp_tblsp DUMPFILE=tablespace.dmp LOGFILE=tblsp_log.log TABLESPACES=USERS,EXAMPLE;
expdp system/manager DIRECTORY=BACKUP_DIR DUMPFILE=tablespace.dmp LOGFILE=tblsp_log.log TABLESPACES= PSIMAGE;
View Data Files
===============
col tablespace_name format a16;
col file_name format a36;
SELECT TABLESPACE_NAME, FILE_NAME, BYTES FROM DBA_DATA_FILES;
Check Tablespace online/offline status
======================================
SELECT TABLESPACE_NAME, STATUS, CONTENTS FROM USER_TABLESPACES;
Bring a Tablespace Offline/online
=================================
ALTER TABLESPACE my_space OFFLINE;
ALTER TABLESPACE my_space ONLINE;
No comments:
Post a Comment