{ "cells": [ { "cell_type": "code", "execution_count": 2, "id": "7246e0c8-61cd-4cbf-a978-aa0dc0172d6d", "metadata": {}, "outputs": [], "source": [ "import dolphindb as ddb" ] }, { "cell_type": "code", "execution_count": 3, "id": "5d0f471e-682e-43cc-abdb-7e52f3bbd707", "metadata": {}, "outputs": [], "source": [ "sess = ddb.session('localhost', 8848)\n", "sess.login('admin', '123456')" ] }, { "cell_type": "code", "execution_count": null, "id": "fca58bdc-2aa1-4610-9a94-67d55f97a6e1", "metadata": {}, "outputs": [], "source": [ "sess.run(\"\"\"\n", " migrate('/data/dolphindb/backup/', \"dfs://hft_stock_ts\", \"OrderPartitioned\")\n", "\"\"\")" ] }, { "cell_type": "code", "execution_count": 60, "id": "ed17fd0b-9b36-47e4-9ab6-11459a3621fb", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "115548" ] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sess = ddb.session('192.168.1.7', 8848)\n", "sess.login('admin', '123456')\n", "\n", "# backup(backup_path, sql_obj, force, parallel)\n", "code = \"\"\"\n", " backup('/data/dolphindb/backup/', , true, false);\n", " backup('/data/dolphindb/backup/', , true, false);\n", " backup('/data/dolphindb/backup/', , true, false);\n", " backup('/data/dolphindb/backup/', , true, false);\n", " backup('/data/dolphindb/backup/', , true, false);\n", "\"\"\"\n", "\n", "sess.run(code)" ] }, { "cell_type": "code", "execution_count": 33, "id": "8b7dae3d-aef1-4c50-92b2-460d4fea0a96", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
tableNamephysicalIndex
0daily_klineuoH
1hft_daily_factoru6J
\n", "
" ], "text/plain": [ " tableName physicalIndex\n", "0 daily_kline uoH\n", "1 hft_daily_factor u6J" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sess.run(\"\"\"\n", " listTables(\"dfs://daily_stock_ts\");\n", "\"\"\")" ] }, { "cell_type": "code", "execution_count": 34, "id": "8af3381d-9fdc-4cb0-b3a9-d6538db97476", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "50" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sess.run(\"\"\"\n", " backup('/data/dolphindb/backup/',