当前位置: 首页 > news >正文

记利用AI模型制作DataDump Scripts生成工具

声明:代码手工部分修改,生成式还是不够完美,哈哈。可直接存为html运行。

expdp

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Oracle expdp 脚本生成工具</title><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"><style>:root {--primary: #2c3e50;--secondary: #3498db;--success: #27ae60;--warning: #f39c12;--danger: #e74c3c;--light: #ecf0f1;--dark: #34495e;--border: #bdc3c7;}* {margin: 0;padding: 0;box-sizing: border-box;font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;}body {background-color: #f5f7fa;color: #333;line-height: 1.6;padding: 20px;}.container {max-width: 1400px;margin: 0 auto;display: flex;flex-direction: column;gap: 20px;}header {background: linear-gradient(135deg, var(--primary), var(--secondary));color: white;padding: 25px;border-radius: 10px;text-align: center;box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);}header h1 {margin-bottom: 10px;font-size: 2.2rem;}header p {max-width: 800px;margin: 0 auto;opacity: 0.9;}.main-content {display: flex;gap: 25px;}.form-container {flex: 1;background: white;padding: 25px;border-radius: 10px;box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);}.preview-container {flex: 1;background: white;padding: 25px;border-radius: 10px;box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);display: flex;flex-direction: column;}.section-title {margin-bottom: 20px;padding-bottom: 10px;border-bottom: 2px solid var(--secondary);color: var(--primary);display: flex;align-items: center;gap: 10px;}.form-group {margin-bottom: 20px;}label {display: block;margin-bottom: 8px;font-weight: 600;color: var(--dark);}input, select, textarea {width: 100%;padding: 12px;border: 1px solid var(--border);border-radius: 6px;font-size: 16px;transition: border-color 0.3s;}input:focus, select:focus, textarea:focus {border-color: var(--secondary);outline: none;box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);}.radio-group {display: flex;gap: 20px;flex-wrap: wrap;margin-top: 8px;}.radio-option {display: flex;align-items: center;gap: 8px;}.checkbox-group {display: flex;flex-wrap: wrap;gap: 20px;margin-top: 8px;}.checkbox-option {display: flex;align-items: center;gap: 8px;}.form-row {display: flex;gap: 15px;margin-bottom: 15px;}.form-row .form-group {flex: 1;margin-bottom: 0;}.command-preview {flex: 1;background-color: #2c3e50;color: #f1f1f1;padding: 20px;border-radius: 6px;overflow: auto;font-family: 'Courier New', monospace;font-size: 15px;line-height: 1.5;white-space: pre-wrap;margin-bottom: 20px;}.actions {display: flex;gap: 15px;justify-content: center;}button {padding: 12px 24px;border: none;border-radius: 6px;font-size: 16px;font-weight: 600;cursor: pointer;transition: all 0.3s ease;display: flex;align-items: center;gap: 8px;}.btn-primary {background-color: var(--secondary);color: white;}.btn-primary:hover {background-color: #2980b9;transform: translateY(-2px);}.btn-secondary {background-color: var(--success);color: white;}.btn-secondary:hover {background-color: #219653;transform: translateY(-2px);}.btn-danger {background-color: var(--danger);color: white;}.btn-danger:hover {background-color: #c0392b;transform: translateY(-2px);}.info-box {background-color: #e3f2fd;border-left: 4px solid var(--secondary);padding: 15px;border-radius: 0 6px 6px 0;margin: 15px 0;font-size: 14px;}.info-box i {color: var(--secondary);margin-right: 8px;}.mode-options {display: none;margin-top: 10px;padding: 15px;background-color: #f8f9fa;border-radius: 6px;border: 1px dashed var(--border);}.mode-active {display: block;}@media (max-width: 992px) {.main-content {flex-direction: column;}}@media (max-width: 576px) {.form-row {flex-direction: column;gap: 15px;}.actions {flex-direction: column;}}</style>
</head>
<body><div class="container"><header><h1><i class="fas fa-database"></i> Oracle expdp 脚本生成工具</h1><p>通过可视化界面配置数据泵导出参数,自动生成expdp命令</p></header><div class="main-content"><div class="form-container"><h2 class="section-title"><i class="fas fa-cog"></i> 导出参数配置</h2><div class="form-group"><label for="connection">数据库连接信息</label><input type="text" id="connection" placeholder="用户名/密码@服务名 例如: system/oracle@orcl"></div><div class="form-group"><label>导出模式</label><div class="radio-group"><div class="radio-option"><input type="radio" id="full" name="mode" value="full" checked><label for="full">全库导出 (FULL)</label></div><div class="radio-option"><input type="radio" id="schema" name="mode" value="schema"><label for="schema">用户模式 (SCHEMAS)</label></div><div class="radio-option"><input type="radio" id="table" name="mode" value="table"><label for="table">表模式 (TABLES)</label></div><div class="radio-option"><input type="radio" id="tablespace" name="mode" value="tablespace"><label for="tablespace">表空间 (TABLESPACES)</label></div></div></div><div id="schemaOptions" class="mode-options"><div class="form-group"><label for="schemas">用户列表 (多个用户用逗号分隔)</label><input type="text" id="schemas" placeholder="例如: HR, SCOTT"></div></div><div id="tableOptions" class="mode-options"><div class="form-group"><label for="tables">表列表 (多个表用逗号分隔)</label><input type="text" id="tables" placeholder="例如: EMPLOYEES, DEPARTMENTS"></div></div><div id="tablespaceOptions" class="mode-options"><div class="form-group"><label for="tablespaces">表空间列表 (多个表空间用逗号分隔)</label><input type="text" id="tablespaces" placeholder="例如: USERS, DATA"></div></div><div class="form-group"><label for="directory">目录对象 (DIRECTORY)</label><input type="text" id="directory" value="DATA_PUMP_DIR"></div><div class="form-row"><div class="form-group"><label for="dumpfile">导出文件名 (DUMPFILE)</label><input type="text" id="dumpfile" value="export.dmp"></div><div class="form-group"><label for="logfile">日志文件名 (LOGFILE)</label><input type="text" id="logfile" value="export.log"></div></div><div class="form-row"><div class="form-group"><label for="parallel">并行度 (PARALLEL)</label><input type="number" id="parallel" min="1" max="32" value="4"></div><div class="form-group"><label for="compression">压缩 (COMPRESSION)</label><select id="compression"><option value="NONE">无压缩</option><option value="METADATA_ONLY">仅元数据</option><option value="DATA_ONLY">仅数据</option><option value="ALL" selected>全部压缩</option></select></div></div><h2 class="section-title"><i class="fas fa-sliders-h"></i> 高级选项</h2><div class="form-group"><label>其他选项</label><div class="checkbox-group"><div class="checkbox-option"><input type="checkbox" id="estimate"><label for="estimate">预估大小 (ESTIMATE_ONLY)</label></div><div class="checkbox-option"><input type="checkbox" id="encryption"><label for="encryption">启用加密 (ENCRYPTION)</label></div><div class="checkbox-option"><input type="checkbox" id="flashback"><label for="flashback">闪回导出 (FLASHBACK_TIME)</label></div></div></div><div class="form-group"><label for="exclude">排除对象 (EXCLUDE)</label><input type="text" id="exclude" placeholder="例如: TABLE:\"IN ('TEMP', 'LOG')\""></div><div class="form-group"><label for="include">包含对象 (INCLUDE)</label><input type="text" id="include" placeholder="例如: TABLE:\"LIKE 'HR%'\""></div><div class="form-group"><label for="query">查询条件 (QUERY)</label><textarea id="query" rows="3" placeholder="例如: employees:\"WHERE department_id=10\"" style="resize: vertical;"></textarea></div><div class="info-box"><i class="fas fa-info-circle"></i> <strong>提示:</strong> expdp 命令需要在数据库服务器上执行,需要具有EXP_FULL_DATABASE权限</div></div><div class="preview-container"><h2 class="section-title"><i class="fas fa-code"></i> 生成的 expdp 命令</h2><div class="command-preview" id="commandOutput"># 请配置左侧参数以生成命令</div><div class="actions"><button class="btn-primary" onclick="generateCommand()"><i class="fas fa-sync-alt"></i> 生成命令</button><button class="btn-secondary" onclick="copyToClipboard()"><i class="fas fa-copy"></i> 复制命令</button><button class="btn-danger" onclick="resetForm()"><i class="fas fa-trash-alt"></i> 重置表单</button></div></div></div></div><script>// 模式切换显示document.querySelectorAll('input[name="mode"]').forEach(radio => {radio.addEventListener('change', function() {document.querySelectorAll('.mode-options').forEach(div => {div.classList.remove('mode-active');});const modeOptions = document.getElementById(`${this.value}Options`);if (modeOptions) {modeOptions.classList.add('mode-active');}generateCommand();});});// 输入变化时更新命令document.querySelectorAll('input, select, textarea').forEach(input => {input.addEventListener('input', generateCommand);});// 初始显示document.getElementById('schemaOptions').classList.remove('mode-active');document.getElementById('tableOptions').classList.remove('mode-active');document.getElementById('tablespaceOptions').classList.remove('mode-active');// 生成命令函数function generateCommand() {const connection = document.getElementById('connection').value.trim() || 'username/password@service_name';const mode = document.querySelector('input[name="mode"]:checked').value;const directory = document.getElementById('directory').value || 'DATA_PUMP_DIR';const dumpfile = document.getElementById('dumpfile').value || 'export.dmp';const logfile = document.getElementById('logfile').value || 'export.log';const parallel = document.getElementById('parallel').value;const compression = document.getElementById('compression').value;const estimate = document.getElementById('estimate').checked;const encryption = document.getElementById('encryption').checked;const flashback = document.getElementById('flashback').checked;const exclude = document.getElementById('exclude').value;const include = document.getElementById('include').value;const query = document.getElementById('query').value;let command = `expdp ${connection}\n`;command += `  directory=${directory}\n`;command += `  dumpfile=${dumpfile}\n`;command += `  logfile=${logfile}\n`;switch(mode) {case 'full':command += `  full=Y\n`;break;case 'schema':const schemas = document.getElementById('schemas').value;if (schemas) {command += `  schemas=${schemas}\n`;}break;case 'table':const tables = document.getElementById('tables').value;if (tables) {command += `  tables=${tables}\n`;}break;case 'tablespace':const tablespaces = document.getElementById('tablespaces').value;if (tablespaces) {command += `  tablespaces=${tablespaces}\n`;}break;}if (parallel && parallel > 1) {command += `  parallel=${parallel}\n`;}if (compression !== 'NONE') {command += `  compression=${compression}\n`;}if (estimate) {command += `  estimate_only=Y\n`;}if (encryption) {command += `  encryption=all\n`;command += `  encryption_password=your_password  # 请替换为实际密码\n`;}if (flashback) {command += `  flashback_time=SYSTIMESTAMP\n`;}if (exclude) {command += `  exclude=${exclude}\n`;}if (include) {command += `  include=${include}\n`;}if (query) {command += `  query=${query}\n`;}command += `  job_name=expdp_job\n`;document.getElementById('commandOutput').textContent = command;}// 复制到剪贴板function copyToClipboard() {const commandText = document.getElementById('commandOutput').textContent;navigator.clipboard.writeText(commandText).then(() => {alert('命令已复制到剪贴板!');}).catch(err => {alert('复制失败: ' + err);});}// 重置表单function resetForm() {document.getElementById('connection').value = '';document.getElementById('full').checked = true;document.getElementById('schemas').value = '';document.getElementById('tables').value = '';document.getElementById('tablespaces').value = '';document.getElementById('directory').value = 'DATA_PUMP_DIR';document.getElementById('dumpfile').value = 'export.dmp';document.getElementById('logfile').value = 'export.log';document.getElementById('parallel').value = '4';document.getElementById('compression').value = 'ALL';document.getElementById('estimate').checked = false;document.getElementById('encryption').checked = false;document.getElementById('flashback').checked = false;document.getElementById('exclude').value = '';document.getElementById('include').value = '';document.getElementById('query').value = '';document.querySelectorAll('.mode-options').forEach(div => {div.classList.remove('mode-active');});generateCommand();}// 页面加载时生成初始命令window.onload = generateCommand;</script>
</body>
</html>

