oracle??鵵????????????????---expdp/impdp
???????????? ???????[ 2016/8/15 13:44:14 ] ????????????? Oracle
??????????????????
??????????????????????У?
????1. ???Oracle????? ??sid
????SQL< select instance_name??host_name??startup_time??status??database_status from v$instance;
????2.??????????????????select username?? DEFAULT_TABLESPACE from dba_users;
????3.?л??????????????????????????????select table_name??tablespace_name from user_all_tables;
????select tablespace_name??count(tablespace_name) from user_all_tables group by tablespace_name;
????4.????????????
????select
????f.tablespace_name??
????a.total??
????f.free??(a.total-f.free)/1024 "usedSIZE(G)"
??????round((f.free/a.total)*100) "% Free"
????from
????(select tablespace_name?? sum(bytes/(1024*1024))total from dba_data_files group by tablespace_name) a??
????(select tablespace_name??round(sum(bytes/(1024*1024))) free from dba_free_space group by tablespace_name) f
????WHERE a.tablespace_name =f.tablespace_name(+)
????order by "% Free"
????oracle??鵵????????????????---expdp/impdp
????5.????dump directory???? create or replace directory test_dir as '/home/oracle/dump';
??????????????????????????? ho mkdir /home/oracle/dump
????6.?????Grant read??write on directory test_dir to cesm;
????7.?????????
???????????ho expdp '/ as sysdba' full=y directory=test_dir dumpfile=full.dmp
????????????????ho expdp '/ as sysdba'schemas=bankuserdirectory=test_dir dumpfile=bank.dmp
????windows?????ho expdp '/ as sysdba'schemas=bankuserdirectory=test_dir dumpfile=bank.dmp
???????????????ho expdp bankuser/bankuser tablespaces=bank directory=test_dir dumpfile=tablespace.dmp
?????????????? ho expdp bankuser/bankuser tables=emp% directory=test_dir dumpfile=table.dmp ??emp%????emp???????
?????????????????????ho expdp scott/cat tables=emp query='where deptno=10' directory=test_dir dumpfile=emp.dmp
????????????????????ho expdp scott/cat tables=emp??emp1??dept query='where deptno=10' directory=test_dir dumpfile=emp3.dmp
????oracle??鵵????????????????---expdp/impdp
?????? expdp "testuser/testuser" DIRECTORY=test_dir dumpfile=cu.dmp tables=test query="where cust like '066%'"
????query="where cust_no like '066%'" ?????????
????????????壺
????expdp system/<password> DIRECTORY=datamove DUMPFILE=schema_exp.dmp SCHEMAS=scott content=metadata_only
??????????
????Linux/Unix Platform
????expdp system/<password> DIRECTORY=datamove DUMPFILE=export.dmp logfile=export.log schemas=scott INCLUDE=table:"LIKE '%EMP%'"
????Windos Platform
????expdp system/<password> DIRECTORY=datamove DUMPFILE=export.dmp logfile=export.log schemas=scott INCLUDE=table:"LIKE '%EMP%'"
????8.?????????
????2)????????? ??????david??е???scott???????(??ī???β??????)
????impdp david/abc123 directory=dirdp dumpfile=expdp.dmp remap_schema=scott:david
????impdp david/abc123 directory=dirdp dumpfile=expdp.dmp schemas=scott remap_schema=scott:david
????ho impdp system/oracle schemas=bankuser ??remap_schema=bankuser:bankuser?? directory=test_dir dumpfile=bank.dmp ?????????????????????????????????????????????????????????????????????
???????????
????ho impdp scott/cat tables=emp directory=test_dir dumpfile=emp.dmp
?????????????????
????impdpdavid/abc123@orclschemas=scott remap_schema=scott:david directory=dir
????dp dumpfile=expdp.dmp query='dept:"WHERE DEPTNO=20"';
??????????????
????impdp system/oracle directory=dirdp dumpfile=tablespace.dmp tablespaces=users;
?????????????????
????impdp system/oracle directory=dirdp dumpfile=full.dmp full=y;
???????е???expdp scott/tiger@orcl schemas=scott directory=dirdp dumpfile=expdp_%U.dmp logfile=expdp.log parallel=12 job_name=jobname_parallel
???????е???
????oracle??鵵????????????????---expdp/impdp
?????????????????
????oracle??鵵????????????????---expdp/impdp
????oracle??鵵????????????????---expdp/impdp
????oracle??鵵????????????????---expdp/impdp
????revoke??????
??????????????select * from dba_directories;
????--?????????
????Sql????
????SELECT PRIVILEGE?? DIRECTORY_NAME?? DIRECTORY_PATH
????FROM USER_TAB_PRIVS T?? ALL_DIRECTORIES D
????WHERE T.TABLE_NAME(+) = D.DIRECTORY_NAME
????ORDER BY 2?? 1;
????oracle??鵵????????????????---expdp/impdp
????oracle??鵵????????????????---expdp/impdp
????oracle??鵵????????????????---expdp/impdp
?????????鵵??????????????????
??????鵵????鵵??????????????????????????rman?????????
??????鵵?£?RMAN????????????????????????
??????????????????????鵵?ɡ?
??????oracle????????鵵?????鵵????
????Oracle?????鵵??(NOARCHIVELOG) ??鵵??(ARCHIVELOG)????鵵?????????鵵??????????????????????????????????????????????????????????????????????????????????????????????????????????????????Oracle?????????鵵?????????????????????????ù鵵????????????鵵???????????????????????????????Oracle?????????????????????????
????1.?????????????????????????
????select name??log_mode from v$database;
???????????????????
????archive log list??(?÷??????as sysdba)
????2.????????
????SQL> shutdown immediate;
????3.????????mount??
????SQL> startup mount; 4.??????????鵵??
????SQL> alter database archivelog;
????5??????????
????SQL> alter database open;
????SQL> SELECT NAME??created??log_mode FROM v$database;
????NAME CREATED LOG_MODE
????--------- --------- ------------
????ORCL 04-JUN-12 ARCHIVELOG
????6?????鵵?????·??????
????SQL> show parameter db_recovery_file_dest;
????NAME TYPE VALUE
????------------------------------------ ----------- ------------------------------
????db_recovery_file_dest string /data/app/oracle/flash_recovery_area
????db_recovery_file_dest_size big integer 2G
????????????
????SQL> alter system set db_recovery_file_dest_size=20g;
????SQL> alter system set db_recovery_file_dest='/app/arc';
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11