进入/data/data/com.android.providers.media/databases/
/data/data/com.android.providers.media/databases # ls
external.db internal.db jingwen
# sqlite3 internal.db
sqlite> .help
.auth ON|OFF Show authorizer callbacks
.backup ?DB? FILE Backup DB (default "main") to FILE
.bail on|off Stop after hitting an error. Default OFF
.binary on|off Turn binary output on or off. Default OFF
.changes on|off Show number of rows changed by SQL
.check GLOB Fail if output since .testcase does not match
.clone NEWDB Clone data into NEWDB from the existing database
.databases List names and files of attached databases
.dbinfo ?DB? Show status information about the database
.dump ?TABLE? ... Dump the database in an SQL text format
If TABLE specified, only dump tables matching
LIKE pattern TABLE.
.echo on|off Turn command echo on or off
.eqp on|off|full Enable or disable automatic EXPLAIN QUERY PLAN
.exit Exit this program
.explain ?on|off|auto? Turn EXPLAIN output mode on or off or to automatic
.fullschema ?--indent? Show schema and the content of sqlite_stat tables
.headers on|off Turn display of headers on or off
.help Show this message
.import FILE TABLE Import data from FILE into TABLE
.imposter INDEX TABLE Create imposter table TABLE on index INDEX
.indexes ?TABLE? Show names of all indexes
If TABLE specified, only show indexes for tables
matching LIKE pattern TABLE.
.limit ?LIMIT? ?VAL? Display or change the value of an SQLITE_LIMIT
.lint OPTIONS Report potential schema issues. Options:
fkey-indexes Find missing foreign key indexes
.log FILE|off Turn logging on or off. FILE can be stderr/stdout
.mode MODE ?TABLE? Set output mode where MODE is one of:
ascii Columns/rows delimited by 0x1F and 0x1E
csv Comma-separated values
column Left-aligned columns. (See .width)
html HTML <table> code
insert SQL insert statements for TABLE
line One value per line
list Values delimited by "|"
quote Escape answers as for SQL
tabs Tab-separated values
tcl TCL list elements
.nullvalue STRING Use STRING in place of NULL values
.once FILENAME Output for the next SQL command only to FILENAME
.open ?--new? ?FILE? Close existing database and reopen FILE
The --new starts with an empty file
.output ?FILENAME? Send output to FILENAME or stdout
.print STRING... Print literal STRING
.prompt MAIN CONTINUE Replace the standard prompts
.quit Exit this program
.read FILENAME Execute SQL in FILENAME
.restore ?DB? FILE Restore content of DB (default "main") from FILE
.save FILE Write in-memory database into FILE
.scanstats on|off Turn sqlite3_stmt_scanstatus() metrics on or off
.schema ?PATTERN? Show the CREATE statements matching PATTERN
Add --indent for pretty-printing
.selftest ?--init? Run tests defined in the SELFTEST table
.separator COL ?ROW? Change the column separator and optionally the row
separator for both the output mode and .import
.sha3sum ?OPTIONS...? Compute a SHA3 hash of database content
.shell CMD ARGS... Run CMD ARGS... in a system shell
.show Show the current values for various settings
.stats ?on|off? Show stats or turn stats on or off
.system CMD ARGS... Run CMD ARGS... in a system shell
.tables ?TABLE? List names of tables
If TABLE specified, only list tables matching
LIKE pattern TABLE.
.testcase NAME Begin redirecting output to 'testcase-out.txt'
.timeout MS Try opening locked tables for MS milliseconds
.timer on|off Turn SQL timer on or off
.trace FILE|off Output each SQL statement as it is run
.vfsinfo ?AUX? Information about the top-level VFS
.vfslist List all available VFSes
.vfsname ?AUX? Print the name of the VFS stack
.width NUM1 NUM2 ... Set column widths for "column" mode
Negative values right-justify
sqlite> .database
main: /data/data/com.android.providers.media/databases/internal.db
sqlite> .show
echo: off
eqp: off
explain: auto
headers: off
mode: list
nullvalue: ""
output: stdout
colseparator: "|"
rowseparator: "\n"
stats: off
width:
filename: internal.db
sqlite> .tables
album_art artists_albums_map log
album_info audio search
albums audio_genres_map_noid searchhelpertitle
android_metadata audio_meta thumbnails
artist_info files video
artists images videothumbnails
sqlite> .dump artists
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE artists (artist_id INTEGER PRIMARY KEY,artist_key TEXT NOT NULL UNIQUE,artist TEXT NOT NULL);
INSERT INTO artists VALUES(1,'','<unknown>');
INSERT INTO artists VALUES(2,','pdx');
INSERT INTO artists VALUES(3,','Dave Sparks');
INSERT INTO artists VALUES(4,','Dr. MAD');
INSERT INTO artists VALUES(5,','Ali Spagnola');
INSERT INTO artists VALUES(6,','(c) 2012 Android Open Source Project');
CREATE INDEX artist_idx on artists(artist);
CREATE INDEX artistkey_index on artists(artist_key);
COMMIT;
sqlite> .schema artists
CREATE TABLE artists (artist_id INTEGER PRIMARY KEY,artist_key TEXT NOT NULL UNIQUE,artist TEXT NOT NULL);
CREATE INDEX artist_idx on artists(artist);
CREATE INDEX artistkey_index on artists(artist_key);
sqlite> select * from artists;
1||<unknown>
2|pdx
3|Dave Sparks
4|Dr. MAD
5|Ali Spagnola
6|(c) 2012 Android Open Source Project
sqlite> .output art
sqlite> select * from artists;
sqlite> .dump artists
sqlite> .dump artists
sqlite> .exit
/data/data/com.android.providers.media/databases
# cat art
1||<unknown>
2|pdx
3|Dave Sparks
4|Dr. MAD
5|Ali Spagnola
6|(c) 2012 Android Open Source Project
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE artists (artist_id INTEGER PRIMARY KEY,artist_key TEXT NOT NULL UNIQUE,artist TEXT NOT NULL);
INSERT INTO artists VALUES(1,'','<unknown>');
INSERT INTO artists VALUES(2,','pdx');
INSERT INTO artists VALUES(3,','Dave Sparks');
INSERT INTO artists VALUES(4,','Dr. MAD');
INSERT INTO artists VALUES(5,','Ali Spagnola');
INSERT INTO artists VALUES(6,','(c) 2012 Android Open Source Project');
CREATE INDEX artist_idx on artists(artist);
CREATE INDEX artistkey_index on artists(artist_key);
COMMIT;
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE artists (artist_id INTEGER PRIMARY KEY,artist_key TEXT NOT NULL UNIQUE,artist TEXT NOT NULL);
INSERT INTO artists VALUES(1,'','<unknown>');
INSERT INTO artists VALUES(2,','pdx');
INSERT INTO artists VALUES(3,','Dave Sparks');
INSERT INTO artists VALUES(4,','Dr. MAD');
INSERT INTO artists VALUES(5,','Ali Spagnola');
INSERT INTO artists VALUES(6,','(c) 2012 Android Open Source Project');
CREATE INDEX artist_idx on artists(artist);
CREATE INDEX artistkey_index on artists(artist_key);
COMMIT;
sqlite> .output stdout
sqlite> .dump artists
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE artists (artist_id INTEGER PRIMARY KEY,artist_key TEXT NOT NULL UNIQUE,artist TEXT NOT NULL);
INSERT INTO artists VALUES(1,'','<unknown>');
INSERT INTO artists VALUES(2,','pdx');
INSERT INTO artists VALUES(3,','Dave Sparks');
INSERT INTO artists VALUES(4,','Dr. MAD');
INSERT INTO artists VALUES(5,','Ali Spagnola');
INSERT INTO artists VALUES(6,','(c) 2012 Android Open Source Project');
CREATE INDEX artist_idx on artists(artist);
CREATE INDEX artistkey_index on artists(artist_key);
COMMIT;
sqlite> .exit