impdp

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Oracle impdp 脚本生成工具</title><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"><style>:root {--primary: #1a5276;--secondary: #2874a6;--success: #239b56;--warning: #d68910;--danger: #c0392b;--light: #f8f9f9;--dark: #1b2631;--border: #aed6f1;}* {margin: 0;padding: 0;box-sizing: border-box;font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;}body {background: linear-gradient(135deg, #e3f2fd, #bbdefb);color: #333;line-height: 1.6;padding: 20px;min-height: 100vh;}.container {max-width: 1400px;margin: 0 auto;display: flex;flex-direction: column;gap: 20px;}header {background: linear-gradient(135deg, var(--primary), var(--secondary));color: white;padding: 25px;border-radius: 10px;text-align: center;box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);position: relative;overflow: hidden;}header::before {content: "";position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 Q50,20 100,0 L100,100 Q50,80 0,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');background-size: cover;pointer-events: none;}header h1 {margin-bottom: 10px;font-size: 2.5rem;position: relative;text-shadow: 0 2px 4px rgba(0,0,0,0.3);}header p {max-width: 800px;margin: 0 auto;opacity: 0.9;position: relative;font-size: 1.1rem;}.main-content {display: flex;gap: 25px;}.form-container {flex: 1;background: rgba(255, 255, 255, 0.95);padding: 25px;border-radius: 10px;box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);border: 1px solid rgba(40, 116, 166, 0.2);}.preview-container {flex: 1;background: rgba(255, 255, 255, 0.95);padding: 25px;border-radius: 10px;box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);border: 1px solid rgba(40, 116, 166, 0.2);display: flex;flex-direction: column;}.section-title {margin-bottom: 20px;padding-bottom: 10px;border-bottom: 2px solid var(--secondary);color: var(--primary);display: flex;align-items: center;gap: 10px;font-size: 1.4rem;}.form-group {margin-bottom: 20px;position: relative;}label {display: block;margin-bottom: 8px;font-weight: 600;color: var(--dark);font-size: 1.05rem;}.input-icon {position: relative;}.input-icon i {position: absolute;left: 12px;top: 50%;transform: translateY(-50%);color: var(--secondary);z-index: 2;}.input-icon input, .input-icon select, .input-icon textarea {padding-left: 40px;}input, select, textarea {width: 100%;padding: 14px;border: 1px solid var(--border);border-radius: 8px;font-size: 16px;transition: all 0.3s;background: #f8f9fa;}input:focus, select:focus, textarea:focus {border-color: var(--secondary);outline: none;box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);background: white;}.radio-group {display: flex;gap: 20px;flex-wrap: wrap;margin-top: 8px;}.radio-option {display: flex;align-items: center;gap: 8px;background: #eaf2f8;padding: 10px 15px;border-radius: 6px;border: 1px solid #d4e6f1;transition: all 0.2s;}.radio-option:hover {background: #d4e6f1;transform: translateY(-2px);}.checkbox-group {display: flex;flex-wrap: wrap;gap: 20px;margin-top: 8px;}.checkbox-option {display: flex;align-items: center;gap: 8px;background: #eaf2f8;padding: 10px 15px;border-radius: 6px;border: 1px solid #d4e6f1;transition: all 0.2s;}.checkbox-option:hover {background: #d4e6f1;transform: translateY(-2px);}.form-row {display: flex;gap: 15px;margin-bottom: 15px;}.form-row .form-group {flex: 1;margin-bottom: 0;}.command-preview {flex: 1;background: linear-gradient(to bottom, #2c3e50, #1a2530);color: #e0f7fa;padding: 20px;border-radius: 8px;overflow: auto;font-family: 'Courier New', monospace;font-size: 16px;line-height: 1.6;white-space: pre-wrap;margin-bottom: 20px;box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);border: 1px solid rgba(255,255,255,0.1);}.actions {display: flex;gap: 15px;justify-content: center;flex-wrap: wrap;}button {padding: 14px 28px;border: none;border-radius: 8px;font-size: 17px;font-weight: 600;cursor: pointer;transition: all 0.3s ease;display: flex;align-items: center;gap: 10px;box-shadow: 0 4px 8px rgba(0,0,0,0.2);}button:hover {transform: translateY(-3px);box-shadow: 0 6px 12px rgba(0,0,0,0.25);}button:active {transform: translateY(1px);}.btn-primary {background: linear-gradient(to right, var(--secondary), var(--primary));color: white;}.btn-primary:hover {background: linear-gradient(to right, #3498db, #1a5276);}.btn-secondary {background: linear-gradient(to right, var(--success), #1d8348);color: white;}.btn-secondary:hover {background: linear-gradient(to right, #27ae60, #186a3b);}.btn-danger {background: linear-gradient(to right, var(--danger), #922b21);color: white;}.btn-danger:hover {background: linear-gradient(to right, #e74c3c, #7b241c);}.info-box {background: linear-gradient(to right, #d6eaf8, #ebf5fb);border-left: 4px solid var(--secondary);padding: 16px;border-radius: 0 8px 8px 0;margin: 20px 0;font-size: 15px;box-shadow: 0 2px 5px rgba(0,0,0,0.05);}.info-box i {color: var(--secondary);margin-right: 10px;font-size: 1.2rem;}.mode-options {display: none;margin-top: 10px;padding: 18px;background: #eaf7ff;border-radius: 8px;border: 1px dashed var(--border);}.mode-active {display: block;animation: fadeIn 0.4s ease;}@keyframes fadeIn {from { opacity: 0; transform: translateY(10px); }to { opacity: 1; transform: translateY(0); }}.remap-section {background: #f0f8ff;padding: 20px;border-radius: 8px;border: 1px solid #d4e6f1;margin: 15px 0;}.remap-row {display: flex;gap: 15px;margin-bottom: 15px;}.remap-row input {background: white;}.footer {text-align: center;padding: 20px;color: var(--primary);font-size: 0.9rem;margin-top: 20px;border-top: 1px solid rgba(40, 116, 166, 0.2);}@media (max-width: 992px) {.main-content {flex-direction: column;}header h1 {font-size: 2rem;}}@media (max-width: 768px) {.form-row, .remap-row {flex-direction: column;gap: 15px;}button {padding: 12px 20px;font-size: 16px;}}@media (max-width: 480px) {.radio-group, .checkbox-group {flex-direction: column;gap: 10px;}.radio-option, .checkbox-option {width: 100%;}.actions {flex-direction: column;}}</style>
</head>
<body><div class="container"><header><h1><i class="fas fa-database"></i> Oracle impdp 脚本生成工具</h1><p>通过可视化界面配置数据泵导入参数,自动生成impdp命令</p></header><div class="main-content"><div class="form-container"><h2 class="section-title"><i class="fas fa-cogs"></i> 导入参数配置</h2><div class="form-group"><label for="connection">数据库连接信息</label><div class="input-icon"><i class="fas fa-link"></i><input type="text" id="connection" placeholder="用户名/密码@服务名 例如: system/oracle@orcl"></div></div><div class="form-group"><label>导入模式</label><div class="radio-group"><div class="radio-option"><input type="radio" id="full" name="mode" value="full" checked><label for="full">全库导入 (FULL)</label></div><div class="radio-option"><input type="radio" id="schema" name="mode" value="schema"><label for="schema">用户模式 (SCHEMAS)</label></div><div class="radio-option"><input type="radio" id="table" name="mode" value="table"><label for="table">表模式 (TABLES)</label></div><div class="radio-option"><input type="radio" id="remap" name="mode" value="remap"><label for="remap">重映射模式</label></div></div></div><div id="schemaOptions" class="mode-options"><div class="form-group"><label for="schemas">用户列表 (多个用户用逗号分隔)</label><div class="input-icon"><i class="fas fa-users"></i><input type="text" id="schemas" placeholder="例如: HR, SCOTT"></div></div></div><div id="tableOptions" class="mode-options"><div class="form-group"><label for="tables">表列表 (多个表用逗号分隔)</label><div class="input-icon"><i class="fas fa-table"></i><input type="text" id="tables" placeholder="例如: EMPLOYEES, DEPARTMENTS"></div></div></div><div id="remapOptions" class="mode-options"><div class="form-group"><label for="remapSchema">源用户到目标用户映射 (REMAP_SCHEMA)</label><div class="input-icon"><i class="fas fa-exchange-alt"></i><input type="text" id="remapSchema" placeholder="例如: HR:HR_NEW, SCOTT:SCOTT_NEW"></div></div></div><div class="form-group"><label for="directory">目录对象 (DIRECTORY)</label><div class="input-icon"><i class="fas fa-folder-open"></i><input type="text" id="directory" value="DATA_PUMP_DIR"></div></div><div class="form-row"><div class="form-group"><label for="dumpfile">转储文件名 (DUMPFILE)</label><div class="input-icon"><i class="fas fa-file-export"></i><input type="text" id="dumpfile" value="export.dmp"></div></div><div class="form-group"><label for="logfile">日志文件名 (LOGFILE)</label><div class="input-icon"><i class="fas fa-file-alt"></i><input type="text" id="logfile" value="import.log"></div></div></div><div class="form-row"><div class="form-group"><label for="parallel">并行度 (PARALLEL)</label><div class="input-icon"><i class="fas fa-tachometer-alt"></i><input type="number" id="parallel" min="1" max="32" value="4"></div></div><div class="form-group"><label for="tableExists">表存在行为 (TABLE_EXISTS_ACTION)</label><div class="input-icon"><i class="fas fa-sync-alt"></i><select id="tableExists"><option value="SKIP">跳过 (SKIP)</option><option value="APPEND">追加 (APPEND)</option><option value="TRUNCATE">清空 (TRUNCATE)</option><option value="REPLACE">替换 (REPLACE)</option></select></div></div></div><h2 class="section-title"><i class="fas fa-sliders-h"></i> 高级选项</h2><div class="form-group"><label>导入内容</label><div class="checkbox-group"><div class="checkbox-option"><input type="checkbox" id="metadataOnly"><label for="metadataOnly">仅元数据 (CONTENT=METADATA_ONLY)</label></div><div class="checkbox-option"><input type="checkbox" id="dataOnly"><label for="dataOnly">仅数据 (CONTENT=DATA_ONLY)</label></div></div></div><div class="form-group"><label>其他选项</label><div class="checkbox-group"><div class="checkbox-option"><input type="checkbox" id="skipUnusable"><label for="skipUnusable">跳过不可用索引 (SKIP_UNUSABLE_INDEXES)</label></div><div class="checkbox-option"><input type="checkbox" id="transform" checked><label for="transform">转换段属性 (TRANSFORM=SEGMENT_ATTRIBUTES:N)</label></div><div class="checkbox-option"><input type="checkbox" id="ignoreErrors"><label for="ignoreErrors">忽略错误 (IGNORE_ERRORS)</label></div></div></div><div class="remap-section"><h3><i class="fas fa-random"></i> 重映射设置</h3><div class="remap-row"><div class="form-group"><label for="remapTablespace">表空间重映射 (REMAP_TABLESPACE)</label><div class="input-icon"><i class="fas fa-database"></i><input type="text" id="remapTablespace" placeholder="例如: OLD_TS:NEW_TS"></div></div><div class="form-group"><label for="remapDatafile">数据文件重映射 (REMAP_DATAFILE)</label><div class="input-icon"><i class="fas fa-hdd"></i><input type="text" id="remapDatafile" placeholder="例如: '/old/path':'/new/path'"></div></div></div></div><div class="form-group"><label for="exclude">排除对象 (EXCLUDE)</label><div class="input-icon"><i class="fas fa-ban"></i><input type="text" id="exclude" placeholder="例如: TABLE:\"IN ('TEMP', 'LOG')\""></div></div><div class="form-group"><label for="include">包含对象 (INCLUDE)</label><div class="input-icon"><i class="fas fa-check-circle"></i><input type="text" id="include" placeholder="例如: TABLE:\"LIKE 'HR%'\""></div></div><div class="info-box"><i class="fas fa-info-circle"></i> <strong>使用提示:</strong> impdp 命令需要在数据库服务器上执行,需要具有IMP_FULL_DATABASE权限。重映射功能在跨环境迁移时特别有用。</div></div><div class="preview-container"><h2 class="section-title"><i class="fas fa-terminal"></i> 生成的 impdp 命令</h2><div class="command-preview" id="commandOutput"># 请配置左侧参数以生成命令# 生成的命令将显示在这里</div><div class="actions"><button class="btn-primary" onclick="generateCommand()"><i class="fas fa-bolt"></i> 生成命令</button><button class="btn-secondary" onclick="copyToClipboard()"><i class="fas fa-copy"></i> 复制命令</button><button class="btn-danger" onclick="resetForm()"><i class="fas fa-trash-alt"></i> 重置表单</button></div><div class="info-box" style="margin-top: 20px;"><i class="fas fa-lightbulb"></i> <strong>最佳实践:</strong> 在生产环境执行导入前,建议先使用 SQLFILE 参数生成SQL脚本进行预览,或使用 CONTENT=METADATA_ONLY 选项仅导入元数据。</div></div></div><div class="footer"><p>Oracle 数据泵导入工具 (impdp) | 版本 1.2 | 支持 Oracle 11g, 12c, 19c, 21c</p></div></div><script>// 模式切换显示document.querySelectorAll('input[name="mode"]').forEach(radio => {radio.addEventListener('change', function() {document.querySelectorAll('.mode-options').forEach(div => {div.classList.remove('mode-active');});const modeOptions = document.getElementById(`${this.value}Options`);if (modeOptions) {modeOptions.classList.add('mode-active');}generateCommand();});});// 输入变化时更新命令document.querySelectorAll('input, select, textarea').forEach(input => {input.addEventListener('input', generateCommand);});document.querySelectorAll('input[type="checkbox"]').forEach(checkbox => {checkbox.addEventListener('change', generateCommand);});// 初始显示document.getElementById('schemaOptions').classList.remove('mode-active');document.getElementById('tableOptions').classList.remove('mode-active');document.getElementById('remapOptions').classList.remove('mode-active');// 生成命令函数function generateCommand() {const connection = document.getElementById('connection').value.trim() || 'username/password@service_name';const mode = document.querySelector('input[name="mode"]:checked').value;const directory = document.getElementById('directory').value || 'DATA_PUMP_DIR';const dumpfile = document.getElementById('dumpfile').value || 'export.dmp';const logfile = document.getElementById('logfile').value || 'import.log';const parallel = document.getElementById('parallel').value;const tableExists = document.getElementById('tableExists').value;const metadataOnly = document.getElementById('metadataOnly').checked;const dataOnly = document.getElementById('dataOnly').checked;const skipUnusable = document.getElementById('skipUnusable').checked;const transform = document.getElementById('transform').checked;const ignoreErrors = document.getElementById('ignoreErrors').checked;const exclude = document.getElementById('exclude').value;const include = document.getElementById('include').value;const remapTablespace = document.getElementById('remapTablespace').value;const remapDatafile = document.getElementById('remapDatafile').value;let command = `impdp ${connection}\n`;command += `  directory=${directory}\n`;command += `  dumpfile=${dumpfile}\n`;command += `  logfile=${logfile}\n`;switch(mode) {case 'full':command += `  full=Y\n`;break;case 'schema':const schemas = document.getElementById('schemas').value;if (schemas) {command += `  schemas=${schemas}\n`;}break;case 'table':const tables = document.getElementById('tables').value;if (tables) {command += `  tables=${tables}\n`;}break;case 'remap':const remapSchema = document.getElementById('remapSchema').value;if (remapSchema) {command += `  remap_schema=${remapSchema}\n`;}break;}if (parallel && parallel > 1) {command += `  parallel=${parallel}\n`;}if (tableExists) {command += `  table_exists_action=${tableExists}\n`;}if (metadataOnly) {command += `  content=metadata_only\n`;} else if (dataOnly) {command += `  content=data_only\n`;}if (skipUnusable) {command += `  skip_unusable_indexes=Y\n`;}if (transform) {command += `  transform=segment_attributes:n\n`;}if (ignoreErrors) {command += `  ignore_errors=Y\n`;}if (exclude) {command += `  exclude=${exclude}\n`;}if (include) {command += `  include=${include}\n`;}if (remapTablespace) {command += `  remap_tablespace=${remapTablespace}\n`;}if (remapDatafile) {command += `  remap_datafile=${remapDatafile}\n`;}command += `  job_name=impdp_job\n`;// 添加注释command = `# Oracle 数据泵导入命令 (impdp)\n` +`# 生成时间: ${new Date().toLocaleString()}\n` +`# 注意: 请在实际使用前仔细检查参数\n\n` + command;document.getElementById('commandOutput').textContent = command;}// 复制到剪贴板function copyToClipboard() {const commandText = document.getElementById('commandOutput').textContent;navigator.clipboard.writeText(commandText).then(() => {alert('命令已成功复制到剪贴板!');}).catch(err => {alert('复制失败: ' + err);});}// 重置表单function resetForm() {if (confirm('确定要重置所有配置吗?')) {document.getElementById('connection').value = '';document.getElementById('full').checked = true;document.getElementById('schemas').value = '';document.getElementById('tables').value = '';document.getElementById('remapSchema').value = '';document.getElementById('directory').value = 'DATA_PUMP_DIR';document.getElementById('dumpfile').value = 'export.dmp';document.getElementById('logfile').value = 'import.log';document.getElementById('parallel').value = '4';document.getElementById('tableExists').value = 'SKIP';document.getElementById('metadataOnly').checked = false;document.getElementById('dataOnly').checked = false;document.getElementById('skipUnusable').checked = false;document.getElementById('transform').checked = true;document.getElementById('ignoreErrors').checked = false;document.getElementById('exclude').value = '';document.getElementById('include').value = '';document.getElementById('remapTablespace').value = '';document.getElementById('remapDatafile').value = '';document.querySelectorAll('.mode-options').forEach(div => {div.classList.remove('mode-active');});generateCommand();}}// 页面加载时生成初始命令window.onload = generateCommand;</script>
</body>
</html>
http://www.xdnf.cn/news/1041175.html

