复制[root@localhost data]# sqlite3 my_test.db #在SQLlite数据库中缺省database名为main SQLite version 3.6.20 Enter ".help"for instructions Enter SQL statements terminated with a ";" sqlite> .database seq name file --- --------------- ---------------------------------------------------------- 0 main /data/my_test.db sqlite> ATTACH DATABASE/data/my_test2.dbAsmy_test2; #在当前schema下附加上/data/my_test2.db中的据库数据,并且起一个别名为my_test2,高防服务器附加当然也可以起其他的和分名字 sqlite> .databases seq name file --- --------------- ---------------------------------------------------------- 0 main /data/my_test.db 2 my_test2 /data/my_test2.db sqlite> CREATETABLE my_test2.test_attach ( ...> a int(10), ...> b int(10) ...> ); sqlite> SELECT * FROM my_test2.sqlite_master WHERE type = tableAND tbl_name = test_attach; #直接在当前schema下使用/data/my_test2.db中的云南idc服务商数据,并且查看 table|test_attach|test_attach|4|CREATETABLE test_attach ( a int(10),据库 b int(10) ) sqlite> .exit [root@localhost data]# sqlite3 /data/my_test2.db #切换成my_test2.db的源码库schema查看验证下 SQLite version 3.6.20 Enter ".help"for instructions Enter SQL statements terminated with a ";" sqlite> SELECT sql FROM sqlite_master WHERE type = tableAND tbl_name = test_attach; CREATETABLE test_attach ( a int(10), b int(10) ) 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.