Where Is the Personal Data in Our Database? How to Find PII Columns
· DataMint · 7 min read
"How many personal data columns does our system have?" Not many organizations can answer that right away. There is a personal data file register, but it was made four years ago, and four hundred tables have been added since.
Finding them takes three steps. Pick candidates by column name, confirm with a sample of the actual values, and have a person make the final call. No single step is enough on its own. Below is what each step catches and what it misses.
Step 1: pick candidates from column names and comments
This comes first, and it is the cheapest way to find a lot. Search the names and comments in the data dictionary.
-- Oracle example
SELECT c.owner, c.table_name, c.column_name, c.data_type, m.comments
FROM all_tab_columns c
LEFT JOIN all_col_comments m
ON m.owner = c.owner AND m.table_name = c.table_name
AND m.column_name = c.column_name
WHERE c.owner = 'APP'
AND ( REGEXP_LIKE(c.column_name, 'RRN|JUMIN|SSN|TEL|HP|MOBILE|EMAIL|ADDR|ACCT|CARD')
OR REGEXP_LIKE(m.comments, '주민|전화|휴대|메일|주소|계좌|카드|성명|이름') );(The example is from a Korean system. JUMIN is a common romanized column name for the resident registration number, Korea's national ID number, and the second pattern matches Korean comment words for resident number, phone, mobile, mail, address, account, card and name.)
In a system that sticks to a standard glossary, this alone turns up most of them. The problem is the columns that do not.
| Column | Actual content | Result |
|---|---|---|
| ETC1, RESERVED_03 | Mobile phone number (a spare column used when it was added in a hurry) | Missed |
| REMARK, MEMO | Support notes, with names and numbers mixed in | Missed |
| REF_NO | In some business processes, a resident registration number | Missed |
| REQ_BODY | A whole interface message (JSON) | Missed |
| PROD_NM, FILE_NAME | Product name, file name | False match (NM, NAME) |
| TEL_YN | Consent to phone contact, Y/N | False match (TEL) |
The older the system, the more columns like those on the left. A name search is a starting point, not a result.
Step 2: read a sample of values to confirm
What the name does not tell you, the values do. Read some rows from each table and look at the shape of the values in each column. There is no need to read everything. About a thousand rows generally shows what a column holds.
- Numbers with a check digit (resident registration numbers, card numbers, business registration numbers) are confirmed by calculation. If most of the sample passes the check, it is nearly certain.
- Values with a set shape (phone numbers, email addresses): look at the share that matches the pattern.
- Names are estimated from length, character composition and the distribution of family names. For Korean names, if values are two or three Hangul characters and the first character clusters on Kim, Lee and Park, they are likely names.
- Long text: count how often the patterns above appear inside.
What matters is the ratio. In a column of thirteen-digit numbers, it is common for one or two values to pass the resident registration number check by chance. That is a completely different matter from 980 out of 1,000 passing. So the result should be recorded not as "present/absent" but as "this many of this many sampled rows matched."
What a sample misses
A sample is, as the word says, a part. If a column has only received values in the last year and the sample was drawn only from old rows, it looks empty. A resident registration number that appears in a memo column once in a hundred rows may also go undetected, depending on the sample. Zero matches in a sample means zero in that sample. It is not proof that the column has none.
Step 3: a person makes the call
What names and values turn up are candidates. The final decision is made by someone who knows the table, because there are judgments a tool cannot make.
- Whether a ten-digit number is a phone number or an internal slip number
- Whether a value that looks like a person's name is a customer name or a branch name (Korean place names such as Gimpo and Icheon start with the family names Kim and Lee)
- Whether it is a fake number put in for testing or a real one
- Whether it is a value that is not personal data by itself but identifies a person when combined with other columns (customer number, vehicle number)
The decisions have to be recorded. If you note "confirmed: personal data" or "confirmed: not personal data" for each column, the next scan only needs to look at new candidates. Without this record, every scan goes through the same four hundred again.
Finding them once is not the end
A list of personal data columns starts going stale the day it is made. Columns are added to the production database every month, and some of them are personal data. For the list to be useful, it has to be rescanned regularly and show what changed since last time.
| Item | What to check |
|---|---|
| Names | Do you search comments as well as column names? |
| Values | Do you check by value the columns that names cannot reveal, such as spare columns and memo columns? |
| Ratio | Is the result recorded as the sample size and the match ratio? |
| Storage | Are the values read during the scan not stored? |
| Judgment | Is the result confirmed by a person recorded per column? |
| Repeat | When you rescan, are newly added columns shown separately? |
| Connection | Do the columns you found actually go into the scope of test data conversion? |
The last item is easy to miss. If the list sits on its own and the test data script still converts only the old columns, finding them was for nothing.
In DataMint
DataMint Core already suggests transformation rules from column names and comments when you create a job. That corresponds to step 1 above. The person in charge checks the suggestions and corrects them.
Steps 2 and 3, the feature that samples the production database to find personal data columns and records the decisions, will be in the next version. It has not been released yet, so we are showing only the screen for now.

Closing
There is no one-shot way to find personal data columns. Cast a wide net by name, confirm by value, have someone who knows make the call, and record the result so that next time you look only at what changed. A tool only makes the first two steps faster. Why ETC1 holds mobile phone numbers is something that, in the end, a person knows.
Personal data mixed into text such as memos is covered separately in personal data hidden in support memos and remarks fields.
- #find PII columns
- #PII discovery
- #personal data inventory
- #DBA
- #data dictionary
- #sensitive data discovery