相关文章:

  • 理解 C++ 的 this 指针
  • Seata与消息队列(如RocketMQ)如何实现最终一致性?
  • 【构建】CMake 构建系统重点内容
  • springboot音乐网站与分享平台
  • MySQL-DML语句深度解析与实战指南
  • 60天python训练计划----day52
  • Golang 在 Linux 平台上的并发控制
  • LeetCode - LCR 173. 点名
  • 基于深度学习的人类活动识别模型研究:HAR-DeepConvLG的设计与应用
  • 【大厂机试题解法笔记】恢复数字序列
  • Python开发功能实用
  • 关于钉钉的三方登录
  • 项目管理工具在并行管理中如何充分发挥作用
  • Python 使用 DrissionPage 模块进行爬虫
  • 【Linux网络】多路转接之select
  • windows 开发
  • JavaScript性能优化实战指南:从理论到案例的全面解析
  • 【医疗电子技术-7.2】血糖监测技术
  • 高效同步Linux服务器文件技巧
  • Spring Bean 生命周期:注册、初始化、注入及后置操作执行顺序
  • 湖北理元理律师事务所债务规划方法论:法律框架下的可持续还款体系
  • Java反射机制深度解析
  • 微信小程序实现文字逐行动画效果渲染显示
  • 《Origin画百图》之核密度图
  • JAVA中关于Animal和Dog类的类型转换,可能出现ClassCastException的情况
  • AndroidMJ-mvp与mvvm
  • 贪心算法经典问题
  • 思科交换机远程登录配置
  • XCTF-misc-Test-flag-please-ignore
  • Trino权威指南